source: trunk/admin/themes/default/template/configuration.tpl @ 13838

Last change on this file since 13838 was 13838, checked in by mistic100, 8 years ago

prevent deleting all order criterias on main config page

  • Property svn:eol-style set to LF
File size: 16.3 KB
Line 
1{footer_script}{literal}
2jQuery(document).ready(function(){
3  jQuery("#activate_comments").change(function(){
4    if ($(this).is(':checked')) {
5      jQuery("#comments_param_warp").show();
6    } else {
7      jQuery("#comments_param_warp").hide();
8    }
9  });
10
11  var targets = {
12    'input[name="rate"]' : '#rate_anonymous',
13    'input[name="allow_user_registration"]' : '#email_admin_on_new_user',
14    'input[name="comments_validation"]' : '#email_admin_on_comment_validation',
15    'input[name="user_can_edit_comment"]' : '#email_admin_on_comment_edition',
16    'input[name="user_can_delete_comment"]' : '#email_admin_on_comment_deletion',
17  };
18
19  for (selector in targets) {
20    var target = targets[selector];
21
22    jQuery(target).toggle(jQuery(selector).is(':checked'));
23
24    (function(target){
25      jQuery(selector).bind('change', function() {
26        jQuery(target).toggle($(this).is(':checked'));
27      });
28    })(target);
29  };
30});
31{/literal}{/footer_script}
32
33<div class="titrePage">
34  <h2>{'Piwigo configuration'|@translate} {$TABSHEET_TITLE}</h2>
35</div>
36
37{if !isset($default)}
38<form method="post" action="{$F_ACTION}" class="properties">
39{/if}
40<div id="configContent">
41{if isset($main)}
42<fieldset id="mainConf">
43  <legend></legend>
44  <ul>
45    <li>
46     
47        <label for="gallery_title">{'Gallery title'|@translate}</label>
48      <br>
49      <input type="text" maxlength="255" size="50" name="gallery_title" id="gallery_title" value="{$main.CONF_GALLERY_TITLE}">
50    </li>
51
52    <li>
53     
54        <label for="page_banner">{'Page banner'|@translate}</label>
55      <br>
56      <textarea rows="5" cols="50" class="description" name="page_banner" id="page_banner">{$main.CONF_PAGE_BANNER}</textarea>
57    </li>
58
59    <li>
60      <label>
61        <input type="checkbox" name="rate" {if ($main.rate)}checked="checked"{/if}>
62        {'Allow rating'|@translate}
63      </label>
64    </li>
65
66    <li id="rate_anonymous">
67      <label>
68        <input type="checkbox" name="rate_anonymous" {if ($main.rate_anonymous)}checked="checked"{/if}>
69        {'Rating by guests'|@translate}
70      </label>
71    </li>
72
73    <li>
74      <label>
75        <input type="checkbox" name="allow_user_registration" {if ($main.allow_user_registration)}checked="checked"{/if}>
76        {'Allow user registration'|@translate}
77      </label>
78    </li>
79
80    <li id="email_admin_on_new_user">
81      <label>
82        <input type="checkbox" name="email_admin_on_new_user" {if ($main.email_admin_on_new_user)}checked="checked"{/if}>
83        {'Email admins when a new user registers'|@translate}
84      </label>
85    </li>
86
87    <li>
88      <label>
89        <input type="checkbox" name="allow_user_customization" {if ($main.allow_user_customization)}checked="checked"{/if}>
90        {'Allow user customization'|@translate}
91      </label>
92    </li>
93
94    <li>
95      <label>
96        <input type="checkbox" name="obligatory_user_mail_address" {if ($main.obligatory_user_mail_address)}checked="checked"{/if}>
97        {'Mail address is obligatory for all users'|@translate}
98      </label>
99    </li>
100
101    <li>
102      <label>{'Week starts on'|@translate}
103      {html_options name="week_starts_on" options=$main.week_starts_on_options selected=$main.week_starts_on_options_selected}</label>
104    </li>
105   
106    <li>
107        <label>{'Default photos order'|@translate}</label>
108       
109        {foreach from=$main.order_by item=order}
110        <span class="filter {if $ORDER_BY_IS_CUSTOM}transparent{/if}">         
111          <select name="order_by[]" {if $ORDER_BY_IS_CUSTOM}disabled{/if}>
112            {html_options options=$main.order_by_options selected=$order}
113          </select>
114          <a class="removeFilter">{'delete'|@translate}</a>
115        </span>
116        {/foreach}
117       
118        {if !$ORDER_BY_IS_CUSTOM}
119          <a class="addFilter">{'Add a criteria'|@translate}</a>
120        {else}
121          <span class="order_by_is_custom">{'You can\'t define a default photo order because you have a custom setting in your local configuration.'|@translate}</span>
122        {/if}
123    </li>
124   
125{if !$ORDER_BY_IS_CUSTOM}
126{footer_script require='jquery'}
127// counters for displaying of addFilter link
128fields = {$main.order_by|@count}; max_fields = Math.ceil({$main.order_by_options|@count}/2);
129
130{literal}
131function updateAddFilterLink() {
132  if (fields >= max_fields) {
133    $('.addFilter').css('display', 'none');
134  } else {
135    $('.addFilter').css('display', '');
136  }
137}
138
139function updateRemoveFilterTrigger() {
140  $(".removeFilter").click(function () {
141    $(this).parent('span.filter').remove();
142    fields--;
143    updateAddFilterLink();
144  });
145 
146  $(".removeFilter").css('display', '');
147  $(".filter:first .removeFilter").css('display', 'none');
148}
149
150jQuery(document).ready(function () {
151  $('.addFilter').click(function() {
152    $(this).prev('span.filter').clone().insertBefore($(this));
153    $(this).prev('span.filter').children('select[name="order_by[]"]').val('');
154   
155    fields++;
156    updateRemoveFilterTrigger();
157    updateAddFilterLink();
158  });
159 
160  updateRemoveFilterTrigger();
161  updateAddFilterLink();
162});
163{/literal}
164{/footer_script}
165{/if}
166
167    <li>
168      <strong>{'Save visits in history for'|@translate}</strong>
169
170      <label>
171        <input type="checkbox" name="history_guest" {if ($main.history_guest)}checked="checked"{/if}>
172        {'simple visitors'|@translate}
173      </label>
174
175      <label>
176        <input type="checkbox" name="log" {if ($main.log)}checked="checked"{/if}>
177        {'registered users'|@translate}
178      </label>
179
180      <label>
181        <input type="checkbox" name="history_admin" {if ($main.history_admin)}checked="checked"{/if}>
182        {'administrators'|@translate}
183      </label>
184
185    </li>
186  </ul>
187</fieldset>
188{/if}
189
190{if isset($comments)}
191<fieldset id="commentsConf">
192  <legend></legend>
193  <ul>
194    <li>
195      <label>
196        <input type="checkbox" name="activate_comments" id="activate_comments"{if ($comments.activate_comments)}checked="checked"{/if}>
197        {'Activate comments'|@translate}
198      </label>
199    </li>
200  </ul>
201 
202  <ul id="comments_param_warp"{if not ($comments.activate_comments)} style="display:none;"{/if}>
203    <li>
204      <label>
205        <input type="checkbox" name="comments_forall" {if ($comments.comments_forall)}checked="checked"{/if}>
206        {'Comments for all'|@translate}
207      </label>
208    </li>
209
210    <li>
211      <label>
212        {'Number of comments per page'|@translate}
213        <input type="text" size="3" maxlength="4" name="nb_comment_page" id="nb_comment_page" value="{$comments.NB_COMMENTS_PAGE}">
214      </label>
215    </li>
216   
217    <li>
218      <label>
219        {'Default comments order'|@translate}
220        <select name="comments_order">
221          {html_options options=$comments.comments_order_options selected=$comments.comments_order}
222        </select>
223      </label>
224    </li>
225
226    <li>
227      <label>
228        <input type="checkbox" name="comments_validation" {if ($comments.comments_validation)}checked="checked"{/if}>
229        {'Validation'|@translate}
230      </label>
231    </li>
232
233    <li>
234      <label>
235        <input type="checkbox" name="user_can_edit_comment" {if ($comments.user_can_edit_comment)}checked="checked"{/if}>
236        {'Allow users to edit their own comments'|@translate}
237      </label>
238    </li>
239    <li>
240      <label>
241        <input type="checkbox" name="user_can_delete_comment" {if ($comments.user_can_delete_comment)}checked="checked"{/if}>
242        {'Allow users to delete their own comments'|@translate}
243      </label>
244    </li>
245
246    <li id="notifyAdmin">
247      <strong>{'Notify administrators when a comment is'|@translate}</strong>
248
249      <label id="email_admin_on_comment_validation">
250        <input type="checkbox" name="email_admin_on_comment_validation" {if ($comments.email_admin_on_comment_validation)}checked="checked"{/if}> {'pending validation'|@translate}
251      </label>
252
253      <label>
254        <input type="checkbox" name="email_admin_on_comment" {if ($comments.email_admin_on_comment)}checked="checked"{/if}> {'added'|@translate}
255      </label>
256
257      <label id="email_admin_on_comment_edition">
258        <input type="checkbox" name="email_admin_on_comment_edition" {if ($comments.email_admin_on_comment_edition)}checked="checked"{/if}> {'modified'|@translate}
259      </label>
260
261      <label id="email_admin_on_comment_deletion">
262        <input type="checkbox" name="email_admin_on_comment_deletion" {if ($comments.email_admin_on_comment_deletion)}checked="checked"{/if}> {'deleted'|@translate}
263      </label>
264    </li>
265  </ul>
266</fieldset>
267{/if}
268
269{if isset($sizes)}
270
271{footer_script}{literal}
272jQuery(document).ready(function(){
273  function toggleResizeFields(prefix) {
274    var checkbox = jQuery("#"+prefix+"_resize");
275    var needToggle = jQuery("input[name^="+prefix+"_]").not(checkbox).parents('tr');
276
277    if (jQuery(checkbox).is(':checked')) {
278      needToggle.show();
279    }
280    else {
281      needToggle.hide();
282    }
283  }
284
285  toggleResizeFields("original");
286  jQuery("#original_resize").click(function () {toggleResizeFields("original")});
287});
288{/literal}{/footer_script}
289
290<fieldset id="sizesConf">
291  <legend>{'Original Size'|@translate}</legend>
292
293  <table>
294    <tr>
295      <th><label for="original_resize">{'Resize after upload'|@translate}</label></th>
296      <td><input type="checkbox" name="original_resize" id="original_resize" {if ($sizes.original_resize)}checked="checked"{/if}></td>
297    </tr>
298    <tr>
299      <th>{'Maximum Width'|@translate}</th>
300      <td><input type="text" name="original_resize_maxwidth" value="{$sizes.original_resize_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
301    </tr>
302    <tr>
303      <th>{'Maximum Height'|@translate}</th>
304      <td><input type="text" name="original_resize_maxheight" value="{$sizes.original_resize_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
305    </tr>
306    <tr>
307      <th>{'Image Quality'|@translate}</th>
308      <td><input type="text" name="original_resize_quality" value="{$sizes.original_resize_quality}" size="3" maxlength="3"> %</td>
309    </tr>
310  </table>
311
312</fieldset>
313{/if}
314
315{if isset($display)}
316<fieldset id="indexDisplayConf">
317  <legend>{'Main Page'|@translate}</legend>
318  <ul>
319    <li>
320      <label>
321        <input type="checkbox" name="menubar_filter_icon" {if ($display.menubar_filter_icon)}checked="checked"{/if}>
322        {'display only recently posted photos'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
323      </label>
324    </li>   
325   
326    <li>
327      <label>
328        <input type="checkbox" name="index_new_icon" {if ($display.index_new_icon)}checked="checked"{/if}>
329        {'Activate icon "new" next to albums and pictures'|@translate}
330      </label>
331    </li>
332
333    <li>
334      <label>
335        <input type="checkbox" name="index_sort_order_input" {if ($display.index_sort_order_input)}checked="checked"{/if}>
336        {'Sort order'|@translate|@string_format:$pwg->l10n('Activate icon "%s"')}
337      </label>
338    </li>
339
340    <li>
341      <label>
342        <input type="checkbox" name="index_flat_icon" {if ($display.index_flat_icon)}checked="checked"{/if}>
343        {'display all photos in all sub-albums'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
344      </label>
345    </li>
346
347    <li>
348      <label>
349        <input type="checkbox" name="index_posted_date_icon" {if ($display.index_posted_date_icon)}checked="checked"{/if}>
350        {'display a calendar by posted date'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
351      </label>
352    </li>
353
354    <li>
355      <label>
356        <input type="checkbox" name="index_created_date_icon" {if ($display.index_created_date_icon)}checked="checked"{/if}>
357        {'display a calendar by creation date'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
358      </label>
359    </li>
360
361    <li>
362      <label>
363        <input type="checkbox" name="index_slideshow_icon" {if ($display.index_slideshow_icon)}checked="checked"{/if}>
364        {'slideshow'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
365      </label>
366    </li>
367  </ul>
368</fieldset>
369
370<fieldset id="pictureDisplayConf">
371  <legend>{'Photo Page'|@translate}</legend>
372  <ul>
373    <li>
374      <label>
375        <input type="checkbox" name="picture_slideshow_icon" {if ($display.picture_slideshow_icon)}checked="checked"{/if}>
376        {'slideshow'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
377      </label>
378    </li>
379
380    <li>
381      <label>
382        <input type="checkbox" name="picture_metadata_icon" {if ($display.picture_metadata_icon)}checked="checked"{/if}>
383        {'Show file metadata'|@translate|@string_format:$pwg->l10n('Activate icon "%s"')}
384      </label>
385    </li>
386
387    <li>
388      <label>
389        <input type="checkbox" name="picture_download_icon" {if ($display.picture_download_icon)}checked="checked"{/if}>
390        {'Download this file'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
391      </label>
392    </li>
393
394    <li>
395      <label>
396        <input type="checkbox" name="picture_favorite_icon" {if ($display.picture_favorite_icon)}checked="checked"{/if}>
397        {'add this photo to your favorites'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
398      </label>
399    </li>
400
401    <li>
402      <label>
403        <input type="checkbox" name="picture_navigation_icons" {if ($display.picture_navigation_icons)}checked="checked"{/if}>
404        {'Activate Navigation Bar'|@translate}
405      </label>
406    </li>
407
408    <li>
409      <label>
410        <input type="checkbox" name="picture_navigation_thumb" {if ($display.picture_navigation_thumb)}checked="checked"{/if}>
411        {'Activate Navigation Thumbnails'|@translate}
412      </label>
413    </li>
414   
415    <li>
416      <label>
417        <input type="checkbox" name="picture_menu" {if ($display.picture_menu)}checked="checked"{/if}>
418        {'Show menubar'|@translate}
419      </label>
420    </li>
421  </ul>
422</fieldset>
423
424<fieldset id="pictureInfoConf">
425  <legend>{'Photo Properties'|@translate}</legend>
426  <ul>
427    <li>
428      <label>
429        <input type="checkbox" name="picture_informations[author]" {if ($display.picture_informations.author)}checked="checked"{/if}>
430        {'Author'|@translate}
431      </label>
432    </li>
433
434    <li>
435      <label>
436        <input type="checkbox" name="picture_informations[created_on]" {if ($display.picture_informations.created_on)}checked="checked"{/if}>
437        {'Created on'|@translate}
438      </label>
439    </li>
440
441    <li>
442      <label>
443        <input type="checkbox" name="picture_informations[posted_on]" {if ($display.picture_informations.posted_on)}checked="checked"{/if}>
444        {'Posted on'|@translate}
445      </label>
446    </li>
447
448    <li>
449      <label>
450        <input type="checkbox" name="picture_informations[dimensions]" {if ($display.picture_informations.dimensions)}checked="checked"{/if}>
451        {'Dimensions'|@translate}
452      </label>
453    </li>
454
455    <li>
456      <label>
457        <input type="checkbox" name="picture_informations[file]" {if ($display.picture_informations.file)}checked="checked"{/if}>
458        {'File'|@translate}
459      </label>
460    </li>
461
462    <li>
463      <label>
464        <input type="checkbox" name="picture_informations[filesize]" {if ($display.picture_informations.filesize)}checked="checked"{/if}>
465        {'Filesize'|@translate}
466      </label>
467    </li>
468
469    <li>
470      <label>
471        <input type="checkbox" name="picture_informations[tags]" {if ($display.picture_informations.tags)}checked="checked"{/if}>
472        {'Tags'|@translate}
473      </label>
474    </li>
475
476    <li>
477      <label>
478        <input type="checkbox" name="picture_informations[categories]" {if ($display.picture_informations.categories)}checked="checked"{/if}>
479        {'Albums'|@translate}
480      </label>
481    </li>
482
483    <li>
484      <label>
485        <input type="checkbox" name="picture_informations[visits]" {if ($display.picture_informations.visits)}checked="checked"{/if}>
486        {'Visits'|@translate}
487      </label>
488    </li>
489
490    <li>
491      <label>
492        <input type="checkbox" name="picture_informations[rating_score]" {if ($display.picture_informations.rating_score)}checked="checked"{/if}>
493        {'Rating score'|@translate}
494      </label>
495    </li>
496
497    <li>
498      <label>
499        <input type="checkbox" name="picture_informations[privacy_level]" {if ($display.picture_informations.privacy_level)}checked="checked"{/if}>
500        {'Who can see this photo?'|@translate} ({'available for administrators only'|@translate})
501      </label>
502    </li>
503  </ul>
504</fieldset>
505{/if}
506
507{if !isset($default)}
508  <p class="formButtons">
509    <input class="submit" type="submit" name="submit" value="{'Save Settings'|@translate}">
510  </p>
511</form>
512{/if}
513
514</div> <!-- configContent -->
515
516{if isset($default)}
517{$PROFILE_CONTENT}
518{/if}
Note: See TracBrowser for help on using the repository browser.