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

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

bug:2698
moving the forms

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