Disable empty log sources

This commit is contained in:
Rodolphe Breard 2018-06-09 19:02:13 +02:00
parent 7fe6c91bed
commit 9f490febdf

View file

@ -10,9 +10,13 @@
<nav class="panel"> <nav class="panel">
<p class="panel-heading">{% trans "logs_title" %}</p> <p class="panel-heading">{% trans "logs_title" %}</p>
{% for source in sources %} {% for source in sources %}
{% if source.first_date %}
{% with date=source.first_date %} {% with date=source.first_date %}
<a class="panel-block{% if source.source__id == current_source.id %} is-active has-text-weight-semibold{% endif %}" href="{% url 'log_day' source=source.source__slug year=date.year month=date.month day=date.day %}">{{ source.source__name }}</a> <a class="panel-block{% if source.source__id == current_source.id %} is-active has-text-weight-semibold{% endif %}" href="{% url 'log_day' source=source.source__slug year=date.year month=date.month day=date.day %}">{{ source.source__name }}</a>
{% endwith %} {% endwith %}
{% else %}
<a class="panel-block has-text-grey-light is-italic">{{ source.source__name }}</a>
{% endif %}
{% empty %} {% empty %}
<a class="panel-block">{% trans "logs_no_logs_available" %}</a> <a class="panel-block">{% trans "logs_no_logs_available" %}</a>
{% endfor %} {% endfor %}