]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/transactions_list.html.twig
Fix missing filtering icon on transactions list
[galette.git] / galette / templates / default / pages / transactions_list.html.twig
1 {% extends 'elements/list.html.twig' %}
2
3 {% set basic_table = true %}
4
5 {% set form = {
6 'route': {
7 'name': 'payments_filter',
8 'args': {
9 'type': 'transactions'
10 }
11 },
12 'order': {
13 'name': "contributions",
14 'args': {"type": "transactions"}
15 }
16 } %}
17
18 {% block search %}
19 <form action="{{ url_for("payments_filter", {"type": "transactions"}) }}" method="post" class="ui form filters">
20 <div class="ui secondary yellow segment">
21 <div class="two fields">
22 <div class="two fields">
23 <div class="field">
24 <label for="start_date_filter">{{ _T("Show transactions since") }}</label>
25 <div class="ui calendar" id="contrib-rangestart">
26 <div class="ui input left icon">
27 <i class="calendar icon"></i>
28 <input placeholder="{{ _T("(yyyy-mm-dd format)") }}" type="text" name="start_date_filter" id="start_date_filter" maxlength="10" size="10" value="{filters.start_date_filter}"/>
29 </div>
30 </div>
31 </div>
32 <div class="field">
33 <label for="end_date_filter">{{ _T("until") }}</label>
34 <div class="ui calendar" id="contrib-rangeend">
35 <div class="ui input left icon">
36 <i class="calendar icon"></i>
37 <input placeholder="{{ _T("(yyyy-mm-dd format)") }}" type="text" name="end_date_filter" id="end_date_filter" maxlength="10" size="10" value="{filters.end_date_filter}"/>
38
39 </div>
40 </div>
41 </div>
42 </div>
43 <div class="ui right aligned basic fitted segment field flexend">
44 <button type="submit" class="tooltip action ui labeled icon primary button" title="{{ _T("Apply filters") }}" name="filter">
45 <i class="search icon"></i>
46 {{ _T("Filter") }}
47 </button>
48 <button type="submit" name="clear_filter" class="tooltip ui labeled icon button" title="{{ _T("Reset all filters to defaults") }}">
49 <i class="trash alt red icon" aria-hidden="true"></i>
50 {{ _T("Clear filter") }}
51 </button>
52 </div>
53 </div>
54 </div>
55 {% if member is defined %}
56 {% if login.isAdmin() or login.isStaff() or member.canShow(login) %}
57 <div class="ui compact vertically fitted segment">
58 <div class="ui horizontal list">
59 <span class="ui primary ribbon label">
60 {% if login.isAdmin() or login.isStaff() or member.hasChildren() %}
61 <a
62 href="{{ url_for("contributions", {"type": "transactions", "option": "member", "value": "all"}) }}"
63 >
64 <i class="icon times tooltip"></i>
65 <span class="ui special popup">{{ _T("Show all members transactions") }}</span>
66 </a>
67 {% endif %}
68 {% endif %}
69 {{ member.sname }}{% if not member.isActive() %} ({{ _T("Inactive") }}){% endif %}
70 </span>
71 {% if login.isAdmin() or login.isStaff() %}
72 <div class="item">
73 <a href="{{ url_for("member", {"id": member.id}) }}" class="ui tiny button">{{ _T("See member profile") }}</a>
74 </div>
75 <div class="item">
76 <a href="{{ url_for("addTransaction") }}?id_adh={{ member.id }}" class="ui tiny button">{{ _T("Add a transaction") }}</a>
77 </div>
78 {% endif %}
79 </div>
80 </div>
81 {% endif %}
82 {% include "components/forms/csrf.html.twig" %}
83 </form>
84 {% endblock %}
85
86 {% block infoline %}
87 {% set infoline = {
88 'label': _Tn("%count transaction", "%count transactions", nb)|replace({"%count": nb}),
89 'route': {
90 'name': 'payments_filter',
91 'args': {
92 'type': 'transactions'
93 }
94 }
95 } %}
96 {{ parent() }}
97 {% endblock %}
98
99 {% block infoline_actions %}
100 {% if login.isAdmin() or login.isStaff() %}
101 <a
102 class="ui tiny labeled icon button"
103 href="{{ url_for("addTransaction") }}"
104 >
105 <i class="ui plus circle green icon" aria-hidden="true"></i>
106 {{ _T("Add a transaction") }}
107 </a>
108 {% endif %}
109 {% endblock %}
110
111 {% block header %}
112 {% set columns = [
113 {'label': '#', 'order': constant("Galette\\Filters\\TransactionsList::ORDERBY_ID")},
114 {'label': _T("Date"), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_DATE")}
115 ] %}
116
117 {% if ((login.isAdmin() or login.isStaff()) and member is not defined) or pmember is defined %}
118 {% set columns = columns|merge([{'label': _T("Member"), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_MEMBER")}]) %}
119 {% endif %}
120
121 {% set columns = columns|merge([
122 {'label': _T("Description")}
123 ]) %}
124
125 {% if login.isAdmin() or login.isStaff() %}
126 {% set columns = columns|merge([
127 {'label': _T("Originator")}
128 ]) %}
129 {% endif %}
130
131 {% set columns = columns|merge([
132 {'label': _T('Amount'), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_AMOUNT")}
133 ]) %}
134
135 {{ parent() }}
136 {% endblock %}
137
138 {% block body %}
139 {% for ordre, transaction in list %}
140 {% set mid = transaction.member %}
141 {% set cclass = transaction.getRowClass() %}
142 <tr>
143 <td class="{{ cclass }}" data-scope="row">
144 {% if preferences.pref_show_id %}
145 {{ transaction.id }}
146 {% else %}
147 {{ ordre + 1 + (filters.current_page - 1) * numrows }}
148 {% endif %}
149 <span class="displaynone">
150 <a href="{{ url_for("editTransaction", {"id": transaction.id}) }}">
151 {{ _T("Transaction %id")|replace({"%id": transaction.id}) }}
152 </a>
153 </span>
154 </td>
155 <td class="{{ cclass }}" data-title="{{ _T("Date") }}">{{ transaction.date }}</td>
156 {% if ((login.isAdmin() or login.isStaff()) and member is not defined) or pmember is defined %}
157 <td class="{{ cclass }}" data-title="{{ _T("Member") }}">
158 {% if member is defined %}
159 {% set mname = member.sname %}
160 {% else %}
161 {% set mname = memberName({id: mid}) %}
162 {% endif %}
163 {% if filters.filtre_cotis_adh == "" %}
164 <a
165 href="{{ url_for("contributions", {"type": "transactions", "option": "member", "value": mid}) }}"
166 title="{{ _T("Show only '%name' transactions")|replace({"%name": mname}) }}"
167 >
168 <i class="filter grey small icon"></i>
169 </a>
170 {% endif %}
171 <a
172 href="{{ url_for("member", {"id": mid}) }}"
173 title="{{ _T("Show '%name' card")|replace({"%name": mname}) }}"
174 >
175 {% if member is defined %}{{ member.sname }}{% else %}{{ memberName({"id": mid}) }}{% endif %}
176 </a>
177 </td>
178 {% endif %}
179 <td class="{{ cclass }}" data-title="{{ _T("Description") }}">{{ transaction.description|escape }}</td>
180 {% if login.isAdmin() or login.isStaff() %}
181 <td class="{{ cclass }}" data-title="{{ _T("Originator") }}">
182 {% if filters.filtre_cotis_adh == "" %}
183 <a href="{{ url_for("contributions", {"type": "transactions", "option": "member", "value": mid}) }}">
184 {% if member is defined %}{{ member.sname }}{% else %}{{ memberName({"id": mid}) }}{% endif %}
185 </a>
186 {% else %}
187 <a href="{{ url_for("member", {"id": mid}) }}">
188 {% if member is defined %}{{ member.sname }}{% else %}{{ memberName({"id": mid}) }}{% endif %}
189 </a>
190 {% endif %}
191 </td>
192 {% endif %}
193 <td class="actions_row {{ cclass }}" data-title="{{ _T("Amount") }}">{{ transaction.amount }}</td>
194 {% if login.isAdmin() or login.isStaff() %}
195 <td class="{{ cclass }} center">
196 <a
197 href="{{ url_for("editTransaction", {"id": transaction.id}) }}"
198 class="action"
199 >
200 <i class="ui edit icon tooltip"></i>
201 <span class="ui special popup">{{ _T("Edit transaction #%id")|replace({"%id": transaction.id}) }}</span>
202 </a>
203 <a
204 href="{{ url_for("removeContribution", {"type": "transactions", "id": transaction.id}) }}"
205 class="delete"
206 >
207 <i class="ui trash red icon tooltip"></i>
208 <span class="ui special popup">{{ _T("Remove transaction #%id")|replace({"%id": transaction.id}) }}</span>
209 </a>
210 </td>
211 {% endif %}
212 </tr>
213 {% else %}
214 <tr><td colspan="{% if login.isAdmin() or login.isStaff() %}7{% else %}5{% endif %}" class="emptylist">{{ _T("no transaction") }}</td></tr>
215 {% endfor %}
216 {% endblock %}
217
218 {% block legend %}
219 <div id="legende" title="{{ _T("Legend") }}" class="ui modal">
220 <div class="header">{{ _T("Legend") }}</div>
221 <div class="content">
222 <table class="ui stripped table">
223 <tr>
224 <th class="transaction-normal color-sample"><i class="ui icon">&nbsp;</i></th>
225 <td class="back">{{ _T("Completely dispatched transaction") }}</td>
226 </tr>
227 <tr>
228 <th class="transaction-uncomplete color-sample"><i class="ui icon">&nbsp;</i></th>
229 <td class="back">{{ _T("Uncomplete dispatched transaction") }}</td>
230 </tr>
231 </table>
232 </div>
233 <div class="actions"><div class="ui labeled icon deny button"><i class="times icon"></i> {{ _T("Close") }}</div></div>
234 </div>
235 {% endblock %}
236
237 {% block javascripts %}
238 <script type="text/javascript">
239 $(function(){
240 var _checklinks = '<div class="checkboxes ui basic horizontal segments"><div class="ui basic right aligned fitted segment"><a href="#" class="show_legend ui blue tertiary button">{{ _T("Show legend")|e('js') }}</a></div></div>';
241 $('.listing').before(_checklinks);
242 $('.listing').after(_checklinks);
243
244 //$('#table_footer').parent().before('<td class="right" colspan="{% if (login.isAdmin() or login.isStaff()) and member is not defined %}9{% elseif login.isAdmin() or login.isStaff() %}8{% else %}7{% endif %}"><a href="#" class="show_legend">{{ _T("Show legend") }}</a></td>');
245
246 _bind_legend();
247
248 {% include "elements/js/removal.js.twig" with {
249 single_action: "true"
250 } %}
251 });
252 </script>
253 {% endblock %}