source: trunk/admin/themes/default/template/cat_list.tpl @ 16829

Revision 16829, 5.2 KB checked in by flop25, 7 years ago (diff)

bug:2698
at the bottom!

  • Property svn:eol-style set to LF
Line 
1{footer_script require='jquery.ui.sortable'}{literal}
2jQuery(document).ready(function(){
3  jQuery(".catPos").hide();
4  jQuery(".drag_button").show();
5  jQuery(".categoryLi").css("cursor","move");
6  jQuery(".categoryUl").sortable({
7    axis: "y",
8    opacity: 0.8,
9    update : function() {
10      jQuery("#manualOrder").show();
11      jQuery("#notManualOrder").hide();
12      jQuery("#autoOrder").hide();
13      jQuery("#createAlbum").hide();
14    },
15  });
16
17  jQuery("#categoryOrdering").submit(function(){
18    ar = jQuery('.categoryUl').sortable('toArray');
19    for(i=0;i<ar.length;i++) {
20      cat = ar[i].split('cat_');
21      document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i;
22    }
23  });
24
25  jQuery("input[name=order_type]").click(function () {
26    jQuery("#automatic_order_params").hide();
27    if (jQuery("input[name=order_type]:checked").val() == "automatic") {
28      jQuery("#automatic_order_params").show();
29    }
30  });
31
32  jQuery("#addAlbumOpen").click(function(){
33    jQuery("#createAlbum").toggle();
34    jQuery("input[name=virtual_name]").focus();
35    jQuery("#autoOrder").hide();
36  });
37
38  jQuery("#addAlbumClose").click(function(){
39    jQuery("#createAlbum").hide();
40  });
41
42
43  jQuery("#autoOrderOpen").click(function(){
44    jQuery("#autoOrder").toggle();
45    jQuery("#createAlbum").hide();
46  });
47
48  jQuery("#autoOrderClose").click(function(){
49    jQuery("#autoOrder").hide();
50  });
51
52  jQuery("#cancelManualOrder").click(function(){
53    jQuery(".categoryUl").sortable("cancel");
54    jQuery("#manualOrder").hide();
55    jQuery("#notManualOrder").show();
56  });
57});
58{/literal}{/footer_script}
59
60<h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> &#8250; {'Album list management'|@translate}</h2>
61<p class="showCreateAlbum">
62  <span id="notManualOrder">
63    <a href="#" id="addAlbumOpen">{'create a new album'|@translate}</a>
64    {if count($categories) }| <a href="#" id="autoOrderOpen">{'apply automatic sort order'|@translate}</a>{/if}
65  </span>
66</p>
67<form id="formCreateAlbum" action="{$F_ACTION}" method="post">
68  <p>
69  <fieldset id="createAlbum" style="display:none;">
70      <legend>{'create a new album'|@translate}</legend>
71      <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
72      <p><strong>{'Album name'|@translate}</strong>
73        <br><input type="text" name="virtual_name">
74      </p>
75      <span class="actionButtons">
76        <input class="submit" type="submit" value="{'Create'|@translate}" name="submitAdd">
77        <a href="#" id="addAlbumClose">{'Cancel'|@translate}</a>
78      </span>
79  </fieldset>
80  </p>
81</form>
82<form id="categoryOrdering" action="{$F_ACTION}" method="post">
83<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
84{if count($categories) }
85  <fieldset id="autoOrder" style="display:none;">
86    <legend>{'Automatic sort order'|@translate}</legend>
87    <p><strong>{'Sort order'|@translate}</strong>
88      <br><label><input type="radio" value="asc" name="ascdesc" checked="checked">{'ascending'|@translate}</label>
89      <br><label><input type="radio" value="desc" name="ascdesc">{'descending'|@translate}</label>
90    </p>
91 
92    <p>
93      <label><input type="checkbox" name="recursive"> <strong>{'Apply to sub-albums'|@translate}</strong></label>
94    </p>
95 
96    <p class="actionButtons">
97      <input class="submit" name="submitAutoOrder" type="submit" value="{'Save order'|@translate}">
98      <a href="#" id="autoOrderClose">{'Cancel'|@translate}</a>
99    </p>
100  </fieldset>
101{/if}
102<p>
103  <span id="manualOrder" style="display:none;">
104    <input class="submit" name="submitManualOrder" type="submit" value="{'Save manual order'|@translate}">
105    {'... or '|@translate} <a href="#" id="cancelManualOrder">{'cancel manual order'|@translate}</a>
106  </span>
107</p>
108{if count($categories) }
109 
110  <ul class="categoryUl">
111
112    {foreach from=$categories item=category}
113    <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}">
114      <!-- category {$category.ID} -->
115      <p class="albumTitle">
116<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}">
117      <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|@translate}">{$category.NAME}</a></strong>
118      </p>
119
120      <p class="catPos">
121        <label>
122          {'Position'|@translate} :
123          <input type="text" size="4" name="catOrd[{$category.ID}]" maxlength="4" value="{$category.RANK}">
124        </label>
125      </p>
126
127      <p class="albumActions">
128        <a href="{$category.U_EDIT}">{'Edit'|@translate}</a>
129        {if isset($category.U_MANAGE_ELEMENTS) }
130        | <a href="{$category.U_MANAGE_ELEMENTS}">{'manage album photos'|@translate}</a>
131        {/if}
132        | <a href="{$category.U_CHILDREN}">{'manage sub-albums'|@translate}</a>
133        {if isset($category.U_SYNC) }
134        | <a href="{$category.U_SYNC}">{'Synchronize'|@translate}</a>
135        {/if}
136        {if isset($category.U_DELETE) }
137        | <a href="{$category.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete album'|@translate}</a>
138      {/if}
139      {if cat_admin_access($category.ID)}
140      |
141      <a href="{$category.U_JUMPTO}">{'jump to album'|@translate} →</a>
142      {/if}
143      </p>
144
145    </li>
146    {/foreach}
147  </ul>
148{/if}
149</form>
Note: See TracBrowser for help on using the repository browser.