saner availability for tickets in eventview
authorKonrad Rosenbaum <konrad@silmor.de>
Sat, 26 Nov 2016 15:05:14 +0000 (16:05 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Sat, 26 Nov 2016 15:05:14 +0000 (16:05 +0100)
Change-Id: I163ecc2a109c051a49266e92ad1ffaf583fa2f62

commonlib/widgets/eventview.html

index 3813535..77dbd1e 100644 (file)
@@ -21,7 +21,11 @@ Seats: {{event.capacity}} max.; ({{event.amountSold}} sold out; {{event.amountRe
 {% for price in  event.priceFiltered %}
 <tr><td>{{price.pricecategory.name}}</td>
  <td>{{price.price|asMoney}}
- {% set avail=int(price.maxavailable)-int(price.amountticketsblock) %}</td>
+ {% set avail=int(price.maxavailable)-int(price.amountticketsblock) %}
+ {% if avail > int(event.amountFree) %}
+  {% set avail=int(event.amountFree) %}
+ {% endif %}
+ </td>
  <td>{{avail}}</td><td>{{price.maxavailable}}</td>
  <td>{% if checkflags(price.flags) && avail>0 %}
        <a href="order:?ev={{event.id}}&amp;pr={{price.pricecategoryid}}">order</a>