]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/contributions_list.html.twig
Fix transaction link icon
[galette.git] / galette / templates / default / pages / contributions_list.html.twig
1 {% extends 'elements/list.html.twig' %}
2
3 {% set basic_table = true %}
4
5 {% set form = {
6 'route': {
7 'name': "batch-contributionslist",
8 'args': {"type": "contributions"}
9 },
10 'order': {
11 'name': "contributions",
12 'args': {"type": "contributions"}
13 }
14 } %}
15
16 {% if nb != 0 and (login.isAdmin() or login.isStaff()) and mode != 'ajax' %}
17 {% set batch = {
18 'route': {
19 'name': 'batch-contributionslist',
20 'args': {"type": "contributions"}
21 },
22 'modal': {
23 'title': _T("No contribution selected"),
24 'content': _T("Please make sure to select at least one contribution from the list to perform this action.")
25 }
26 } %}
27 {% set batch_actions = [
28 {
29 'name': 'delete',
30 'label': _T("Delete"),
31 'icon': 'trash red'
32 },
33 {
34 'name': 'csv__directdownload',
35 'label': _T("Export as CSV"),
36 'icon': 'file csv'
37 }
38 ] %}
39 {% endif %}
40
41 {% block search %}
42 <form action="{{ url_for("payments_filter", {"type": "contributions"}) }}" method="post" class="ui form filters">
43 <div class="ui secondary yellow segment">
44 <div class="four fields">
45 <div class="field">
46 <label for="date_field">{{ _T("Show contributions by") }}</label>
47 <select name="date_field" id="date_field" class="ui search dropdown nochosen">
48 <option value="{{ constant("Galette\\Filters\\ContributionsList::DATE_BEGIN") }}"{% if filters.date_field == constant('Galette\\Filters\\ContributionsList::DATE_BEGIN') %} selected="selected"{% endif %}>{{ _T("Begin") }}</option>
49 <option value="{{ constant("Galette\\Filters\\ContributionsList::DATE_END") }}"{% if filters.date_field == constant('Galette\\Filters\\ContributionsList::DATE_END') %} selected="selected"{% endif %}>{{ _T("End") }}</option>
50 <option value="{{ constant("Galette\\Filters\\ContributionsList::DATE_RECORD") }}"{% if filters.date_field == constant('Galette\\Filters\\ContributionsList::DATE_RECORD') %} selected="selected"{% endif %}>{{ _T("Record") }}</option>
51 </select>
52 </div>
53 <div class="two fields">
54 <div class="field">
55 <label for="start_date_filter">{{ _T("since") }}</label>
56 <div class="ui calendar" id="contrib-rangestart">
57 <div class="ui input left icon">
58 <i class="calendar icon"></i>
59 <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 }}"/>
60 </div>
61 </div>
62 </div>
63 <div class="field">
64 <label for="end_date_filter">{{ _T("until") }}</label>
65 <div class="ui calendar" id="contrib-rangeend">
66 <div class="ui input left icon">
67 <i class="calendar icon"></i>
68 <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 }}"/>
69 </div>
70 </div>
71 </div>
72 </div>
73 <div class="field">
74 {% include "components/forms/payment_types.html.twig" with {
75 current: filters.payment_type_filter,
76 varname: "payment_type_filter",
77 show_inline: "",
78 classname: "",
79 empty: {'value': -1, 'label': _T("Select")}
80 } %}
81 </div>
82 <div class="ui right aligned basic fitted segment field flexend">
83 <button type="submit" class="tooltip ui labeled icon primary button" title="{{ _T("Apply filters") }}" name="filter">
84 <i class="search icon"></i>
85 {{ _T("Filter") }}
86 </button>
87 <button type="submit" id="clear_filter" name="clear_filter" class="tooltip ui labeled icon button" title="{{ _T("Reset all filters to defaults") }}">
88 <i class="trash alt red icon" aria-hidden="true"></i>
89 {{ _T("Clear filter") }}
90 </button>
91 </div>
92 </div>
93 </div>
94 {% if member is defined and mode != 'ajax' %}
95 {% if login.isAdmin() or login.isStaff() or member.canShow(login) %}
96 <div class="ui compact vertically fitted segment">
97 <div class="ui horizontal list">
98 <span class="ui primary ribbon label">
99 {% if login.isAdmin() or login.isStaff() or member.hasChildren() %}
100 <a
101 href="{{ url_for("contributions", {"type": "contributions", "option": "member", "value": "all"}) }}"
102 >
103 <i class="icon times tooltip"></i>
104 <span class="ui special popup">{{ _T("Show all members contributions") }}</span>
105 </a>
106 {% endif %}
107 {% endif %}
108 {{ member.sname }}{% if not member.isActive() %} ({{ _T("Inactive") }}){% endif %}
109 </span>
110 {% if login.isAdmin() or login.isStaff() %}
111 <div class="item">
112 <a href="{{ url_for("member", {"id": member.id}) }}" class="ui tiny labeled icon button">
113 <i class="ui user blue icon" aria-hidden="true"></i>
114 {{ _T("See member profile") }}
115 </a>
116 </div>
117 <div class="item">
118 <a href="{{ url_for("addContribution", {"type": constant('Galette\\Entity\\Contribution::TYPE_FEE')}) }}?id_adh={{ member.id }}" class="ui tiny labeled icon button">
119 <i class="ui receipt green icon" aria-hidden="true"></i>
120 {{ _T("Add a membership fee") }}
121 </a>
122 </div>
123 <div class="item">
124 <a href="{{ url_for("addContribution", {"type": constant('Galette\\Entity\\Contribution::TYPE_DONATION')}) }}?id_adh={{ member.id }}" class="ui tiny labeled icon button">
125 <i class="ui gift green icon" aria-hidden="true"></i>
126 {{ _T("Add a donation") }}
127 </a>
128 </div>
129 {% endif %}
130 </div>
131 </div>
132 {% endif %}
133 {% if member is defined %}
134 <div class="{{ member.getRowClass() }}{% if not member.isActive() %} inactive-account{% endif %} ui center aligned segment">
135 {{ member.getDues() }}
136 </div>
137 {% endif %}
138
139 {% if mode == 'ajax'%}
140 <input type="hidden" name="ajax" value="true"/>
141 <input type="hidden" name="max_amount" value="{{ filters.max_amount }}"/>
142 {% else %}
143 {% include "components/forms/csrf.html.twig" %}
144 {% endif %}
145 </form>
146 {% endblock %}
147
148 {% block infoline %}
149 {% set infoline = {
150 'label': _Tn("%count contribution", "%count contributions", nb)|replace({"%count": nb}),
151 'route': {
152 'name': 'payments_filter',
153 'args': {
154 'type': 'contributions'
155 }
156 }
157 } %}
158 {{ parent() }}
159 {% endblock %}
160
161 {% block infoline_actions %}
162 {% if login.isAdmin() or login.isStaff() %}
163 <a
164 class="ui tiny labeled icon button"
165 href="{{ url_for("addContribution", {type: constant('Galette\\Entity\\Contribution::TYPE_FEE')}) }}"
166 >
167 <i class="ui receipt green icon" aria-hidden="true"></i>
168 {{ _T("Add a membership fee") }}
169 </a>
170 <a
171 class="ui tiny labeled icon button"
172 href="{{ url_for("addContribution", {type: constant('Galette\\Entity\\Contribution::TYPE_DONATION')}) }}"
173 >
174 <i class="ui gift green icon" aria-hidden="true"></i>
175 {{ _T("Add a donation") }}
176 </a>
177
178 {% endif %}
179 {% endblock %}
180
181 {% block header %}
182 {% set columns = [
183 {'label': '#', 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_ID")},
184 {'label': _T("Date"), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_DATE")},
185 {'label': _T("Begin"), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_BEGIN_DATE")},
186 {'label': _T("End"), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_END_DATE")}
187 ] %}
188
189 {% if ((login.isAdmin() or login.isStaff()) and member is not defined) or pmember is defined %}
190 {% set columns = columns|merge([{'label': _T("Member"), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_MEMBER")}]) %}
191 {% endif %}
192
193 {% set columns = columns|merge([
194 {'label': _T('Type'), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_TYPE")},
195 {'label': _T('Amount'), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_AMOUNT")},
196 {'label': _T("Payment type"), 'order': constant("Galette\\Filters\\ContributionsList::ORDERBY_PAYMENT_TYPE")},
197 {'label': _T("Duration")}
198 ]) %}
199
200 {{ parent() }}
201 {% endblock %}
202
203 {% block footer %}
204 {% if nb != 0 %}
205 <tr>
206 <th class="right" colspan="{% if (login.isAdmin() or login.isStaff()) and member is not defined %}10{% else %}9{% endif %}">
207 {{ _T("Found contributions total %f")|replace({"%f": contribs.getSum()}) }}
208 </th>
209 </tr>
210 {% endif %}
211 {% endblock %}
212
213 {% block body %}
214 {% for ordre, contribution in list %}
215 {% set mid = contribution.member %}
216 {% set cclass = contribution.getRowClass() %}
217 {% if contribution.isFee() %}
218 {% set ctype = constant('Galette\\Entity\\Contribution::TYPE_FEE') %}
219 {% else %}
220 {% set ctype = constant('Galette\\Entity\\Contribution::TYPE_DONATION') %}
221 {% endif %}
222
223 <tr{% if mode == 'ajax' %} class="contribution_row" id="row_{{ contribution.id }}"{% endif %}>
224 <td class="{{ cclass }}" data-scope="row">
225 {% if (login.isAdmin() or login.isStaff()) or mode == 'ajax' %}
226 <input type="checkbox" name="entries_sel[]" value="{{ contribution.id }}"/>
227 {% else %}
228 <input type="hidden" name="contrib_id" value="{{ contribution.id }}"/>
229 {% endif %}
230 {% if preferences.pref_show_id %}
231 {{ contribution.id }}
232 {% else %}
233 {{ ordre + 1 + (filters.current_page - 1) * numrows }}
234 {% endif %}
235 {% if (login.isAdmin() or login.isStaff()) or mode == 'ajax' %}
236 <span class="displaynone">
237 <a href="{{ url_for("editContribution", {"type": ctype, "id": contribution.id}) }}">
238 {{ _T("Contribution %id")|replace({"%id": contribution.id}) }}
239 </a>
240 </span>
241 {% if contribution.isTransactionPart() %}
242 <a
243 href="{{ url_for("editTransaction", {"id": contribution.transaction.id}) }}"
244 >
245 <i class="ui linkify icon tooltip"></i>
246 <span class="ui special popup">{{ _T("Transaction: %s")|replace({"%s": contribution.transaction.description}) }}</span>
247 </a>
248 {% endif %}
249 {% else %}
250 <span class="displaynone">
251 {{ _T("Contribution %id")|replace({"%id": contribution.id}) }}
252 </span>
253 {% if contribution.isTransactionPart() %}
254 <i class="ui link icon"></i>
255 <span class="displaynone">{{ _T("Transaction: %s")|replace({"%s": contribution.transaction.description}) }}</span>
256 {% endif %}
257 {% endif %}
258 {% if not contribution.isTransactionPart() %}
259 <i class="ui icon">&nbsp;</i>
260 {% endif %}
261 </td>
262 <td class="{{ cclass }}" data-title="{{ _T("Date") }}">{{ contribution.date }}</td>
263 <td class="{{ cclass }}" data-title="{{ _T("Begin") }}">{{ contribution.begin_date }}</td>
264 <td class="{{ cclass }}" data-title="{{ _T("End") }}">{{ contribution.end_date }}</td>
265 {% if ((login.isAdmin() or login.isStaff()) and member is not defined) or pmember is defined %}
266 <td class="{{ cclass }}" data-title="{{ _T("Member") }}">
267 {% if member is defined %}
268 {% set mname = member.sname %}
269 {% else %}
270 {# FIXME #}
271 {% set mname = memberName({'id': mid}) %}
272 {% endif %}
273 {% if filters.filtre_cotis_adh == "" %}
274 <a
275 href="{{ url_for("contributions", {"type": "contributions", "option": "member", "value": mid}) }}"
276 title="{{ _T("Show only '%name' contributions")|replace({"%name": mname}) }}"
277 >
278 <i class="ui filter grey small icon"></i>
279 </a>
280 {% endif %}
281 <a
282 href="{{ url_for("member", {"id": mid}) }}"
283 title="{{ _T("Show '%name' card")|replace({"%name": mname}) }}"
284 >
285 {{ mname }}
286 </a>
287 </td>
288 {% endif %}
289 <td class="{{ cclass }}" data-title="{{ _T("Type") }}">{{ contribution.type.libelle }}</td>
290 <td class="{{ cclass }}" data-title="{{ _T("Amount") }}">{{ contribution.amount }}</td>
291 <td class="{{ cclass }}" data-title="{{ _T("Payment type") }}">{{ contribution.spayment_type }}</td>
292 <td class="{{ cclass }}" data-title="{{ _T("Duration") }}">{{ contribution.duration }}</td>
293 {% if mode != 'ajax' %}
294 <td class="actions_row {{ cclass }} center">
295 <a
296 href="{{ url_for("printContribution", {"id": contribution.id}) }}"
297 >
298 <i class="ui file pdf green icon tooltip"></i>
299 <span class="ui special popup">{{ _T("Print an invoice or a receipt (depending on contribution type)") }}</span>
300 </a>
301 {% if (login.isAdmin() or login.isStaff()) %}
302 <a
303 href="{{ url_for("editContribution", {"type": ctype, "id": contribution.id}) }}"
304 class="action"
305 >
306 <i class="ui edit icon tooltip"></i>
307 <span class="ui special popup">{{ _T("Edit the contribution") }}</span>
308 </a>
309 <a
310 href="{{ url_for("removeContribution", {"type": "contributions", "id": contribution.id}) }}"
311 class="delete"
312 >
313 <i class="ui trash red icon tooltip"></i>
314 <span class="ui special popup">{{ _T("Delete the contribution") }}</span>
315 </a>
316 {% endif %}
317 </td>
318 {% endif %}
319 </tr>
320 {% else %}
321 <tr><td colspan="{% if (login.isAdmin() or login.isStaff()) and member is not defined %}10{% elseif login.isAdmin() or login.isStaff() %}11{% else %}10{% endif %}" class="emptylist">{{ _T("no contribution") }}</td></tr>
322 {% endfor %}
323 {% endblock %}
324
325 {% block legend %}
326 <div id="legende" title="{{ _T("Legend") }}" class="ui modal">
327 <div class="header">{{ _T("Legend") }}</div>
328 <div class="content">
329 <table class="ui stripped table">
330 {% if (login.isAdmin() or login.isStaff()) and mode != 'ajax' %}
331 <tr>
332 <th class="action">
333 <i class="ui edit blue icon"></i>
334 </th>
335 <td class="back">{{ _T("Modification") }}</td>
336 </tr>
337 <tr>
338 <th class="delete">
339 <i class="ui trash red icon"></i>
340 </th>
341 <td class="back">{{ _T("Deletion") }}</td>
342 </tr>
343 {% endif %}
344 <tr>
345 <th class="cotis-normal color-sample">&nbsp;</th>
346 <td class="back">{{ _T("Contribution") }}</td>
347 </tr>
348 <tr>
349 <th class="cotis-give color-sample">&nbsp;</th>
350 <td class="back">{{ _T("Gift") }}</td>
351 </tr>
352 </table>
353 </div>
354 <div class="actions"><div class="ui labeled icon deny button"><i class="times icon"></i> {{ _T("Close") }}</div></div>
355 </div>
356 {% endblock %}