use for ... empty in templates

This commit is contained in:
Stefano Brentegani 2014-07-21 20:28:37 +02:00
parent b530f19d65
commit 0f103ea827
2 changed files with 5 additions and 7 deletions

View File

@ -85,10 +85,9 @@
<td>{{ ticket.get_status }}</td>
<td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td>
</tr>
{% endfor %}
{% if not user_tickets %}
{% empty %}
<tr><td colspan='6'>{% trans "You have no tickets assigned to you." %}</td></tr>
{% endif %}
{% endfor %}
</tbody>
</table>
@ -107,10 +106,9 @@
<td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|timesince }} ago</span></td>
<th><a href='{{ ticket.get_absolute_url }}?take'><span class='button button_take'>{% trans "Take" %}</span></a> | <a href='{% url 'helpdesk_delete' ticket.id %}'><span class='button button_delete'>{% trans "Delete" %}</span></a></th>
</tr>
{% endfor %}
{% if not unassigned_tickets %}
{% empty %}
<tr><td colspan='6'>{% trans "There are no unassigned tickets." %}</td></tr>
{% endif %}
{% endfor %}
</tbody>
</table>

View File

@ -18,7 +18,7 @@
<td>{{ ignore.name }}</td>
<td>{{ ignore.email_address }}</td>
<td>{{ ignore.date }}</td>
<td>{% for queue in ignore.queues.all %}{{ queue.slug }}{% if not forloop.last %}, {% endif %}{% endfor %}{% if not ignore.queues.all %}{% trans "All" %}{% endif %}</td>
<td>{% for queue in ignore.queues.all %}{{ queue.slug }}{% if not forloop.last %}, {% endif %}{% empty %}{% trans "All" %}{% endfor %}</td>
<td>{% if ignore.keep_in_mailbox %}{% trans "Keep" %}{% endif %}</td>
<td><a href='{% url 'helpdesk_email_ignore_del' ignore.id %}'>{% trans "Delete" %}</a></td>
</tr>