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

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

smarter use of jQuery closure to manage conditional display of options

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