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

Revision 13667, 5.0 KB checked in by plg, 8 years ago (diff)

feature 2594: remove the Permissions link on the list of albums, because it is a tab on the Edit Album screen

  • 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
62<form id="categoryOrdering" action="{$F_ACTION}" method="post">
63<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
64
65<p class="showCreateAlbum">
66  <span id="notManualOrder">
67    <a href="#" id="addAlbumOpen">{'create a new album'|@translate}</a>
68    | <a href="#" id="autoOrderOpen">{'apply automatic sort order'|@translate}</a>
69  </span>
70  <span id="manualOrder" style="display:none;">
71    <input class="submit" name="submitManualOrder" type="submit" value="{'Save manual order'|@translate}">
72    {'... or '|@translate} <a href="#" id="cancelManualOrder">{'cancel manual order'|@translate}</a>
73  </span>
74</p>
75
76<fieldset id="createAlbum" style="display:none;">
77  <legend>{'create a new album'|@translate}</legend>
78  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
79
80  <p><strong>{'Album name'|@translate}</strong>
81    <br><input type="text" name="virtual_name">
82  </p>
83  <p class="actionButtons">
84    <input class="submit" type="submit" value="{'Create'|@translate}" name="submitAdd">
85    <a href="#" id="addAlbumClose">{'Cancel'|@translate}</a>
86  </p>
87</fieldset>
88
89{if count($categories) }
90
91<fieldset id="autoOrder" style="display:none;">
92  <legend>{'Automatic sort order'|@translate}</legend>
93  <p><strong>{'Sort order'|@translate}</strong>
94    <br><label><input type="radio" value="asc" name="ascdesc" checked="checked">{'ascending'|@translate}</label>
95    <br><label><input type="radio" value="desc" name="ascdesc">{'descending'|@translate}</label>
96  </p>
97
98  <p>
99    <label><input type="checkbox" name="recursive"> <strong>{'Apply to sub-albums'|@translate}</strong></label>
100  </p>
101
102  <p class="actionButtons">
103    <input class="submit" name="submitAutoOrder" type="submit" value="{'Save order'|@translate}">
104    <a href="#" id="autoOrderClose">{'Cancel'|@translate}</a>
105  </p>
106</fieldset>
107
108  <ul class="categoryUl">
109
110    {foreach from=$categories item=category}
111    <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}">
112      <!-- category {$category.ID} -->
113      <p class="albumTitle">
114<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}">
115      <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|@translate}">{$category.NAME}</a></strong>
116      </p>
117
118      <p class="catPos">
119        <label>
120          {'Position'|@translate} :
121          <input type="text" size="4" name="catOrd[{$category.ID}]" maxlength="4" value="{$category.RANK}">
122        </label>
123      </p>
124
125<p class="albumActions">
126        <a href="{$category.U_EDIT}">{'Edit'|@translate}</a>
127        {if isset($category.U_MANAGE_ELEMENTS) }
128        | <a href="{$category.U_MANAGE_ELEMENTS}">{'manage album photos'|@translate}</a>
129        {/if}
130        | <a href="{$category.U_CHILDREN}">{'manage sub-albums'|@translate}</a>
131        {if isset($category.U_SYNC) }
132        | <a href="{$category.U_SYNC}">{'Synchronize'|@translate}</a>
133        {/if}
134        {if isset($category.U_DELETE) }
135        | <a href="{$category.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete album'|@translate}</a>
136{/if}
137{if cat_admin_access($category.ID)}
138|
139<a href="{$category.U_JUMPTO}">{'jump to album'|@translate} →</a>
140{/if}
141</p>
142
143    </li>
144    {/foreach}
145  </ul>
146{/if}
147</form>
Note: See TracBrowser for help on using the repository browser.