source: trunk/admin/themes/default/template/cat_modify.tpl @ 28540

Last change on this file since 28540 was 28540, checked in by mistic100, 10 years ago

feature 3077 : always sort categories by global rank

  • Property svn:eol-style set to LF
File size: 4.8 KB
Line 
1{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
2
3{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
4{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.default.css"}
5
6{footer_script}
7{* <!-- CATEGORIES --> *}
8var categoriesCache = new LocalStorageCache({
9  key: 'categoriesAdminList',
10  serverKey: '{$CACHE_KEYS.categories}',
11  serverId: '{$CACHE_KEYS._hash}',
12
13  loader: function(callback) {
14    jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.categories.getAdminList', function(data) {
15      callback(data.result.categories);
16    });
17  }
18});
19
20jQuery('[data-selectize=categories]').selectize({
21  valueField: 'id',
22  labelField: 'fullname',
23  sortField: 'global_rank',
24  searchField: ['fullname'],
25  plugins: ['remove_button']
26});
27
28categoriesCache.get(function(categories) {
29  categories.push({
30    id: 0,
31    fullname: '------------',
32    global_rank: 0
33  });
34 
35  // remove itself and children
36  categories = jQuery.grep(categories, function(cat) {
37    return !(/\b{$CAT_ID}\b/.test(cat.uppercats));
38  });
39 
40  jQuery('[data-selectize=categories]').each(function() {
41    this.selectize.load(function(callback) {
42      callback(categories);
43    });
44
45    if (jQuery(this).data('value')) {
46      this.selectize.setValue(jQuery(this).data('value')[0]);
47    }
48   
49    // prevent empty value
50    if (this.selectize.getValue() == '') {
51      this.selectize.setValue(0);
52    }
53    this.selectize.on('dropdown_close', function() {
54      if (this.getValue() == '') {
55        this.setValue(0);
56      }
57    });
58  });
59});
60{/footer_script}
61
62
63<div class="titrePage">
64  <h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> &#8250; {'Edit album'|@translate} {$TABSHEET_TITLE}</h2>
65</div>
66
67<form action="{$F_ACTION}" method="POST" id="catModify">
68
69<fieldset>
70  <legend>{'Informations'|@translate}</legend>
71
72  <table style="width:100%">
73    <tr>
74      <td id="albumThumbnail">
75{if isset($representant) }
76  {if isset($representant.picture) }
77        <a href="{$representant.picture.URL}"><img src="{$representant.picture.SRC}" alt=""></a>
78  {else}
79        <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/category_representant_random.png" alt="{'Random photo'|@translate}">
80  {/if}
81
82  {if $representant.ALLOW_SET_RANDOM }
83        <p style="text-align:center;"><input class="submit" type="submit" name="set_random_representant" value="{'Refresh'|@translate}" title="{'Find a new representant by random'|@translate}"></p>
84  {/if}
85
86  {if isset($representant.ALLOW_DELETE) }
87        <p><input class="submit" type="submit" name="delete_representant" value="{'Delete Representant'|@translate}"></p>
88  {/if}
89{/if}
90      </td>
91
92      <td id="albumLinks">
93<p>{$INTRO}</p>
94<ul>
95{if cat_admin_access($CAT_ID)}
96  <li><a class="icon-eye" href="{$U_JUMPTO}">{'jump to album'|@translate} →</a></li>
97{/if}
98
99{if isset($U_MANAGE_ELEMENTS) }
100  <li><a class="icon-picture" href="{$U_MANAGE_ELEMENTS}">{'manage album photos'|@translate}</a></li>
101{/if}
102
103  <li style="text-transform:lowercase;"><a class="icon-plus-circled" href="{$U_ADD_PHOTOS_ALBUM}">{'Add Photos'|translate}</a></li>
104
105  <li><a class="icon-sitemap" href="{$U_CHILDREN}">{'manage sub-albums'|@translate}</a></li>
106
107{if isset($U_SYNC) }
108  <li><a class="icon-exchange" href="{$U_SYNC}">{'Synchronize'|@translate}</a> ({'Directory'|@translate} = {$CAT_FULL_DIR})</li>
109{/if}
110
111{if isset($U_DELETE) }
112  <li><a class="icon-trash" href="{$U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete album'|@translate}</a></li>
113{/if}
114
115</ul>
116      </td>
117    </tr>
118  </table>
119
120</fieldset>
121
122<fieldset>
123  <legend>{'Properties'|@translate}</legend>
124  <p>
125    <strong>{'Name'|@translate}</strong>
126    <br>
127    <input type="text" class="large" name="name" value="{$CAT_NAME}" maxlength="255">
128  </p>
129
130  <p>
131    <strong>{'Description'|@translate}</strong>
132    <br>
133    <textarea cols="50" rows="5" name="comment" id="comment" class="description">{$CAT_COMMENT}</textarea>
134  </p>
135
136{if isset($parent_category) }
137  <p>
138    <strong>{'Parent album'|@translate}</strong>
139    <br>
140    <select data-selectize="categories" data-value="{$parent_category|@json_encode|escape:html}"
141        name="parent" style="width:400px"></select>
142  </p>
143{/if}
144
145  <p>
146    <strong>{'Lock'|@translate}</strong>
147    <br>
148                {html_radios name='visible' values=['true','false'] output=['No'|translate,'Yes'|translate] selected=$CAT_VISIBLE}
149  </p>
150
151  {if isset($CAT_COMMENTABLE)}
152  <p>
153    <strong>{'Comments'|@translate}</strong>
154    <br>
155                {html_radios name='commentable' values=['false','true'] output=['No'|translate,'Yes'|translate] selected=$CAT_COMMENTABLE}
156  </p>
157  {/if}
158
159  <p style="margin:0">
160    <input class="submit" type="submit" value="{'Save Settings'|@translate}" name="submit">
161  </p>
162</fieldset>
163
164</form>
Note: See TracBrowser for help on using the repository browser.