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

Last change on this file since 5187 was 5187, checked in by nikrou, 14 years ago

Feature 940 : improve ordering by rank by clip thumbnail to a square

  • Property svn:eol-style set to LF
File size: 1.8 KB
Line 
1{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
2{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
3{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js" }
4
5{literal}
6<script type="text/javascript">
7  $(function() {
8  $('ul.thumbnails')
9  .sortable(
10  { revert: true,
11  opacity: 0.7,
12  handle: $('.rank-of-image').add('.rank-of-image img'),
13  update: function() {
14  $(this).find('li').each(function(i) {
15  $(this).find("input[name^=rank_of_image]")
16  .each(function() { $(this).attr('value', (i+1)*10)});
17  });
18  }
19  });
20  });
21
22</script>
23{/literal}
24
25<h2>{'Manage image ranks'|@translate}</h2>
26
27<h3>{$CATEGORIES_NAV}</h3>
28
29{if !empty($thumbnails)}
30<form action="{$F_ACTION}" method="post">
31  <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></p>
32  <fieldset>
33    <legend>{'Edit ranks'|@translate}</legend>
34    {if !empty($thumbnails)}
35    <ul class="thumbnails">
36      {foreach from=$thumbnails item=thumbnail}
37      <li class="rank-of-image">
38        <div class="clipwrapper">
39          <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">
40            <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt="">
41          </div>
42        </div>
43        <input type="text" name="rank_of_image[{$thumbnail.ID}]" value="{$thumbnail.RANK}">
44      </li>
45      {/foreach}
46    </ul>
47    {/if}
48  </fieldset>
49  <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></p>
50</form>
51
52{else}
53<div class="infos"><p>{'No element in this category'|@translate}</p></div>
54{/if}
Note: See TracBrowser for help on using the repository browser.