source: trunk/admin/themes/default/template/element_set_ranks.tpl @ 9051

Last change on this file since 9051 was 9051, checked in by plg, 13 years ago

bug 2172 fixed: the "sort order" options are removed from the album administration main page.

bug 2173 fixed: rename "manual order" into "automatic order" and "by rank" into "manual order"

bug 2174 fixed: only show the automatic order options when it's relevant

new icon for the "manage photo order" screen

hide the numeric rank below the thumbnail (it is confusing for users)

tell users that you can drag'n drop to reorder photos

bug fixed: the "apply to sub-albums" options for photo orders was not working

  • Property svn:eol-style set to LF
File size: 3.7 KB
Line 
1{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' }
2{combine_script id='jquery.ui.sortable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.sortable.packed.js' }
3{footer_script require='jquery.ui.sortable'}{literal}
4jQuery(document).ready(function() {
5  function checkOrderOptions() {
6    jQuery("#image_order_user_define_options").hide();
7    if (jQuery("input[name=image_order_choice]:checked").val() == "user_define") {
8      jQuery("#image_order_user_define_options").show();
9    }       
10  }
11
12  jQuery('ul.thumbnails').sortable( {
13    revert: true, opacity: 0.7,
14    handle: $('.rank-of-image').add('.rank-of-image img'),
15    update: function() {
16      $(this).find('li').each(function(i) {
17        $(this).find("input[name^=rank_of_image]").each(function() {
18          $(this).attr('value', (i+1)*10)
19        });
20      });
21
22      $('#image_order_rank').attr('checked', true);
23      checkOrderOptions();
24    }
25  });
26
27  jQuery("input[name=image_order_choice]").click(function () {
28    checkOrderOptions();
29  });
30
31  checkOrderOptions();
32});
33{/literal}{/footer_script}
34
35<h2>{'Manage photo ranks'|@translate}</h2>
36
37<h3>{$CATEGORIES_NAV}</h3>
38
39<form action="{$F_ACTION}" method="post">
40{if !empty($thumbnails)}
41  <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit"></p>
42  <fieldset>
43    <legend>{'Manual order'|@translate}</legend>
44    {if !empty($thumbnails)}
45    <p>{'Drag to re-order'|@translate}</p>
46    <ul class="thumbnails">
47      {foreach from=$thumbnails item=thumbnail}
48      <li class="rank-of-image">
49        <div class="clipwrapper">
50          <div class="clip" style="clip:rect({$thumbnail.CLIP_TOP}px {$thumbnail.CLIP_RIGHT}px {$thumbnail.CLIP_BOTTOM}px {$thumbnail.CLIP_LEFT}px);top:-{$thumbnail.CLIP_TOP}px;left:-{$thumbnail.CLIP_LEFT}px">
51            <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt="">
52          </div>
53        </div>
54        <input type="text" name="rank_of_image[{$thumbnail.ID}]" value="{$thumbnail.RANK}" style="display:none">
55      </li>
56      {/foreach}
57    </ul>
58    {/if}
59  </fieldset>
60{/if}
61
62  <fieldset>
63    <legend>{'Sort order'|@translate}</legend>
64    <p class="field">
65      <input type="radio" name="image_order_choice" id="image_order_default" value="default"{if $image_order_choice=='default'} checked="checked"{/if}>
66      <label for="image_order_default">{'Use the default photo sort order (defined in the configuration file)'|@translate}</label>
67    </p>
68    <p class="field">
69      <input type="radio" name="image_order_choice" id="image_order_rank" value="rank"{if $image_order_choice=='rank'} checked="checked"{/if}>
70      <label for="image_order_rank">{'manual order'|@translate}</label>
71    </p>
72    <p class="field">
73      <input type="radio" name="image_order_choice" id="image_order_user_define" value="user_define"{if $image_order_choice=='user_define'} checked="checked"{/if}>
74      <label for="image_order_user_define">{'automatic order'|@translate}</label>
75      <div id="image_order_user_define_options">
76      {foreach from=$image_orders item=order}
77      <p class="field">
78        <select name="order_field_{$order.ID}">
79          {html_options options=$image_order_field_options selected=$order.FIELD }
80        </select>
81        <select name="order_direction_{$order.ID}">
82          {html_options options=$image_order_direction_options selected=$order.DIRECTION }
83        </select>     
84      </p>
85      {/foreach}
86      </div>
87  </fieldset>
88  <p>
89    <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit">
90
91    <label>
92      <input type="checkbox" name="image_order_subcats" id="image_order_subcats">
93      {'Apply to sub-albums'|@translate}
94    </label>
95  </p>
96</form>
Note: See TracBrowser for help on using the repository browser.