extends base html load i18n block content h2 trans My dumps h2 if user

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1 {% extends 'base.html' %}
2 {% load i18n %}
3
4 {% block content %}
5 <h2>{% trans "My dumps" %}</h2>
6 {% if user.code_set.all %}
7 <table class="info-table">
8 <thead>
9 <th>{% trans "Comment" %}</th>
10 <th>{% trans "Date" %}</th>
11 <th>{% trans "Lexer" %}</th>
12 <th>&nbsp;</th>
13 <th>&nbsp;</th>
14 <th>&nbsp;</th>
15 </thead>
16 {% for code in user.code_set.all %}
17 <tr>
18 <td>{{ code.comment|escape }}</td>
19 <td>{{ code.time_created|date:"d M Y" }}</td>
20 <td>{{ code.lexer }}</td>
21 <td><a href="{% url code.views.show code.id %}">{% trans "show" %}</a></td>
22 <td><a href="{% url code.views.edit code.id %}">{% trans "edit" %}</a></td>
23 <td><a onclick="return confirm('{% trans "Are you sure?" %}')" href="{% url code.views.delete code.id %}">{% trans "delete" %}</a></td>
24 {% endfor %}
25 </table>
26 {% else %}
27 <p>{% trans "You did not add any dump from current accout" %}</p>
28 {% endif %}
29 {% endblock %}