Skip to content

Commit

Permalink
FIX website_event_register_free … (#264)
Browse files Browse the repository at this point in the history
 FIX website_event_register_free to allow register by public user on event without seat max
  • Loading branch information
angelmoya authored and pedrobaeza committed Nov 18, 2016
1 parent 2d8e1fb commit 3c97a15
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions website_event_register_free/view/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,15 @@
<select
name="tickets"
class="form-control"
t-if="event.seats_available or
not event.seats_max">
t-if="event.seats_available or not event.seats_max">
<t
t-foreach="range(
1,
min(event.seats_available or 10,
10) + 1)"
t-foreach="range(1, min(event.seats_available or 10, 10) + 1)"
t-as="nb">
<option t-esc="nb"/>
</t>
</select>
<span
t-if="not event.seats_available and
event.seats_max">
t-if="not (event.seats_available or not event.seats_max)">
No seats available
</span>
</td>
Expand Down Expand Up @@ -78,9 +73,15 @@
<div class="row">
<div class="form-group col-lg-6">
<label class="control-label" for="name">Quantity</label>
<select name="tickets" class="form-control" t-if="event.seats_available > 0">
<t t-foreach="range(1, event.seats_available > 9 and 11 or event.seats_available + 1)" t-as="nb">
<option t-esc="nb" t-att="{'selected': 'selected'} if str(tickets) == str(nb) else {}" />
<select
name="tickets"
class="form-control"
t-if="event.seats_available or not event.seats_max">
<t
t-foreach="range(1, min(event.seats_available or 10, 10) + 1)"
t-as="nb">
<option t-esc="nb"
t-att-selected="int(tickets) == nb and 'selected'"/>
</t>
</select>
</div>
Expand Down

0 comments on commit 3c97a15

Please sign in to comment.