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

Last change on this file since 13004 was 13004, checked in by plg, 12 years ago

feature 2559: minor redesign on configuration screens

  • hide "rate_anonymous" when "rate" is deactivated
  • hide "email_admin_on_new_user" when "allow_user_registration" is deactivated
  • move history settings on main tab
  • turn the 3 lines for history into a single line with 3 checkboxes
  • for comments, turn the "notify admin" settings into a single line with 4 checkboxes

TODO: remove obsolete language keys

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