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