]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/documents_list.html.twig
Add association's documents management
[galette.git] / galette / templates / default / pages / documents_list.html.twig
1 {#
2 /**
3 * Copyright © 2003-2024 The Galette Team
4 *
5 * This file is part of Galette (https://galette.eu).
6 *
7 * Galette is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * Galette is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #}
21 {% extends 'elements/list.html.twig' %}
22
23 {% set form = {
24 'order': {
25 'name': "documentsList",
26 }
27 } %}
28
29 {% block infoline %}
30 {% set infoline = {
31 'label': _Tn("%count document", "%count documents", nb)|replace({"%count": nb})
32 } %}
33 {{ parent() }}
34 {% endblock %}
35
36 {% block infoline_actions %}
37 {% if not is_public and (login.isAdmin() or login.isStaff()) %}
38 <a
39 class="ui tiny labeled icon button"
40 href="{{ url_for("addDocument") }}"
41 >
42 <i class="ui user check green icon" aria-hidden="true"></i>
43 {{ _T("Add a document") }}
44 </a>
45 {% endif %}
46 {% endblock %}
47
48 {% block header %}
49 {% set columns = [
50 {'label': '#'},
51 {'label': _T('Type')},
52 {'label': _T('Visibility')},
53 {'label': _T("Filename")},
54 {'label': _T("Creation date")}
55 ] %}
56
57 {{ parent() }}
58 {% endblock %}
59
60 {% block body %}
61 {% for document in documents %}
62 <tr class="" id="row_{{ document.id }}">
63 <td data-scope="row">
64 {% if preferences.pref_show_id %}
65 {{ document.id }}
66 {% else %}
67 {{ loop.index }}
68 {% endif %}
69 </td>
70 <td data-col-label="{{ _T("Type") }}">{{ document.getType() }}</td>
71 <td data-col-label="{{ _T("Visibility") }}">{{ document.getPermissionName() }}</td>
72 <td data-col-label="{{ _T("Filename") }}">
73 <a href="{{ url_for('getDocumentFile', {'id': document.getID()}) }}">
74 {{ document.getDocumentFilename() }}
75 </a>
76 </td>
77 <td data-col-label="{{ _T("Creation date") }}">{{ document.getCreationDate() }}</td>
78 {% if mode != 'ajax' %}
79 <td class="actions_row center">
80 {% if (login.isAdmin() or login.isStaff()) %}
81 <a
82 href="{{ url_for("editDocument", {"id": document.getID()}) }}"
83 class="action"
84 >
85 <i class="ui edit icon tooltip" aria-hidden="true"></i>
86 <span class="ui special popup">{{ _T("Edit document") }}</span>
87 </a>
88 <a
89 href="{{ url_for("removeDocument", {"id": document.getID()}) }}"
90 class="delete"
91 >
92 <i class="ui trash red icon tooltip" aria-hidden="true"></i>
93 <span class="ui special popup">{{ _T("Delete document") }}</span>
94 </a>
95 {% endif %}
96 </td>
97 {% endif %}
98 </tr>
99 {% else %}
100 <tr><td colspan="{% if login.isAdmin() or login.isStaff() %}6{% else %}5{% endif %}" class="emptylist">{{ _T("No document") }}</td></tr>
101 {% endfor %}
102 {% endblock %}