]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/preferences.html.twig
Improve preferences page
[galette.git] / galette / templates / default / pages / preferences.html.twig
1 {% extends 'page.html.twig' %}
2
3 {% block content %}
4 <form action="{{ path_for('store-preferences') }}" method="post" enctype="multipart/form-data" class="ui form">
5 <div class="ui stackable pointing inverted menu tabbed">
6 <a href="{{ path_for('preferences') }}?tab=general" class="item{{ tab == 'general' ? ' active' }}" data-tab="general">{{ _T("General") }}</a>
7 <a href="{{ path_for('preferences') }}?tab=social" class="item{{ tab == 'social' ? ' active' }}" data-tab="social">{{ _T("Social networks") }}</a>
8 <a href="{{ path_for('preferences') }}?tab=parameters" class="item{{ tab == 'parameters' ? ' active' }}" data-tab="parameters">{{ _T("Parameters") }}</a>
9 <a href="{{ path_for('preferences') }}?tab=rights" class="item{{ tab == 'rights' ? ' active' }}" data-tab="rights">{{ _T("Rights") }}</a>
10 <a href="{{ path_for('preferences') }}?tab=mail" class="item{{ tab == 'mail' ? ' active' }}" data-tab="mail">{{ _T("E-Mail") }}</a>
11 <a href="{{ path_for('preferences') }}?tab=labels" class="item{{ tab == 'labels' ? ' active' }}" data-tab="labels">{{ _T("Labels") }}</a>
12 <a href="{{ path_for('preferences') }}?tab=cards" class="item{{ tab == 'cards' ? ' active' }}" data-tab="cards">{{ _T("Cards") }}</a>
13 {% if login.isAdmin() %}
14 <a href="{{ path_for('preferences') }}?tab=security" class="item{{ tab == 'security' ? ' active' }}" data-tab="security">{{ _T("Security parameters") }}</a>
15 {% endif %}
16 {% if login.isSuperAdmin() %}
17 <a href="{{ path_for('preferences') }}?tab=admin" class="item{{ tab == 'admin' ? ' active' }}" data-tab="admin">{{ _T("Admin") }}</a>
18 {% endif %}
19 </div>
20 <div class="ui{{ tab == 'general' ? ' active' }} tab segment" data-tab="general">
21 <div class="ui stackable two column grid">
22 <div class="column">
23 <div class="{% if required.pref_nom == 1 %}required {% endif %} field">
24 <label for="pref_nom">{{ _T("Name of the association:") }}</label>
25 <input{% if required.pref_nom == 1 %} required="required"{% endif %} type="text" name="pref_nom" id="pref_nom" value="{{ pref.pref_nom }}" maxlength="190"/>
26 </div>
27 <div class="{% if required.pref_slogan is defined and required.pref_slogan == 1 %}required {% endif %} field">
28 <label for="pref_slogan">{{ _T("Association's short description:") }}
29 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Enter here a short description for your association, it will be displayed on the index page and into pages' title.") }}"></i>
30 </label>
31 <div class="ui action input">
32 <input{% if required.pref_slogan is defined and required.pref_slogan == 1 %} required="required"{% endif %} type="text" name="pref_slogan" id="pref_slogan" value="{{ pref.pref_slogan }}"/>
33 <a
34 href="{{ path_for("dynamicTranslations", {"text_orig": pref.pref_slogan|escape}) }}"
35 class="ui icon button"
36 >
37 <i class="language icon tooltip" title="{{ _T("Translate '%s'")|replace({'%s': pref.pref_slogan}) }}"></i>
38 <span class="sr-only">{{ _T("Translate '%s'")|replace({'%s': pref.pref_slogan}) }}</span>
39 </a>
40 </div>
41 </div>
42 </div>
43 <div class="column">
44 <div class="field ui items">
45 <label for="logo_picture">{{ _T("Logo:") }}</label>
46 <div class="item">
47 {% if logo.isCustom() %}
48 <div class="image">
49 <img src="{{ path_for('logo') }}" class="picture" width="{{ logo.getOptimalWidth() }}" height="{{ logo.getOptimalHeight() }}" alt="{{ _T("Current logo") }}"/>
50 </div>
51 {% endif %}
52 <div class="content">
53 <div class="description">
54 <input type="file" name="logo" id="logo_picture"{% if constant('GALETTE_MODE') == constant('\\Galette\\Core\\Galette::MODE_DEMO') %} disabled="disabled"{% endif %}/>
55 </div>
56 <div class="extra">
57 {% if logo.isCustom() %}
58 <div class="ui toggle checkbox">
59 <input type="checkbox" name="del_logo" id="del_logo" value="1"/>
60 <label for="del_logo" class="labelalign">{{ _T("Delete image") }}</label>
61 </div>
62 {% endif %}
63 </div>
64 </div>
65 </div>
66 </div>
67 </div>
68 </div>
69 <div class="ui stackable two column grid">
70 <div class="column">
71 <div class="{% if required.pref_adresse is defined and required.pref_adresse == 1 %}required {% endif %} field">
72 <label for="pref_adresse">{{ _T("Address:") }}</label>
73 <input{% if required.pref_adresse is defined and required.pref_adresse == 1 %} required="required"{% endif %} type="text" name="pref_adresse" id="pref_adresse" value="{{ pref.pref_adresse }}" maxlength="190"/><br/>
74 </div>
75 <div class="field">
76 <label for="pref_adresse2" class="libelle">{{ _T("Address:") }} {{ _T(" (continuation)") }}</label>
77 <input type="text" name="pref_adresse2" id="pref_adresse2" value="{{ pref.pref_adresse2 }}" maxlength="190"/>
78 </div>
79 <div class="{% if required.pref_cp is defined and required.pref_cp == 1 %}required {% endif %} field">
80 <label for="pref_cp">{{ _T("Zip Code:") }}</label>
81 <input{% if required.pref_cp is defined and required.pref_cp == 1 %} required="required"{% endif %} type="text" name="pref_cp" id="pref_cp" value="{{ pref.pref_cp }}" maxlength="10"/>
82 </div>
83 <div class="{% if required.pref_ville is defined and required.pref_ville == 1 %}required {% endif %} field">
84 <label for="pref_ville">{{ _T("City:") }}</label>
85 <input{% if required.pref_ville is defined and required.pref_ville == 1 %} required="required"{% endif %} type="text" name="pref_ville" id="pref_ville" value="{{ pref.pref_ville }}" maxlength="100"/>
86 </div>
87 <div class="{% if required.pref_pays is defined and required.pref_pays == 1 %}required {% endif %} field">
88 <label for="pref_pays">{{ _T("Country:") }}</label>
89 <input{% if required.pref_pays is defined and required.pref_pays == 1 %} required="required"{% endif %} type="text" name="pref_pays" id="pref_pays" value="{{ pref.pref_pays }}" maxlength="50"/>
90 </div>
91 <div class="{% if required.pref_website is defined and required.pref_website == 1 %}required {% endif %} field">
92 <label for="pref_website">{{ _T("Website:") }}</label>
93 <input{% if required.pref_website is defined and required.pref_website == 1 %} required="required"{% endif %} type="text" name="pref_website" id="pref_website" value="{{ pref.pref_website }}" maxlength="100"/>
94 </div>
95 </div>{# /column #}
96 <div class="column">
97 <div class="field">
98 <label>
99 {{ _T("Postal address:") }}
100 <i class="circular inverted primary small icon info tooltip" title="{{ _T("Use either the address setted below or select a staff member to retrieve he's address.") }}"></i>
101 </label>
102 <div class="inline fields">
103 <div class="field">
104 <label for="pref_postal_adress_0">{{ _T("from preferences") }}</label>
105 <input type="radio" name="pref_postal_adress" id="pref_postal_adress_0" value=" {{ constant('Galette\\Core\\Preferences::POSTAL_ADDRESS_FROM_PREFS') }}}" {% if pref.pref_postal_adress == constant('Galette\\Core\\Preferences::POSTAL_ADDRESS_FROM_PREFS') %}checked="checked"{% endif %}/>
106 </div>
107 <div class="field">
108 <label for="pref_postal_adress_1">{{ _T("from a staff user") }}</label>
109 <input type="radio" name="pref_postal_adress" id="pref_postal_adress_1" value=" {{ constant('Galette\\Core\\Preferences::POSTAL_ADDRESS_FROM_STAFF') }}}" {% if pref.pref_postal_adress == constant('Galette\\Core\\Preferences::POSTAL_ADDRESS_FROM_STAFF') %}checked="checked"{% endif %}/>
110 </div>
111 </div>
112 <label for="pref_postal_staff_member">{{ _T("Staff member") }}</label>
113 <select name="pref_postal_staff_member" id="pref_postal_staff_member" class="ui search dropdown nochosen">
114 <option value="-1">{{ _T("-- Choose a staff member --") }}</option>
115 {% for staff in staff_members %}
116 <option value="{{ staff.id }}"{% if staff.id == pref.pref_postal_staff_member %} selected="selected"{% endif %}>{{ staff.name }} ({{ staff.sstatus }})</option>
117 {% endfor %}
118 </select>
119 </div>
120 <div class="field">
121 <label for="pref_footer">{{ _T("Footer text:") }}</label>
122 <div class="ui right corner labeled input">
123 <div class="ui corner label">
124 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Enter a text (HTML allowed) that will be displayed in the footer of every page") }}"></i>
125 </div>
126 <textarea name="pref_footer" id="pref_footer" rows="2">{{ pref.pref_footer }}</textarea>
127 </div>
128 </div>
129 <div class="field">
130 <label>
131 {{ _T("Telemetry date:") }}
132 <i class="circular inverted primary small icon info tooltip" title="{{ _T("Last telemetry sent date.") }}"></i>
133 </label>
134 <span>
135 {{ preferences.getTelemetryDate() }}
136 - <a href="#" id="telemetry" class="ui labeled icon button"><i class="chart bar icon" aria-hidden="true"></i> {{ _T("send") }}</a>
137 </span>
138 </div>
139 <div class="field">
140 <label>
141 {{ _T("Registration date:") }}
142 <i class="circular inverted primary small icon info tooltip" title="{{ _T("Date on which you registered your Galette instance.") }}"></i>
143 </label>
144 <span>
145 {% if pref.pref_registration_date %}
146 {% set regtxt = _T("Update your information") %}
147 {{ preferences.getRegistrationDate() }}
148 {% else %}
149 {% set regtxt = _T("Register") %}
150 {{ _T("Not registered") }}
151 {% endif %}
152 - <a href="{{ constant('GALETTE_TELEMETRY_URI') }}reference?showmodal&uuid={{ pref.pref_registration_uuid }}" id="register" target="_blank" class="ui labeled icon button"><i class="pen alternate icon"></i>{{ regtxt }}</a>
153 </span>
154 </div>
155 </div>{# /column #}
156 </div>{# /column grid #}
157 </div>{# /tab segment #}
158 {% set socials = preferences.socials %}
159 {% include "elements/edit_socials.html.twig" with {tabbed: true} %}
160 <div class="ui{{ tab == 'parameters' ? ' active' }} tab segment" data-tab="parameters">
161 <div class="ui stackable two column grid">
162 <div class="column">
163 <div class="field">
164 <label for="pref_lang" >{{ _T("Default language:") }}</label>
165 <select name="pref_lang" id="pref_lang" class="lang ui search dropdown nochosen">
166 {% for langue in languages %}
167 <option value="{{ langue.getID() }}" {% if pref.pref_lang == langue.getID() %}selected="selected"{% endif %}>{{ langue.getName()|capitalize }}</option>
168 {% endfor %}
169 </select>
170 </div>
171 {#<div class="field">
172 <label for="pref_theme">{{ _T("Default theme:") }}</label>
173 <select name="pref_theme" id="pref_theme" class="ui search dropdown nochosen">
174 {% for theme in themes %}
175 <option value="{{ theme }}" {% if pref.pref_theme == theme %}selected="selected"{% endif %}>{{ theme|capitalize }}</option>
176 {% endfor %}
177 </select>
178 </div>#}
179 <div class="field">
180 <label for="pref_numrows">{{ _T("Lines / Page:") }}</label>
181 <select name="pref_numrows" id="pref_numrows" class="ui search dropdown nochosen">
182 {% for key, value in pref_numrows_options %}
183 <option value="{{ key }}"{% if key == pref.pref_numrows %} selected="selected"{% endif %}>{{ value }}</option>
184 {% endfor %}
185 </select>
186 </div>
187 <div class="field">
188 <label for="pref_redirect_on_create">{{ _T("After member creation:") }}</label>
189 <select name="pref_redirect_on_create" id="pref_redirect_on_create" class="ui search dropdown nochosen">
190 <option value="{{ constant('Galette\\Entity\\Adherent::AFTER_ADD_DEFAULT') }}"{% if pref.pref_redirect_on_create == constant('Galette\\Entity\\Adherent::AFTER_ADD_DEFAULT') %} selected="selected"{% endif %}>{{ _T("create a new contribution (default action)") }}</option>
191 <option value="{{ constant('Galette\\Entity\\Adherent::AFTER_ADD_TRANS') }}"{% if pref.pref_redirect_on_create == constant('Galette\\Entity\\Adherent::AFTER_ADD_TRANS') %} selected="selected"{% endif %}>{{ _T("create a new transaction") }}</option>
192 <option value="{{ constant('Galette\\Entity\\Adherent::AFTER_ADD_NEW') }}"{% if pref.pref_redirect_on_create == constant('Galette\\Entity\\Adherent::AFTER_ADD_NEW') %} selected="selected"{% endif %}>{{ _T("create another new member") }}</option>
193 <option value="{{ constant('Galette\\Entity\\Adherent::AFTER_ADD_SHOW') }}"{% if pref.pref_redirect_on_create == constant('Galette\\Entity\\Adherent::AFTER_ADD_SHOW') %} selected="selected"{% endif %}>{{ _T("show member") }}</option>
194 <option value="{{ constant('Galette\\Entity\\Adherent::AFTER_ADD_LIST') }}"{% if pref.pref_redirect_on_create == constant('Galette\\Entity\\Adherent::AFTER_ADD_LIST') %} selected="selected"{% endif %}>{{ _T("go to members list") }}</option>
195 <option value="{{ constant('Galette\\Entity\\Adherent::AFTER_ADD_HOME') }}"{% if pref.pref_redirect_on_create == constant('Galette\\Entity\\Adherent::AFTER_ADD_HOME') %} selected="selected"{% endif %}>{{ _T("go to main page") }}</option>
196 </select>
197 </div>
198 <div class="field">
199 <label for="pref_log">{{ _T("Logging level:") }}</label>
200 <select name="pref_log" id="pref_log" class="ui search dropdown nochosen">
201 <option value=" {{ constant('Galette\\Core\\Preferences::LOG_DISABLED') }}}" {% if pref.pref_log == constant('Galette\\Core\\Preferences::LOG_DISABLED') %}selected="selected"{% endif %}>{{ _T("Disabled") }}</option>
202 <option value=" {{ constant('Galette\\Core\\Preferences::LOG_ENABLED') }}}" {% if pref.pref_log == constant('Galette\\Core\\Preferences::LOG_ENABLED') %}selected="selected"{% endif %}>{{ _T("Enabled") }}</option>
203 </select>
204 </div>
205 <div class="field">
206 <label for="pref_filter_account">{{ _T("Default account filter:") }}</label>
207 <select name="pref_filter_account" id="pref_filter_account" class="ui search dropdown nochosen">
208 {% for key, value in accounts_options %}
209 <option value="{{ key }}"{% if key == pref.pref_filter_account %} selected="selected"{% endif %}>{{ value }}</option>
210 {% endfor %}
211 </select>
212 </div>
213 <div class="field">
214 <label for="pref_default_paymenttype">{{ _T("Default payment type:") }}</label>
215 <select name="pref_default_paymenttype" id="pref_default_paymenttype" class="ui search dropdown nochosen">
216 {% for key, value in paymenttypes %}
217 <option value="{{ key }}"{% if key == pref.pref_default_paymenttype %} selected="selected"{% endif %}>{{ value }}</option>
218 {% endfor %}
219 </select>
220 </div>
221 </div>{# /column #}
222 <div class="column">
223 <div class="field inline">
224 <div class="ui right aligned toggle checkbox">
225 <input type="checkbox" name="pref_bool_publicpages" id="pref_bool_publicpages" value="1" {% if pref.pref_bool_publicpages %} checked="checked"{% endif %}/>
226 <label for="pref_bool_publicpages">{{ _T("Public pages enabled?") }}</label>
227 </div>
228 </div>
229 <div class="field" id="publicpages_visibility"{% if not pref.pref_bool_publicpages %} class="hidden"{% endif %}>
230 <label for="pref_publicpages_visibility">{{ _T("Show public pages for") }}</label>
231 <select name="pref_publicpages_visibility" id="pref_publicpages_visibility" class="ui search dropdown nochosen">
232 <option value=" {{ constant('Galette\\Core\\Preferences::PUBLIC_PAGES_VISIBILITY_PUBLIC') }}}"{% if pref.pref_publicpages_visibility == constant('Galette\\Core\\Preferences::PUBLIC_PAGES_VISIBILITY_PUBLIC') %} selected="selected"{% endif %}>{{ _T("Everyone") }}</option>
233 <option value=" {{ constant('Galette\\Core\\Preferences::PUBLIC_PAGES_VISIBILITY_RESTRICTED') }}}"{% if pref.pref_publicpages_visibility == constant('Galette\\Core\\Preferences::PUBLIC_PAGES_VISIBILITY_RESTRICTED') %} selected="selected"{% endif %}>{{ _T("Up to date members") }}</option>
234 <option value=" {{ constant('Galette\\Core\\Preferences::PUBLIC_PAGES_VISIBILITY_PRIVATE') }}}"{% if pref.pref_publicpages_visibility == constant('Galette\\Core\\Preferences::PUBLIC_PAGES_VISIBILITY_PRIVATE') %} selected="selected"{% endif %}>{{ _T("Admin and staff only") }}</option>
235 </select>
236 </div>
237 <div class="field inline">
238 <div class="ui right aligned toggle checkbox">
239 <input type="checkbox" name="pref_bool_selfsubscribe" id="pref_bool_selfsubscribe" value="1"{% if pref.pref_bool_selfsubscribe %} checked="checked"{% endif %}/>
240 <label for="pref_bool_selfsubscribe">{{ _T("Self subscription enabled?") }}</label>
241 </div>
242 </div>
243 <div class="field">
244 <label for="pref_new_contrib_script" class="tooltip">{{ _T("Post new contribution script URI") }}</label>
245 <div class="ui right corner labeled input">
246 <div class="ui corner label">
247 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Enter a script URI that would be called after adding a new contribution.<br/>Script URI must be prefixed by one of '<em>galette://</em>' for Galette internal call. '<em>file://</em>' for a direct file call, '<em>get://</em>' or '<em>post://</em>' for HTTP calls (prefix will be replaced by http:// in those cases).") }}"></i>
248 </div>
249 <input type="text" name="pref_new_contrib_script" id="pref_new_contrib_script" value="{{ pref.pref_new_contrib_script }}"/>
250 </div>
251 </div>
252 <div class="field">
253 <label for="pref_rss_url" class="tooltip">{{ _T("RSS feed URL") }}</label>
254 <div class="ui right corner labeled input">
255 <div class="ui corner label">
256 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Enter the full URL to the RSS feed. It will be displayed on Galette desktop.") }}"></i>
257 </div>
258 <input type="text" name="pref_rss_url" id="pref_rss_url" value="{{ pref.pref_rss_url }}"{% if required.pref_rss_url is defined and required.pref_rss_url == 1 %} required="required"{% endif %}/>
259 </div>
260 </div>
261 <div class="field">
262 <label for="pref_galette_url" class="tooltip">{{ _T("Galette base URL") }}</label>
263 <div class="ui right corner labeled input">
264 <div class="ui corner label">
265 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Enter the base URL to your Galette instance. You should only change this parameter if the current page URL is not:<br/>%galette_url")|replace({"%galette_url": preferences.getDefaultURL() ~ path_for('preferences')}) }}"></i>
266 </div>
267 <input type="text" name="pref_galette_url" id="pref_galette_url" placeholder="{{ preferences.getDefaultURL() }}" value="{{ pref.pref_galette_url }}"{% if required.pref_galette_url is defined and required.pref_galette_url == 1 %} required="required"{% endif %}/>
268 </div>
269 </div>
270 <div class="field inline">
271 <div class="ui right aligned toggle checkbox">
272 <input type="checkbox" name="pref_show_id" id="pref_show_id" value="1" {% if pref.pref_show_id %} checked="checked"{% endif %}/>
273 <label for="pref_show_id" class="tooltip">{{ _T("Show identifiers") }}</label>
274 </div>
275 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Display database identifiers in related windows") }}"></i>
276 </div>
277 </div>{# /column #}
278 </div>{# /column grid #}
279 <div class="ui stackable two column grid">
280 <div class="column">
281 <div class="field">
282 <label for="pref_statut">{{ _T("Default membership status:") }}</label>
283 <select name="pref_statut" id="pref_statut" class="ui search dropdown nochosen">
284 {% for key, value in statuts %}
285 <option value="{{ key }}"{% if key == pref.pref_statut %} selected="selected"{% endif %}>{{ value }}</option>
286 {% endfor %}
287 </select>
288 </div>
289 <div class="field">
290 <label for="pref_membership_ext">{{ _T("Default membership extension:") }}</label>
291 <div class="ui right labeled input">
292 <input type="text" name="pref_membership_ext" id="pref_membership_ext" value="{{ pref.pref_membership_ext }}" maxlength="2"{% if required.pref_membership_ext is defined and required.pref_membership_ext == 1 %} required="required"{% endif %}/>
293 <div class="ui basic label">
294 {{ _T("(Months)") }}
295 </div>
296 </div>
297 </div>
298 </div>{# /column #}
299 <div class="column">
300 <div class="field">
301 <label for="pref_beg_membership">{{ _T("Beginning of membership:") }}</label>
302 <input type="text" name="pref_beg_membership" id="pref_beg_membership" value="{{ pref.pref_beg_membership }}" maxlength="5"{% if required.pref_beg_membership is defined and required.pref_beg_membership == 1 %} required="required"{% endif %}/>
303 <span class="exemple">{{ _T("(dd/mm)") }}</span>
304 </div>
305 <div class="field">
306 <label for="pref_membership_offermonths">{{ _T("Number of months offered:") }}</label>
307 <div class="ui right corner labeled input">
308 <div class="ui corner label">
309 <i class="circular inverted primary link icon info tooltip" title="{{ _T("When using the beginning of membership option; you can offer the last months of the year.") }}<br/>{{ _T("Let's say you offer last 2 months, and have a renewal on 31th of December. All created contributions in current year will be valid until this date, but as of October, they will be valid for the entire next year.") }}"></i>
310 </div>
311 <input type="number" name="pref_membership_offermonths" min="0" id="pref_membership_offermonths" value="{{ pref.pref_membership_offermonths }}" maxlength="5"{% if required.pref_membership_offermonths is defined and required.pref_membership_offermonths == 1 %} required="required"{% endif %}/>
312 </div>
313 </div>
314 </div>{# /column #}
315 </div>{# /column grid #}
316 </div>{# /tab segment #}
317 <div class="ui{{ tab == 'rights' ? ' active' }} tab segment" data-tab="rights">
318 <div class="ui stackable two column grid">
319 <div class="column">
320 <div class="field inline">
321 <div class="ui right aligned toggle checkbox">
322 <input type="checkbox" name="pref_bool_create_member" id="pref_bool_create_member" value="1" {% if pref.pref_bool_create_member == 1 %}checked="checked"{% endif %}/>
323 <label for="pref_bool_create_member">{{ _T("Can members create child?") }}</label>
324 </div>
325 </div>
326 <div class="field inline">
327 <div class="ui right aligned toggle checkbox">
328 <input type="checkbox" name="pref_bool_groupsmanagers_edit_groups" id="pref_bool_groupsmanagers_edit_groups" value="1" {% if pref.pref_bool_groupsmanagers_edit_groups == 1 %}checked="checked"{% endif %}/>
329 <label for="pref_bool_groupsmanagers_edit_groups">{{ _T("Can group managers edit their groups?") }}</label>
330 </div>
331 </div>
332 <div class="field inline">
333 <div class="ui right aligned toggle checkbox">
334 <input type="checkbox" name="pref_bool_groupsmanagers_create_member" id="pref_bool_groupsmanagers_create_member" value="1" {% if pref.pref_bool_groupsmanagers_create_member == 1 %}checked="checked"{% endif %}/>
335 <label for="pref_bool_groupsmanagers_create_member">{{ _T("Can group managers create members?") }}</label>
336 </div>
337 </div>
338 <div class="field inline">
339 <div class="ui right aligned toggle checkbox">
340 <input type="checkbox" name="pref_bool_groupsmanagers_edit_member" id="pref_bool_groupsmanagers_edit_member" value="1" {% if pref.pref_bool_groupsmanagers_edit_member == 1 %}checked="checked"{% endif %}/>
341 <label for="pref_bool_groupsmanagers_edit_member">{{ _T("Can group managers edit members?") }}</label>
342 </div>
343 </div>
344 <div class="field inline">
345 <div class="ui right aligned toggle checkbox">
346 <input type="checkbox" name="pref_bool_groupsmanagers_mailings" id="pref_bool_groupsmanagers_mailings" value="1" {% if pref.pref_bool_groupsmanagers_mailings == 1 %}checked="checked"{% endif %}/>
347 <label for="pref_bool_groupsmanagers_mailings">{{ _T("Can group managers send mailings?") }}</label>
348 </div>
349 </div>
350 <div class="field inline">
351 <div class="ui right aligned toggle checkbox">
352 <input type="checkbox" name="pref_bool_groupsmanagers_exports" id="pref_bool_groupsmanagers_exports" value="1" {% if pref.pref_bool_groupsmanagers_exports == 1 %}checked="checked"{% endif %}/>
353 <label for="pref_bool_groupsmanagers_exports" class="tooltip">{{ _T("Can group managers do exports?") }}</label>
354 </div>
355 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Groups managers will be allowed to export members as csv, pdf cards, attendence sheetss and groups pdf") }}"></i>
356 </div>
357 </div>
358 </div>
359 </div>{# /tab segment #}
360 <div class="ui{{ tab == 'mail' ? ' active' }} tab segment" data-tab="mail">
361 <div class="ui stackable two column grid">
362 <div class="column">
363 {% if constant('GALETTE_MODE') == constant('\\Galette\\Core\\Galette::MODE_DEMO') %}
364 <div class="ui negative message">
365 <p>{{ _T("Application runs under demo mode. This functionnality is not enabled, sorry.") }}</p>
366 </div>
367 {% else %}
368 <div class="field">
369 <label for="pref_email_nom">{{ _T("Sender name:") }}</label>
370 <input type="text" name="pref_email_nom" id="pref_email_nom" value="{{ pref.pref_email_nom }}" maxlength="50"{% if required.pref_email_nom is defined and required.pref_email_nom == 1 %} required="required"{% endif %}/>
371 </div>
372 <div class="{% if required.pref_email is defined and required.pref_email == 1 %}required {% endif %}field">
373 <label for="pref_email">{{ _T("Sender Email:") }}</label>
374 {% set pref_email = preferences.vpref_email|join(',') %}
375 <input type="text" name="pref_email" id="pref_email" value="{{ pref_email }}" maxlength="100" size="30"{% if required.pref_email is defined and required.pref_email == 1 %} required="required"{% endif %}/>
376 <span class="exemple">{{ _T("(You can enter several emails separated with a comma. First address will be the default one.)") }}</span>
377 </div>
378 <div class="field">
379 <label for="pref_email_reply_to" class="tooltip">{{ _T("Reply-To Email:") }}</label>
380 <div class="ui right corner labeled input">
381 <div class="ui corner label">
382 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Leave empty to use Sender Email as reply address") }}"></i>
383 </div>
384 <input type="text" name="pref_email_reply_to" id="pref_email_reply_to" value="{{ pref.pref_email_reply_to }}" maxlength="100" size="30"{% if required.pref_email_reply_to is defined and required.pref_email_reply_to == 1 %} required="required"{% endif %}/>
385 </div>
386 </div>
387 <div class="field">
388 {% set pref_email = preferences.vpref_email_newadh|join(',') %}
389 <label for="pref_email_newadh" class="tooltip">{{ _T("Members administrator's Email:") }}</label>
390 <div class="ui right corner labeled input">
391 <div class="ui corner label">
392 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Recipient of new online registation and edition emails") }}"></i>
393 </div>
394 <input type="text" name="pref_email_newadh" id="pref_email_newadh" value="{{ pref.pref_email_newadh }}" maxlength="100" size="30"{% if required.pref_email_newadh is defined and required.pref_email_newadh == 1 %} required="required"{% endif %}/>
395 </div>
396 <span class="exemple">{{ _T("(You can enter several emails separated with a comma. First address will be the default one.)") }}</span>
397 </div>
398 <div class="field inline">
399 <div class="ui right aligned toggle checkbox">
400 <input type="checkbox" name="pref_bool_mailadh" id="pref_bool_mailadh" value="1" {% if pref.pref_bool_mailadh == 1 %}checked="checked"{% endif %}{% if required.pref_bool_mailadh is defined and required.pref_bool_mailadh == 1 %} required="required"{% endif %}/>
401 <label for="pref_bool_mailadh" class="tooltip">{{ _T("Send email to administrators?") }}</label>
402 </div>
403 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Sends an email each time a new member registers online or edit his/her account") }}"></i>
404 </div>
405 <div class="field inline">
406 <div class="ui right aligned toggle checkbox">
407 <input type="checkbox" name="pref_bool_wrap_mails" id="pref_bool_wrap_mails" value="1" {% if pref.pref_bool_wrap_mails == 1 %}checked="checked"{% endif %}{% if required.pref_bool_wrap_mails is defined and required.pref_bool_wrap_mails == 1 %} required="required"{% endif %}/>
408 <label for="pref_bool_wrap_mails" class="tooltip">{{ _T("Wrap emails text?") }}</label>
409 </div>
410 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Automatically wrap emails texts before sending. Make sure to wrap yourself if you disable that. Please note that current editing mailing will not be affected by a change.") }}"></i>
411 </div>
412 <div class="field inline">
413 <div class="ui right aligned toggle checkbox">
414 <input type="checkbox" name="pref_bool_mailowner" id="pref_bool_mailowner" value="1" {% if pref.pref_bool_mailowner == 1 %}checked="checked"{% endif %}{% if required.pref_bool_mailowner is defined and required.pref_bool_mailowner == 1 %} required="required"{% endif %}/>
415 <label for="pref_bool_mailowner" class="tooltip">{{ _T("Send email to members?") }}</label>
416 </div>
417 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Sends an email each time a member card or a contribution has been added or edited. This can be disabled for each case.") }}"></i>
418 </div>
419 <div class="field inline">
420 <div class="ui right aligned toggle checkbox">
421 <input type="checkbox" name="pref_editor_enabled" id="pref_editor_enabled" value="1" {% if pref.pref_editor_enabled == 1 %}checked="checked"{% endif %}{% if required.pref_editor_enabled is defined and required.pref_editor_enabled == 1 %} required="required"{% endif %}/>
422 <label for="pref_editor_enabled" class="tooltip">{{ _T("Activate HTML editor?") }}</label>
423 </div>
424 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Should HTML editor be activated on page load ?") }}"></i>
425 </div>
426 <div class="field mail_sign">
427 <label for="pref_mail_sign" class="tooltip">{{ _T("Mail signature") }}</label>
428 <div class="ui right corner labeled input">
429 <div class="ui corner label" id="mail_sign">
430 </div>
431 <textarea name="pref_mail_sign" id="pref_mail_sign" rows="5">{{ pref.pref_mail_sign }}</textarea>
432 </div>
433 </div>
434 </div>{# /column #}
435 <div class="column">
436 <div class="grouped fields">
437 <label{% if required.pref_mail_method is defined and required.pref_mail_method == 1 %} required="required"{% endif %}>{{ _T("Emailing method:") }}</label>
438 <div class="field">
439 <div class="ui radio checkbox">
440 <input type="radio" name="pref_mail_method" id="no" value=" {{ constant('Galette\\Core\\GaletteMail::METHOD_DISABLED') }}" {% if pref.pref_mail_method == constant('Galette\\Core\\GaletteMail::METHOD_DISABLED') %}checked="checked"{% endif %}/><label for="no">{{ _T("Emailing disabled") }}</label>
441 </div>
442 </div>
443 <div class="field">
444 <div class="ui radio checkbox">
445 <input type="radio" name="pref_mail_method" id="php" value=" {{ constant('Galette\\Core\\GaletteMail::METHOD_PHPMAIL') }}" {% if pref.pref_mail_method == constant('Galette\\Core\\GaletteMail::METHOD_PHPMAIL') %}checked="checked"{% endif %}/><label for="php">{{ _T("PHP mail() function") }}</label>
446 </div>
447 </div>
448 <div class="field">
449 <div class="ui radio checkbox">
450 <input type="radio" name="pref_mail_method" id="smtp" value=" {{ constant('Galette\\Core\\GaletteMail::METHOD_SMTP') }}" {% if pref.pref_mail_method == constant('Galette\\Core\\GaletteMail::METHOD_SMTP') %}checked="checked"{% endif %}/><label for="smtp">{{ _T("Using a SMTP server (slower)") }}</label>
451 </div>
452 </div>
453 <div class="field">
454 <div class="ui radio checkbox">
455 <input type="radio" name="pref_mail_method" id="gmail" value=" {{ constant('Galette\\Core\\GaletteMail::METHOD_GMAIL') }}" {% if pref.pref_mail_method == constant('Galette\\Core\\GaletteMail::METHOD_GMAIL') %}checked="checked"{% endif %}/><label for="gmail">{{ _T("Using GMAIL as SMTP server (slower)") }}</label>
456 </div>
457 </div>
458 <div class="field">
459 <div class="ui radio checkbox">
460 <input type="radio" name="pref_mail_method" id="sendmail" value=" {{ constant('Galette\\Core\\GaletteMail::METHOD_SENDMAIL') }}" {% if pref.pref_mail_method == constant('Galette\\Core\\GaletteMail::METHOD_SENDMAIL') %}checked="checked"{% endif %}/><label for="sendmail">{{ _T("Using Sendmail server") }}</label>
461 </div>
462 </div>
463 <div class="field">
464 <div class="ui radio checkbox">
465 <input type="radio" name="pref_mail_method" id="qmail" value=" {{ constant('Galette\\Core\\GaletteMail::METHOD_QMAIL') }}" {% if pref.pref_mail_method == constant('Galette\\Core\\GaletteMail::METHOD_QMAIL') %}checked="checked"{% endif %}/><label for="qmail">{{ _T("Using QMAIL server") }}</label>
466 </div>
467 </div>
468 <br/>
469 <a
470 href="{{ path_for('testEmail') }}#mail"
471 id="btnmail"
472 class="ui labeled icon button"
473 >
474 <i class="rocket icon" aria-hidden="true"></i>
475 {{ _T("Test email settings") }}
476 </a>
477 </div>
478 <div id="smtp_parameters" class="field">
479 <div class="field">
480 <label for="pref_mail_smtp_host">{{ _T("SMTP server:") }}</label>
481 <input type="text" name="pref_mail_smtp_host" id="pref_mail_smtp_host" value="{{ pref.pref_mail_smtp_host }}" maxlength="100" size="30"{% if required.pref_mail_smtp_host is defined and required.pref_mail_smtp_host == 1 %} required="required"{% endif %}/>
482 </div>
483 <div class="field">
484 <label for="pref_mail_smtp_port">{{ _T("SMTP port:") }}</label>
485 <input type="text" name="pref_mail_smtp_port" id="pref_mail_smtp_port" value="{{ pref.pref_mail_smtp_port }}" size="10"{% if required.pref_mail_smtp_port is defined and required.pref_mail_smtp_port == 1 %} required="required"{% endif %}/>
486 </div>
487 <div class="grouped fields">
488 <div class="field inline">
489 <div class="ui right aligned toggle checkbox">
490 <input type="checkbox" name="pref_mail_smtp_auth" id="pref_mail_smtp_auth" value="1" {% if pref.pref_mail_smtp_auth == 1 %}checked="checked"{% endif %}{% if required.pref_mail_smtp_auth is defined and required.pref_mail_smtp_auth == 1 %} required="required"{% endif %}/>
491 <label for="pref_mail_smtp_auth" class="tooltip">{{ _T("Use SMTP authentication?") }}</label>
492 </div>
493 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Would emailing use any SMTP authentication? You'll have to provide username and password below. For GMail, authentication will always be on.") }}"></i>
494 </div>
495 <div class="field inline">
496 <div class="ui right aligned toggle checkbox">
497 <input type="checkbox" name="pref_mail_smtp_secure" id="pref_mail_smtp_secure" value="1" {% if pref.pref_mail_smtp_secure == 1 %}checked="checked"{% endif %}{% if required.pref_mail_smtp_secure is defined and required.pref_mail_smtp_secure == 1 %} required="required"{% endif %}/>
498 <label for="pref_mail_smtp_secure" class="tooltip">{{ _T("Use TLS for SMTP?") }}</label>
499 </div>
500 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Do you want to use server's TLS capabilities?<br/>For GMail, this will always be on.") }}"></i>
501 </div>
502 <div class="field inline">
503 <div class="ui right aligned toggle checkbox">
504 <input type="checkbox" name="pref_mail_allow_unsecure" id="pref_mail_allow_unsecure" value="1" {% if pref.pref_mail_allow_unsecure == 1 %}checked="checked"{% endif %}{% if required.pref_mail_allow_unsecure is defined and required.pref_mail_allow_unsecure == 1 %} required="required"{% endif %}/>
505 <label for="pref_mail_allow_unsecure" class="tooltip">{{ _T("Allow unsecure TLS?") }}</label>
506 </div>
507 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Do you want to allow 'unsecure' connections? This may be usefull if you server uses a self-signed certificate, and on some other cases.") }}"></i>
508 </div>
509 </div>
510 </div>
511 <div id="smtp_auth" class="field">
512 <div class="field">
513 <label for="pref_mail_smtp_user">{{ _T("SMTP (or GMail) user:") }}</label>
514 <input type="text" name="pref_mail_smtp_user" id="pref_mail_smtp_user" value="{{ pref.pref_mail_smtp_user }}" maxlength="100" size="30"{% if required.pref_mail_smtp_user is defined and required.pref_mail_smtp_user == 1 %} required="required"{% endif %}/>
515 </div>
516 <div class="field">
517 <label for="pref_mail_smtp_password">{{ _T("SMTP (or GMail) password:") }}</label>
518 <input type="password" name="pref_mail_smtp_password" id="pref_mail_smtp_password" value="{{ pref.pref_mail_smtp_password }}" autocomplete="off" maxlength="100" size="30"{% if required.pref_mail_smtp_password is defined and required.pref_mail_smtp_password == 1 %} required="required"{% endif %}/>
519 </div>
520 </div>
521 {% endif %}
522 </div>{# /column #}
523 </div>{# /column grid #}
524 </div>{# /tab segment #}
525 <div class="ui{{ tab == 'labels' ? ' active' }} tab segment" data-tab="labels">
526 <div class="ui two column grid">
527 <div class="column">
528 <div class="field">
529 <label for="pref_etiq_marges_v">{{ _T("Vertical margins:") }}</label>
530 <div class="ui right labeled input">
531 <input type="number" name="pref_etiq_marges_v" id="pref_etiq_marges_v" value="{{ pref.pref_etiq_marges_v }}" maxlength="4"{% if required.pref_etiq_marges_v is defined and required.pref_etiq_marges_v == 1 %} required="required"{% endif %}/>
532 <div class="ui basic label">mm</div>
533 </div>
534 </div>
535 <div class="field">
536 <label for="pref_etiq_marges_h">{{ _T("Horizontal margins:") }}</label>
537 <div class="ui right labeled input">
538 <input type="number" name="pref_etiq_marges_h" id="pref_etiq_marges_h" value="{{ pref.pref_etiq_marges_h }}" maxlength="4"{% if required.pref_etiq_marges_h is defined and required.pref_etiq_marges_h == 1 %} required="required"{% endif %}/>
539 <div class="ui basic label">mm</div>
540 </div>
541 </div>
542 <div class="field">
543 <label for="pref_etiq_hspace">{{ _T("Horizontal spacing:") }}</label>
544 <div class="ui right labeled input">
545 <input type="number" name="pref_etiq_hspace" id="pref_etiq_hspace" value="{{ pref.pref_etiq_hspace }}" maxlength="4"{% if required.pref_etiq_hspace is defined and required.pref_etiq_hspace == 1 %} required="required"{% endif %}/>
546 <div class="ui basic label">mm</div>
547 </div>
548 </div>
549 <div class="field">
550 <label for="pref_etiq_vspace">{{ _T("Vertical spacing:") }}</label>
551 <div class="ui right labeled input">
552 <input type="number" name="pref_etiq_vspace" id="pref_etiq_vspace" value="{{ pref.pref_etiq_vspace }}" maxlength="4"{% if required.pref_etiq_vspace is defined and required.pref_etiq_vspace == 1 %} required="required"{% endif %}/>
553 <div class="ui basic label">mm</div>
554 </div>
555 </div>
556 <div class="field inline">
557 <div class="ui right aligned toggle checkbox">
558 <input type="checkbox" name="pref_etiq_border" id="pref_etiq_border" value="1" {% if pref.pref_etiq_border == 1 %}checked="checked"{% endif %}/>
559 <label for="pref_etiq_border" class="tooltip">{{ _T("Print border") }}</label>
560 </div>
561 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Check this box to print a grey border around each label.") }}"></i>
562 </div>
563 </div>{# /column #}
564 <div class="column">
565 <div class="field">
566 <label for="pref_etiq_hsize">{{ _T("Label width:") }}</label>
567 <div class="ui right labeled input">
568 <input type="number" name="pref_etiq_hsize" id="pref_etiq_hsize" value="{{ pref.pref_etiq_hsize }}" maxlength="4"{% if required.pref_etiq_hsize is defined and required.pref_etiq_hsize == 1 %} required="required"{% endif %}/>
569 <div class="ui basic label">mm</div>
570 </div>
571 </div>
572 <div class="field">
573 <label for="pref_etiq_vsize">{{ _T("Label height:") }}</label>
574 <div class="ui right labeled input">
575 <input type="number" name="pref_etiq_vsize" id="pref_etiq_vsize" value="{{ pref.pref_etiq_vsize }}" maxlength="4"{% if required.pref_etiq_vsize is defined and required.pref_etiq_vsize == 1 %} required="required"{% endif %}/>
576 <div class="ui basic label">mm</div>
577 </div>
578 </div>
579 <div class="field">
580 <label for="pref_etiq_cols">{{ _T("Number of label columns:") }}</label>
581 <input type="number" name="pref_etiq_cols" id="pref_etiq_cols" value="{{ pref.pref_etiq_cols }}" maxlength="4"{% if required.pref_etiq_cols is defined and required.pref_etiq_cols == 1 %} required="required"{% endif %}/>
582 </div>
583 <div class="field">
584 <label for="pref_etiq_rows">{{ _T("Number of label lines:") }}</label>
585 <input type="number" name="pref_etiq_rows" id="pref_etiq_rows" value="{{ pref.pref_etiq_rows }}" maxlength="4"{% if required.pref_etiq_rows is defined and required.pref_etiq_rows == 1 %} required="required"{% endif %}/>
586 </div>
587 <div class="field">
588 <label for="pref_etiq_corps">{{ _T("Font size:") }}</label>
589 <input type="number" name="pref_etiq_corps" id="pref_etiq_corps" value="{{ pref.pref_etiq_corps }}" maxlength="4"{% if required.pref_etiq_corps is defined and required.pref_etiq_corps == 1 %} required="required"{% endif %}/>
590 </div>
591 </div>{# /column #}
592 </div>{# /column grid #}
593 </div>{# /tab segment #}
594 <div class="ui{{ tab == 'cards' ? ' active' }} tab segment" data-tab="cards">
595 <div class="ui message">
596 <p>{{ _T("Each card is 75mm width and 40mm height. Each page contains 2 columns and 6 rows.<br/>Double check margins and spacings ;)") }}</p>
597 </div>
598 <div class="ui two column grid">
599 <div class="column">
600 <div class="field">
601 <label for="pref_card_abrev">{{ _T("Short Text (Card Center):") }}</label>
602 <div class="ui action input">
603 <input type="text" name="pref_card_abrev" id="pref_card_abrev" value="{{ pref.pref_card_abrev }}" size="10" maxlength="10"{% if required.pref_card_abrev is defined and required.pref_card_abrev == 1 %} required="required"{% endif %}/>
604 <a
605 href="{{ path_for("dynamicTranslations", {"text_orig": pref.pref_card_abrev|escape}) }}"
606 class="ui icon button"
607 >
608 <i class="language icon tooltip" title="{{ _T("Translate '%s'")|replace({"%s": pref.pref_card_abrev}) }}"></i>
609 <span class="hidden">{{ _T("Translate '%s'")|replace({'%s': pref.pref_card_abrev}) }}</span>
610 </a>
611 </div>
612 <span class="exemple">{{ _T("(10 characters max)") }}</span>
613 </div>
614 <div class="field">
615 <label for="pref_card_strip">{{ _T("Long Text (Bottom Line):") }}</label>
616 <div class="ui action input">
617 <input type="text" name="pref_card_strip" id="pref_card_strip" value="{{ pref.pref_card_strip }}" size="40" maxlength="65"{% if required.pref_card_strip is defined and required.pref_card_strip == 1 %} required="required"{% endif %}/>
618 <a
619 href="{{ path_for("dynamicTranslations", {"text_orig": pref.pref_card_strip|escape}) }}"
620 class="ui icon button "
621 >
622 <i class="language icon tooltip" title="{{ _T("Translate '%s'")|replace({"%s": pref.pref_card_strip}) }}"></i>
623 <span class="hidden">{{ _T("Translate '%s'")|replace({'%s': pref.pref_card_strip}) }}</span>
624 </a>
625 </div>
626 <span class="exemple">{{ _T("(65 characters max)") }}</span>
627 </div>
628 <div class="grouped fields">
629 <div class="inline field">
630 <label for="pref_card_tcol" class="tooltip">{{ _T("Strip Text Color:") }}</label>
631 <input type="color" name="pref_card_tcol" id="pref_card_tcol" value="{{ pref.pref_card_tcol }}" size="7" maxlength="7"{% if required.pref_card_tcol is defined and required.pref_card_tcol == 1 %} required="required"{% endif %}/>
632 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Hexadecimal color notation: #RRGGBB") }}"></i>
633 </div>
634 <div class="inline field">
635 <label for="pref_card_scol" class="tooltip">{{ _T("Active Member Color:") }}</label>
636 <input type="color" name="pref_card_scol" id="pref_card_scol" value="{{ pref.pref_card_scol }}" size="7" maxlength="7"{% if required.pref_card_scol is defined and required.pref_card_scol == 1 %} required="required"{% endif %}/>
637 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Hexadecimal color notation: #RRGGBB") }}"></i>
638 </div>
639 <div class="inline field">
640 <label for="pref_card_bcol" class="tooltip">{{ _T("Board Members Color:") }}</label>
641 <input type="color" name="pref_card_bcol" id="pref_card_bcol" value="{{ pref.pref_card_bcol }}" size="7" maxlength="7"{% if required.pref_card_bcol is defined and required.pref_card_bcol == 1 %} required="required"{% endif %}/>
642 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Hexadecimal color notation: #RRGGBB") }}"></i>
643 </div>
644 <div class="inline field">
645 <label for="pref_card_hcol" class="tooltip">{{ _T("Honor Members Color:") }}</label>
646 <input type="color" name="pref_card_hcol" id="pref_card_hcol" value="{{ pref.pref_card_hcol }}" size="7" maxlength="7"{% if required.pref_card_hcol is defined and required.pref_card_hcol == 1 %} required="required"{% endif %}/>
647 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("Hexadecimal color notation: #RRGGBB") }}"></i>
648 </div>
649 </div>{# /group fields #}
650 <div class="field ui items">
651 <label for="card_logo"{% if required.card_logo is defined and required.card_logo == 1 %} required="required"{% endif %}>{{ _T("Logo:") }}</label>
652 <div class="item">
653 {% if print_logo.isCustom() %}
654 <div class="image">
655 <img src="{{ path_for('printLogo') }}" class="picture" width="{{ print_logo.getOptimalWidth() }}" height="{{ print_logo.getOptimalHeight() }}" alt="{{ _T("Current logo for printing") }}"/><br/>
656 </div>
657 {% endif %}
658 <div class="content">
659 <div class="description">
660 <input type="file" name="card_logo" id="card_logo"{% if constant('GALETTE_MODE') == constant('Galette\\Core\\Galette::MODE_DEMO') %} disabled="disabled"{% endif %}/>
661 </div>
662 <div class="extra">
663 {% if print_logo.isCustom() %}
664 <div class="ui toggle checkbox">
665 <input type="checkbox" name="del_card_logo" id="del_card_logo" value="1" />
666 <label for="del_card_logo">{{ _T("Delete image") }}</label>
667 </div>
668 {% endif %}
669 </div>
670 </div>
671 </div>
672 </div>
673 </div>{# /column #}
674 <div class="column">
675 <div class="field inline">
676 <div class="ui right aligned toggle checkbox">
677 <input type="checkbox" name="pref_card_self" id="pref_card_self" value="1" {% if pref.pref_card_self == 1 %}checked="checked"{% endif %}{% if required.pref_bool_display_title is defined and required.pref_bool_display_title == 1 %} required="required"{% endif %}/>
678 <label for="pref_card_self">{{ _T("Allow members to print card ?") }}</label>
679 </div>
680 </div>
681 <div class="field inline">
682 <div class="ui right aligned toggle checkbox">
683 <input type="checkbox" name="pref_bool_display_title" id="pref_bool_display_title" value="1" {% if pref.pref_bool_display_title == 1 %}checked="checked"{% endif %}{% if required.pref_bool_display_title is defined and required.pref_bool_display_title == 1 %} required="required"{% endif %}/>
684 <label for="pref_bool_display_title" class="tooltip">{{ _T("Show title ?") }}</label>
685 </div>
686 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("(Show or not title in front of name)") }}"></i>
687 </div>
688 <div class="field">
689 <label for="pref_card_address">{{ _T("Address type:") }}</label>
690 <select name="pref_card_address" id="pref_card_address" class="ui search dropdown nochosen">
691 <option value="0" {% if pref.pref_card_address == 0 %}selected="selected"{% endif %}>{{ _T("Email") }}</option>
692 <option value="5" {% if pref.pref_card_address == 5 %}selected="selected"{% endif %}>{{ _T("Zip - Town") }}</option>
693 <option value="6" {% if pref.pref_card_address == 6 %}selected="selected"{% endif %}>{{ _T("Nickname") }}</option>
694 <option value="7" {% if pref.pref_card_address == 7 %}selected="selected"{% endif %}>{{ _T("Profession") }}</option>
695 <option value="8" {% if pref.pref_card_address == 8 %}selected="selected"{% endif %}>{{ _T("Member number") }}</option>
696 </select>
697 <span class="exemple">{{ _T("(Choose address printed below name)") }}</span>
698 </div>
699 <div class="field">
700 <label for="pref_card_year">{{ _T("Year:") }}</label>
701 <div class="ui right corner labeled input">
702 <div class="ui corner label">
703 <i class="circular inverted primary link icon info tooltip" title="{{ _T("You can enter either:<br/>- a year,<br/>- two years with a slash as separator,<br/>- the string 'DEADLINE' to use member deadline") }}"></i>
704 </div>
705 <input type="text" name="pref_card_year" id="pref_card_year" value="{{ pref.pref_card_year }}" maxlength="9"{% if required.pref_card_year is defined and required.pref_card_year == 1 %} required="required"{% endif %}/>
706 </div>
707 </div>
708 <div class="field">
709 <label for="pref_card_marges_v">{{ _T("Vertical margins:") }}</label>
710 <div class="ui right labeled input">
711 <input type="number" name="pref_card_marges_v" id="pref_card_marges_v" value="{{ pref.pref_card_marges_v }}" maxlength="4"{% if required.pref_card_marges_v is defined and required.pref_card_marges_v == 1 %} required="required"{% endif %}/>
712 <div class="ui basic label">mm</div>
713 </div>
714 </div>
715 <div class="field">
716 <label for="pref_card_marges_h">{{ _T("Horizontal margins:") }}</label>
717 <div class="ui right labeled input">
718 <input type="number" name="pref_card_marges_h" id="pref_card_marges_h" value="{{ pref.pref_card_marges_h }}" maxlength="4"{% if required.pref_card_marges_h is defined and required.pref_card_marges_h == 1 %} required="required"{% endif %}/>
719 <div class="ui basic label">mm</div>
720 </div>
721 </div>
722 <div class="field">
723 <label for="pref_card_vspace">{{ _T("Vertical spacing:") }}</label>
724 <div class="ui right labeled input">
725 <input type="number" name="pref_card_vspace" id="pref_card_vspace" value="{{ pref.pref_card_vspace }}" maxlength="4"{% if required.pref_card_vspace is defined and required.pref_card_vspace == 1 %} required="required"{% endif %}/>
726 <div class="ui basic label">mm</div>
727 </div>
728 </div>
729 <div class="field">
730 <label for="pref_card_hspace">{{ _T("Horizontal spacing:") }}</label>
731 <div class="ui right labeled input">
732 <input type="number" name="pref_card_hspace" id="pref_card_hspace" value="{{ pref.pref_card_hspace }}" maxlength="4"{% if required.pref_card_hspace is defined and required.pref_card_hspace == 1 %} required="required"{% endif %}/>
733 <div class="ui basic label">mm</div>
734 </div>
735 </div>
736 </div>{# /column #}
737 </div>{# /column grid #}
738 </div>{# /tab segment #}
739
740 {% if login.isAdmin() %}
741 <div class="ui{{ tab == 'security' ? ' active' }} tab segment" data-tab="security">
742 <div class="inline field">
743 <label for="pref_password_length" title="{{ _T("Minimum password length required for all accounts. Minimal size is 6.") }}">{{ _T("Password length:") }}</label>
744 <div class="ui right corner labeled input">
745 <div class="ui corner label">
746 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Minimum password length required for all accounts. Minimal size is 6.") }}"></i>
747 </div>
748 <input type="number" name="pref_password_length" id="pref_password_length" value="{{ pref.pref_password_length }}" min="6" size="7" required="required"/>
749 </div>
750 </div>
751 <div class="inline field">
752 <div class="ui right aligned toggle checkbox">
753 <input type="checkbox" name="pref_password_blacklist" id="pref_password_blacklist" value="1"{% if pref.pref_password_blacklist == 1 %} checked="checked"{% endif %}/>
754 <label for="pref_password_blacklist" title="{{ _T("Enable password blacklists") }}">{{ _T("Enable blacklists:") }}</label>
755 </div>
756 <i class="circular small inverted primary link icon info tooltip" title="{{ _T("If you enable blacklists; it will not be possible to use any of blacklisted passwords. A list is provided along with Galette, but you can add you owns.") }}"></i>
757 </div>
758 <div class="inline field">
759 <label for="pref_password_strength" title="{{ _T("Enforce password strength") }}">{{ _T("Password strength:") }}</label>
760 <div class="ui right corner labeled input">
761 <div class="ui corner label">
762 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Enforce minimal password strength for all password.") }}<br/><br/>
763 {{ _T("Levels are:") }}<br/>
764 <em>* {{ _T("None") }}</em> {{ _T("for no strength enforcement") }}<br/>
765 <em>* {{ _T("Weak") }}</em> {{ _T("require at least one matched rule") }}<br/>
766 <em>* {{ _T("Medium") }}</em> {{ _T("require at least two matched rules") }}<br/>
767 <em>* {{ _T("Strong") }}</em> {{ _T("require at least three matched rules (recommended for most usages)") }}<br/>
768 <em>* {{ _T("Very Strong") }}</em> {{ _T("requires all rules.") }}<br/><br/>
769 {{ _T("Rules include lower case characters, upper case characters, numbers, and special characters.") }}<br/><br/>
770 {{ _T("Note that with any enforcement level, user cannot use his personal information (name, login, ...) as password.") }}"></i>
771 </div>
772 <select name="pref_password_strength" id="pref_password_strength" class="ui fluid dropdown nochosen">
773 <option value=" {{ constant('Galette\\Core\\Preferences::PWD_NONE') }}}"{% if pref.pref_password_strength == constant('Galette\\Core\\Preferences::PWD_NONE') %} selected="selected"{% endif %}>{{ _T("None (default)") }}</option>
774 <option value=" {{ constant('Galette\\Core\\Preferences::PWD_WEAK') }}}"{% if pref.pref_password_strength == constant('Galette\\Core\\Preferences::PWD_WEAK') %} selected="selected"{% endif %}>{{ _T("Weak") }}</option>
775 <option value=" {{ constant('Galette\\Core\\Preferences::PWD_MEDIUM') }}}"{% if pref.pref_password_strength == constant('Galette\\Core\\Preferences::PWD_MEDIUM') %} selected="selected"{% endif %}>{{ _T("Medium") }}</option>
776 <option value=" {{ constant('Galette\\Core\\Preferences::PWD_STRONG') }}}"{% if pref.pref_password_strength == constant('Galette\\Core\\Preferences::PWD_STRONG') %} selected="selected"{% endif %}>{{ _T("Strong") }}</option>
777 <option value=" {{ constant('Galette\\Core\\Preferences::PWD_VERY_STRONG') }}}"{% if pref.pref_password_strength == constant('Galette\\Core\\Preferences::PWD_VERY_STRONG') %} selected="selected"{% endif %}>{{ _T("Very strong") }}</option>
778 </select>
779 </div>
780 </div>
781 <div id="test_password_strength_field" class="inline field">
782 <label for="test_password_strength" title="{{ _T("Test a password with current selected values.") }}">{{ _T("Test a password:") }}</label>
783 <div class="ui right corner labeled input">
784 <div class="ui corner label">
785 <i class="circular inverted primary link icon info tooltip" title="{{ _T("Test a password with current selected values.") }}<br/>{{ _T("Do not forget to save your preferences if you're happy with the result ;)") }}"></i>
786 </div>
787 <input type="text" id="test_password_strength"/>
788 </div>
789
790 </div>
791 </div>{# /tab segment #}
792 {% endif %}
793 {% if login.isSuperAdmin() %}
794 <div class="ui{{ tab == 'admin' ? ' active' }} tab red segment" data-tab="admin">
795 {% if constant('GALETTE_MODE') == constant('\\Galette\\Core\\Galette::MODE_DEMO') %}
796 <div class="ui negative message">
797 {{ _T("Application runs under demo mode. This functionnality is not enabled, sorry.") }}
798 </div>
799 {% else %}
800 <div class="inline field">
801 <label for="pref_admin_login">{{ _T("Username:") }}</label>
802 <input type="text" name="pref_admin_login" id="pref_admin_login" value="{{ pref.pref_admin_login }}" maxlength="20"{% if required.pref_admin_login is defined and required.pref_admin_login == 1 %} required="required"{% endif %}/>
803 </div>
804 <div id="pref_admin_pass_field" class="inline field">
805 <label for="pref_admin_pass">{{ _T("Password:") }}</label>
806 <div class="ui input">
807 <input type="password" name="pref_admin_pass" id="pref_admin_pass" value="" maxlength="20" autocomplete="off"{% if required.pref_admin_pass is defined and required.pref_admin_pass == 1 %} required="required"{% endif %}/>
808 </div>
809 </div>
810 <div class="inline field">
811 <label for="pref_admin_pass_check">{{ _T("Retype password:") }}</label>
812 <input type="password" name="pref_admin_pass_check" id="pref_admin_pass_check" value="" maxlength="20"{% if required.pref_admin_pass_check is defined and required.pref_admin_pass_check == 1 %} required="required"{% endif %}/>
813 </div>
814 {% endif %}
815 </div>{# /tab segment #}
816 {% endif %}
817 <div class="ui basic center aligned segment">
818 <input type="hidden" name="valid" value="1"/>
819 <input type="hidden" name="pref_theme" value="default"/>
820 <input type="hidden" name="pref_telemetry_date" value="{{ pref.pref_telemetry_date }}"/>
821 <input type="hidden" name="pref_instance_uuid" value="{{ pref.pref_instance_uuid }}"/>
822 <input type="hidden" name="pref_registration_date" value="{{ pref.pref_registration_date }}"/>
823 <input type="hidden" name="pref_registration_uuid" value="{{ pref.pref_registration_uuid }}"/>
824 <input type="hidden" name="tab" id="tab" value="{{ tab }}"/>
825 <button type="submit" class="ui labeled icon primary button action">
826 <i class="save icon"></i> {{ _T("Save") }}
827 </button>
828 </div>
829 {% include "components/forms/csrf.html.twig" %}
830 </form>
831
832 {% include "modals/telemetry.html.twig" with {part: "dialog"} %}
833 {% include "modals/replacements_legend.html.twig" with {legends: preferences.getLegend(), cur_ref: 'prefs'} %}
834 {% endblock %}
835
836 {% block javascripts %}
837 <script type="text/javascript">
838 $(function(){
839 {% if pref.pref_mail_method != constant('Galette\\Core\\GaletteMail::METHOD_SMTP') %}
840 $('#smtp_parameters').addClass('hidden');
841 {% endif %}
842 {% if pref.pref_mail_method != constant('Galette\\Core\\GaletteMail::METHOD_SMTP') and pref.pref_mail_method != constant('Galette\\Core\\GaletteMail::METHOD_GMAIL') %}
843 $('#smtp_auth').addClass('hidden');
844 {% endif %}
845 $('.ui.radio.checkbox').checkbox({
846 onChange: function() {
847 var _checked = $(this).closest('input').attr('id');
848 var _smtp_parameters = $(this).closest('.checkbox').parent().parent().siblings('#smtp_parameters');
849 var _smtp_auth = $(this).closest('.checkbox').parent().parent().siblings('#smtp_auth');
850 if ( _checked == 'smtp' ) {
851 _smtp_parameters.removeClass('hidden');
852 _smtp_auth.removeClass('hidden');
853 } else if ( _checked == 'gmail' ) {
854 _smtp_parameters.addClass('hidden');
855 _smtp_auth.removeClass('hidden');
856 } else {
857 _smtp_parameters.addClass('hidden');
858 _smtp_auth.addClass('hidden');
859 }
860 }
861 });
862 /*$('#smtp, #gmail').checkbox({
863 onChecked: function() {
864 console.log($(this).closest('#smtp_parameters'));
865 //$('#smtp_parameters, #smtp_auth').toggleClass('hidden');
866 }
867 });*/
868
869 $('.pointing.menu .item').tab({
870 onVisible: function(tabPath) {
871 document.getElementById('tab').value = tabPath;
872 }
873 });
874
875 $('#pref_bool_publicpages').change(function(){
876 $('#publicpages_visibility').toggleClass('hidden');
877 });
878
879 $('#btnmail').on('click', function(e) {
880 e.preventDefault();
881 var _this = $(this);
882 var _value = $('#pref_email_newadh').val();
883 var _input = '<div class="ui input"><input type="text" name="email_adress" id="email_adress" value="' + _value + '"/></div>';
884 $('body').modal({
885 title: '{{ _T("Enter the email adress")|e('js') }}',
886 class: 'tiny',
887 content: _input,
888 actions: [{
889 text : '{{ _T("Send")|e('js') }}',
890 class : 'green approve',
891 icon : 'rocket',
892 click : function() {
893 $.ajax({
894 url: _this.attr('href'),
895 type: 'GET',
896 data: {
897 adress: $('#email_adress').val()
898 },
899 {% include "elements/js/loader.js.twig" with {
900 selector: '#btnmail',
901 loader: 'button'
902 } %},
903 success: function(res) {
904 //display message
905 $.ajax({
906 url: '{{ path_for('ajaxMessages') }}',
907 method: "GET",
908 success: function (message) {
909 $('#testEmail').prepend(message);
910 }
911 });
912 },
913 error: function () {
914 alert('{{ _T("An error occurred sending test email :(")|e('js') }}');
915 }
916 });
917 }
918 }, {
919 text : '{{ _T("Cancel")|e('js') }}',
920 class : 'cancel'
921 }]
922 }).modal('show');
923 });
924
925 _addLegendButton('#mail_sign');
926 _handleLegend();
927
928 {% include "elements/js/pwdcheck.js.twig" with {
929 selector: "#pref_admin_pass",
930 loader: "inline mini"
931 } %}
932 {% include "elements/js/pwdcheck.js.twig" with {
933 selector: "#test_password_strength",
934 loader: "inline mini",
935 extra_data: "pref_password_length: \$('#pref_password_length').val(),pref_password_blacklist: \$('#pref_password_blacklist').is(':checked'),pref_password_strength: \$('#pref_password_strength').val(),"
936 } %}
937
938 {% include "modals/telemetry.html.twig" with {part: "jsdialog"} %}
939 {% include "modals/telemetry.html.twig" with {part: "jsregister"} %}
940
941 });
942 </script>
943 {% endblock %}