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

Revision 13087, 3.7 KB checked in by mistic100, 8 years ago (diff)

feature 2568: redesigned order_by fields in Admin->Config->Options

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