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

Revision 14221, 21.2 KB checked in by plg, 8 years ago (diff)

feature 2606: second step on multiple size configuration screen redesign.

Configuration settings are saved on form submission.

The old screen is still available for tests.

Default resize quality set to 95 instead of 85.

  • Property svn:eol-style set to LF
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}
272var labelMaxWidth = "{'Maximum Width'|@translate}";
273var labelWidth = "{'Width'|@translate}";
274
275var labelMaxHeight = "{'Maximum Height'|@translate}";
276var labelHeight = "{'Height'|@translate}";
277{literal}
278jQuery(document).ready(function(){
279  function toggleResizeFields(size) {
280    var checkbox = jQuery("#original_resize");
281    var needToggle = jQuery("#sizeEdit-original");
282
283    if (jQuery(checkbox).is(':checked')) {
284      needToggle.show();
285    }
286    else {
287      needToggle.hide();
288    }
289  }
290
291  toggleResizeFields("original");
292  jQuery("#original_resize").click(function () {toggleResizeFields("original")});
293
294  jQuery("a[id^='sizeEditOpen-']").click(function(){
295    var sizeName = jQuery(this).attr("id").split("-")[1];
296    jQuery("#sizeEdit-"+sizeName).toggle();
297    jQuery(this).hide();
298  });
299
300  jQuery(".cropToggle").click(function() {
301    var labelBoxWidth = jQuery(this).parents('table.sizeEditForm').find('td.sizeEditWidth');
302    var labelBoxHeight = jQuery(this).parents('table.sizeEditForm').find('td.sizeEditHeight');
303
304    if (jQuery(this).is(':checked')) {
305      jQuery(labelBoxWidth).html(labelWidth);
306      jQuery(labelBoxHeight).html(labelHeight);
307    }
308    else {
309      jQuery(labelBoxWidth).html(labelMaxWidth);
310      jQuery(labelBoxHeight).html(labelMaxHeight);
311    }
312  });
313
314  jQuery("#showDetails").click(function() {
315    jQuery(".sizeDetails").show();
316    jQuery(this).css("visibility", "hidden");
317  });
318
319});
320{/literal}{/footer_script}
321
322{html_head}{literal}
323<style type="text/css">
324input[type="text"].dError {border-color:#ff7070; background-color:#FFe5e5;}
325.dErrorDesc {background-color:red; color:white; padding:0 5px;border-radius:10px; font-weight:bold;cursor:help;}
326.sizeEnable {width:50px;}
327.sizeEditForm {margin:0 0 10px 20px;}
328.sizeEdit {display:none;}
329#sizesConf table {margin:0;}
330.showDetails {padding:0;}
331.sizeDetails {display:none;margin-left:10px;}
332.sizeEditOpen {margin-left:10px;}
333</style>
334{/literal}{/html_head}
335
336<fieldset id="sizesConf">
337  <legend>{'Original Size'|@translate}</legend>
338
339  <div>
340    <label for="original_resize">
341      <input type="checkbox" name="original_resize" id="original_resize" {if ($sizes.original_resize)}checked="checked"{/if}>
342      {'Resize after upload'|@translate}
343    </label>
344  </div>
345
346  <table id="sizeEdit-original">
347    <tr>
348      <th>{'Maximum Width'|@translate}</th>
349      <td>
350        <input type="text" name="original_resize_maxwidth" value="{$sizes.original_resize_maxwidth}" size="4" maxlength="4"{if isset($ferrors.original_resize_maxwidth)} class="dError"{/if}> {'pixels'|@translate}
351        {if isset($ferrors.original_resize_maxwidth)}<span class="dErrorDesc" title="{$ferrors.original_resize_maxwidth}">!</span>{/if}
352      </td>
353    </tr>
354    <tr>
355      <th>{'Maximum Height'|@translate}</th>
356      <td>
357        <input type="text" name="original_resize_maxheight" value="{$sizes.original_resize_maxheight}" size="4" maxlength="4"{if isset($ferrors.original_resize_maxheight)} class="dError"{/if}> {'pixels'|@translate}
358        {if isset($ferrors.original_resize_maxheight)}<span class="dErrorDesc" title="{$ferrors.original_resize_maxheight}">!</span>{/if}
359      </td>
360    </tr>
361    <tr>
362      <th>{'Image Quality'|@translate}</th>
363      <td>
364        <input type="text" name="original_resize_quality" value="{$sizes.original_resize_quality}" size="3" maxlength="3"{if isset($ferrors.original_resize_quality)} class="dError"{/if}> %
365        {if isset($ferrors.original_resize_quality)}<span class="dErrorDesc" title="{$ferrors.original_resize_quality}">!</span>{/if}
366      </td>
367    </tr>
368  </table>
369
370</fieldset>
371
372<fieldset id="multiSizesConf">
373  <legend>{'Multiple Size'|@translate}</legend>
374
375<div class="showDetails">
376  <a href="#" id="showDetails"{if $show_details or isset($ferrors)} style="display:none"{/if}>{'show details'|@translate}</a>
377</div>
378
379<table style="margin:0">
380{foreach from=$derivatives item=d key=type}
381  <tr>
382    <td>
383      <label>
384        <span class="sizeEnable">
385  {if $d.must_enable}
386          &#x2714;
387  {else}
388          <input type="checkbox" name="d[{$type}][enabled]" {if $d.enabled}checked="checked"{/if}>
389  {/if}
390        </span>
391        {$type|@translate}
392      </label>
393    </td>
394
395    <td>
396      <span class="sizeDetails"{if isset($ferrors)} style="display:inline"{/if}>{$d.w} x {$d.h} {'pixels'|@translate}{if $d.crop}, {'Crop'|@translate|lower}{/if}</span>
397    </td>
398
399    <td>
400      <span class="sizeDetails"{if isset($ferrors) and !isset($ferrors.$type)} style="display:inline"{/if}>
401        <a href="#" id="sizeEditOpen-{$type}" class="sizeEditOpen">{'edit'|@translate}</a>
402      </span>
403    </td>
404  </tr>
405
406  <tr id="sizeEdit-{$type}" class="sizeEdit" {if isset($ferrors.$type)} style="display:block"{/if}>
407    <td colspan="3">
408      <table class="sizeEditForm">
409  {if !$d.must_square}
410        <tr>
411          <td colspan="2">
412            <label>
413              <input type="checkbox" class="cropToggle" name="d[{$type}][crop]" {if $d.crop}checked="checked"{/if}>
414              {'Crop'|@translate}
415            </label>
416          </td>
417        </tr>
418  {/if}
419
420        <tr>
421          <td class="sizeEditWidth">{if $d.must_square or $d.crop}{'Width'|@translate}{else}{'Maximum Width'|@translate}{/if}</td>
422          <td>
423            <input type="text" name="d[{$type}][w]" maxlength="4" size="4" value="{$d.w}"{if isset($ferrors.$type.w)} class="dError"{/if}>
424            {'pixels'|@translate}
425            {if isset($ferrors.$type.w)}<span class="dErrorDesc" title="{$ferrors.$type.w}">!</span>{/if}
426          </td>
427        </tr>
428
429  {if !$d.must_square}
430        <tr>
431          <td class="sizeEditHeight">{if $d.crop}{'Height'|@translate}{else}{'Maximum Height'|@translate}{/if}</td>
432          <td>
433            <input type="text" name="d[{$type}][h]" maxlength="4" size="4"  value="{$d.h}"{if isset($ferrors.$type.h)} class="dError"{/if}>
434            {'pixels'|@translate}
435            {if isset($ferrors.$type.h)}<span class="dErrorDesc" title="{$ferrors.$type.h}">!</span>{/if}
436          </td>
437        </tr>
438  {/if}
439      </table> {* #sizeEdit *}
440    </td>
441  </tr>
442{/foreach}
443</table>
444
445<p style="margin:20px 0 0 0;{if isset($ferrors)} display:block;{/if}" class="sizeDetails">
446  {'Image Quality'|@translate}
447  <input type="text" name="resize_quality" value="{$resize_quality}" size="3" maxlength="3"{if isset($ferrors.resize_quality)} class="dError"{/if}> %
448  {if isset($ferrors.resize_quality)}<span class="dErrorDesc" title="{$ferrors.resize_quality}">!</span>{/if}
449</p>
450</fieldset>
451{/if}
452
453{if isset($display)}
454<fieldset id="indexDisplayConf">
455  <legend>{'Main Page'|@translate}</legend>
456  <ul>
457    <li>
458      <label>
459        <input type="checkbox" name="menubar_filter_icon" {if ($display.menubar_filter_icon)}checked="checked"{/if}>
460        {'display only recently posted photos'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
461      </label>
462    </li>   
463   
464    <li>
465      <label>
466        <input type="checkbox" name="index_new_icon" {if ($display.index_new_icon)}checked="checked"{/if}>
467        {'Activate icon "new" next to albums and pictures'|@translate}
468      </label>
469    </li>
470
471    <li>
472      <label>
473        <input type="checkbox" name="index_sort_order_input" {if ($display.index_sort_order_input)}checked="checked"{/if}>
474        {'Sort order'|@translate|@string_format:$pwg->l10n('Activate icon "%s"')}
475      </label>
476    </li>
477
478    <li>
479      <label>
480        <input type="checkbox" name="index_flat_icon" {if ($display.index_flat_icon)}checked="checked"{/if}>
481        {'display all photos in all sub-albums'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
482      </label>
483    </li>
484
485    <li>
486      <label>
487        <input type="checkbox" name="index_posted_date_icon" {if ($display.index_posted_date_icon)}checked="checked"{/if}>
488        {'display a calendar by posted date'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
489      </label>
490    </li>
491
492    <li>
493      <label>
494        <input type="checkbox" name="index_created_date_icon" {if ($display.index_created_date_icon)}checked="checked"{/if}>
495        {'display a calendar by creation date'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
496      </label>
497    </li>
498
499    <li>
500      <label>
501        <input type="checkbox" name="index_slideshow_icon" {if ($display.index_slideshow_icon)}checked="checked"{/if}>
502        {'slideshow'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
503      </label>
504    </li>
505  </ul>
506</fieldset>
507
508<fieldset id="pictureDisplayConf">
509  <legend>{'Photo Page'|@translate}</legend>
510  <ul>
511    <li>
512      <label>
513        <input type="checkbox" name="picture_slideshow_icon" {if ($display.picture_slideshow_icon)}checked="checked"{/if}>
514        {'slideshow'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
515      </label>
516    </li>
517
518    <li>
519      <label>
520        <input type="checkbox" name="picture_metadata_icon" {if ($display.picture_metadata_icon)}checked="checked"{/if}>
521        {'Show file metadata'|@translate|@string_format:$pwg->l10n('Activate icon "%s"')}
522      </label>
523    </li>
524
525    <li>
526      <label>
527        <input type="checkbox" name="picture_download_icon" {if ($display.picture_download_icon)}checked="checked"{/if}>
528        {'Download this file'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
529      </label>
530    </li>
531
532    <li>
533      <label>
534        <input type="checkbox" name="picture_favorite_icon" {if ($display.picture_favorite_icon)}checked="checked"{/if}>
535        {'add this photo to your favorites'|@translate|@ucfirst|@string_format:$pwg->l10n('Activate icon "%s"')}
536      </label>
537    </li>
538
539    <li>
540      <label>
541        <input type="checkbox" name="picture_navigation_icons" {if ($display.picture_navigation_icons)}checked="checked"{/if}>
542        {'Activate Navigation Bar'|@translate}
543      </label>
544    </li>
545
546    <li>
547      <label>
548        <input type="checkbox" name="picture_navigation_thumb" {if ($display.picture_navigation_thumb)}checked="checked"{/if}>
549        {'Activate Navigation Thumbnails'|@translate}
550      </label>
551    </li>
552   
553    <li>
554      <label>
555        <input type="checkbox" name="picture_menu" {if ($display.picture_menu)}checked="checked"{/if}>
556        {'Show menubar'|@translate}
557      </label>
558    </li>
559  </ul>
560</fieldset>
561
562<fieldset id="pictureInfoConf">
563  <legend>{'Photo Properties'|@translate}</legend>
564  <ul>
565    <li>
566      <label>
567        <input type="checkbox" name="picture_informations[author]" {if ($display.picture_informations.author)}checked="checked"{/if}>
568        {'Author'|@translate}
569      </label>
570    </li>
571
572    <li>
573      <label>
574        <input type="checkbox" name="picture_informations[created_on]" {if ($display.picture_informations.created_on)}checked="checked"{/if}>
575        {'Created on'|@translate}
576      </label>
577    </li>
578
579    <li>
580      <label>
581        <input type="checkbox" name="picture_informations[posted_on]" {if ($display.picture_informations.posted_on)}checked="checked"{/if}>
582        {'Posted on'|@translate}
583      </label>
584    </li>
585
586    <li>
587      <label>
588        <input type="checkbox" name="picture_informations[dimensions]" {if ($display.picture_informations.dimensions)}checked="checked"{/if}>
589        {'Dimensions'|@translate}
590      </label>
591    </li>
592
593    <li>
594      <label>
595        <input type="checkbox" name="picture_informations[file]" {if ($display.picture_informations.file)}checked="checked"{/if}>
596        {'File'|@translate}
597      </label>
598    </li>
599
600    <li>
601      <label>
602        <input type="checkbox" name="picture_informations[filesize]" {if ($display.picture_informations.filesize)}checked="checked"{/if}>
603        {'Filesize'|@translate}
604      </label>
605    </li>
606
607    <li>
608      <label>
609        <input type="checkbox" name="picture_informations[tags]" {if ($display.picture_informations.tags)}checked="checked"{/if}>
610        {'Tags'|@translate}
611      </label>
612    </li>
613
614    <li>
615      <label>
616        <input type="checkbox" name="picture_informations[categories]" {if ($display.picture_informations.categories)}checked="checked"{/if}>
617        {'Albums'|@translate}
618      </label>
619    </li>
620
621    <li>
622      <label>
623        <input type="checkbox" name="picture_informations[visits]" {if ($display.picture_informations.visits)}checked="checked"{/if}>
624        {'Visits'|@translate}
625      </label>
626    </li>
627
628    <li>
629      <label>
630        <input type="checkbox" name="picture_informations[rating_score]" {if ($display.picture_informations.rating_score)}checked="checked"{/if}>
631        {'Rating score'|@translate}
632      </label>
633    </li>
634
635    <li>
636      <label>
637        <input type="checkbox" name="picture_informations[privacy_level]" {if ($display.picture_informations.privacy_level)}checked="checked"{/if}>
638        {'Who can see this photo?'|@translate} ({'available for administrators only'|@translate})
639      </label>
640    </li>
641  </ul>
642</fieldset>
643{/if}
644
645{if !isset($default)}
646  <p class="formButtons">
647    <input class="submit" type="submit" name="submit" value="{'Save Settings'|@translate}">
648  </p>
649</form>
650{/if}
651
652</div> <!-- configContent -->
653
654{if isset($default)}
655{$PROFILE_CONTENT}
656{/if}
Note: See TracBrowser for help on using the repository browser.