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>{{ ticket.get_status }}</td>
<td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td> <td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td>
</tr> </tr>
{% endfor %} {% empty %}
{% if not user_tickets %}
<tr><td colspan='6'>{% trans "You have no tickets assigned to you." %}</td></tr> <tr><td colspan='6'>{% trans "You have no tickets assigned to you." %}</td></tr>
{% endif %} {% endfor %}
</tbody> </tbody>
</table> </table>
@ -107,10 +106,9 @@
<td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|timesince }} ago</span></td> <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> <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> </tr>
{% endfor %} {% empty %}
{% if not unassigned_tickets %}
<tr><td colspan='6'>{% trans "There are no unassigned tickets." %}</td></tr> <tr><td colspan='6'>{% trans "There are no unassigned tickets." %}</td></tr>
{% endif %} {% endfor %}
</tbody> </tbody>
</table> </table>

View File

@ -18,7 +18,7 @@
<td>{{ ignore.name }}</td> <td>{{ ignore.name }}</td>
<td>{{ ignore.email_address }}</td> <td>{{ ignore.email_address }}</td>
<td>{{ ignore.date }}</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>{% if ignore.keep_in_mailbox %}{% trans "Keep" %}{% endif %}</td>
<td><a href='{% url 'helpdesk_email_ignore_del' ignore.id %}'>{% trans "Delete" %}</a></td> <td><a href='{% url 'helpdesk_email_ignore_del' ignore.id %}'>{% trans "Delete" %}</a></td>
</tr> </tr>