Refactor templates

This commit is contained in:
Ludovic Stephan 2019-01-07 22:51:02 +01:00
parent 71cae7f5ca
commit 55c1d7f02c
5 changed files with 9 additions and 26 deletions

View file

@ -1,6 +1 @@
{% with spectacle=attribution.spectacle %} {% include 'bda/forms/spectacle_label_table.html' with spectacle=attribution.spectacle %}
<td>{{ spectacle.title }}</td>
<td data-sort-value="{{ spectacle.timestamp }}">{{ spectacle.date }}</td>
<td data-sort-value="{{ spectacle.location }}">{{ spectacle.location }}</td>
<td data-sort-value="{{ spectacle.price |stringformat:".3f" }}">{{ spectacle.price |floatformat }}€</td>
{% endwith %}

View file

@ -0,0 +1 @@
<td data-sort-value="{{ revente.date_tirage | date:"U" }}">{{ revente.date_tirage }}</td>

View file

@ -1,8 +1,3 @@
{% with spectacle=revente.attribution.spectacle user=revente.seller.user %} {% include 'bda/forms/spectacle_label_table.html' with spectacle=revente.attribution.spectacle %}
<td>{{ spectacle.title }}</td> {% with user=revente.seller.user %} <td>{{user.first_name}} {{user.last_name}}</td> {% endwith%}
<td data-sort-value="{{ spectacle.timestamp }}">{{ spectacle.date }}</td> {% include 'bda/forms/date_tirage.html' %}
<td data-sort-value="{{ spectacle.location }}">{{ spectacle.location }}</td>
<td data-sort-value="{{ spectacle.price |stringformat:".3f" }}">{{ spectacle.price |floatformat }}€</td>
<td>{{user.first_name}} {{user.last_name}}</td>
<td data-sort-value="{{ revente.date_tirage | date:"U" }}">{{ revente.date_tirage }}</td>
{% endwith %}

View file

@ -1,7 +1,2 @@
{% with spectacle=revente.attribution.spectacle %} {% include 'bda/forms/spectacle_label_table.html' with spectacle=revente.attribution.spectacle %}
<td>{{ spectacle.title }}</td> {% include 'bda/forms/date_tirage.html' %}
<td data-sort-value="{{ spectacle.timestamp }}">{{ spectacle.date }}</td>
<td data-sort-value="{{ spectacle.location }}">{{ spectacle.location }}</td>
<td data-sort-value="{{ spectacle.price |stringformat:".3f" }}">{{ spectacle.price |floatformat }}€</td>
<td data-sort-value="{{ revente.date_tirage | date:"U" }}">{% if revente.tirage_done %}Tirage infructueux{% else %}{{ revente.date_tirage }}{% endif %}</td>
{% endwith %}

View file

@ -1,7 +1,4 @@
{% with spectacle=revente.attribution.spectacle user=revente.soldTo.user %} {% include 'bda/forms/spectacle_label_table.html' with spectacle=revente.attribution.spectacle %}
<td>{{ spectacle.title }}</td> {% with user=revente.soldTo.user %}
<td data-sort-value="{{ spectacle.timestamp }}">{{ spectacle.date }}</td>
<td data-sort-value="{{ spectacle.location }}">{{ spectacle.location }}</td>
<td data-sort-value="{{ spectacle.price |stringformat:".3f" }}">{{ spectacle.price |floatformat }}€</td>
<td><a href="mailto:{{ user.email }}">{{user.first_name}} {{user.last_name}}</a></td> <td><a href="mailto:{{ user.email }}">{{user.first_name}} {{user.last_name}}</a></td>
{% endwith %} {% endwith %}