Grise les spectacles passés dans la liste des spectacles pour le BdA

This commit is contained in:
Evarin 2017-02-10 19:58:22 +01:00
parent e32faf6182
commit f7ec5ef9ee
3 changed files with 12 additions and 2 deletions

View file

@ -118,6 +118,9 @@ class Spectacle(models.Model):
# On renvoie la liste des destinataires # On renvoie la liste des destinataires
return members.values() return members.values()
@property
def is_past(self):
return self.date < timezone.now()
class Quote(models.Model): class Quote(models.Model):
spectacle = models.ForeignKey(Spectacle) spectacle = models.ForeignKey(Spectacle)

View file

@ -43,3 +43,6 @@ td {
margin: 10px 0px; margin: 10px 0px;
} }
.spectacle-passe {
opacity:0.5;
}

View file

@ -1,6 +1,10 @@
{% extends "base_title.html" %} {% extends "base_title.html" %}
{% load staticfiles %} {% load staticfiles %}
{% block extra_head %}
<link type="text/css" rel="stylesheet" href="{% static "css/bda.css" %}" />
{% endblock %}
{% block realcontent %} {% block realcontent %}
<h2><strong>{{tirage_name}}</strong></h2> <h2><strong>{{tirage_name}}</strong></h2>
<h3>Liste des spectacles</h3> <h3>Liste des spectacles</h3>
@ -17,9 +21,9 @@
</thead> </thead>
<tbody> <tbody>
{% for spectacle in object_list %} {% for spectacle in object_list %}
<tr class="clickable-row" data-href="{% url 'bda-spectacle' tirage_id spectacle.id %}"> <tr class="clickable-row {% if spectacle.is_past %}spectacle-passe{% endif %}" data-href="{% url 'bda-spectacle' tirage_id spectacle.id %}">
<td><a href="{% url 'bda-spectacle' tirage_id spectacle.id %}">{{ spectacle.title }} <span style="font-size:small;" class="glyphicon glyphicon-link" aria-hidden="true"></span></a></td> <td><a href="{% url 'bda-spectacle' tirage_id spectacle.id %}">{{ spectacle.title }} <span style="font-size:small;" class="glyphicon glyphicon-link" aria-hidden="true"></span></a></td>
<td data-sort-value="{{ spectacle.timestamp }}">{{ spectacle.date }}</td> <td data-sort-value="{{ spectacle.timestamp }}"">{{ spectacle.date }}</td>
<td data-sort-value="{{ spectacle.location }}">{{ spectacle.location }}</td> <td data-sort-value="{{ spectacle.location }}">{{ spectacle.location }}</td>
<td data-sort-value="{{ spectacle.price |stringformat:".3f" }}"> <td data-sort-value="{{ spectacle.price |stringformat:".3f" }}">
{{ spectacle.price |floatformat }}€ {{ spectacle.price |floatformat }}€