source: trunk/admin/themes/default/template/picture_modify.tpl @ 28533

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

feature 3077 : use selectize on batch_manager_global, cat_modify and photos_add_direct
+ rewrite "add album" popup (more flexible and working with selectize)

  • Property svn:eol-style set to LF
File size: 5.7 KB
Line 
1{include file='include/autosize.inc.tpl'}
2{include file='include/dbselect.inc.tpl'}
3{include file='include/datepicker.inc.tpl'}
4
5{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
6
7{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
8{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.default.css"}
9
10{footer_script}
11(function(){
12{* <!-- CATEGORIES --> *}
13var categoriesCache = new LocalStorageCache({
14  key: 'categoriesAdminList',
15  serverKey: '{$CACHE_KEYS.categories}',
16  serverId: '{$CACHE_KEYS._hash}',
17
18  loader: function(callback) {
19    jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.categories.getAdminList', function(data) {
20      callback(data.result.categories);
21    });
22  }
23});
24
25jQuery('[data-selectize=categories]').selectize({
26  valueField: 'id',
27  labelField: 'fullname',
28  sortField: 'fullname',
29  searchField: ['fullname'],
30  plugins: ['remove_button']
31});
32
33categoriesCache.get(function(categories) {
34  jQuery('[data-selectize=categories]').each(function() {
35    this.selectize.load(function(callback) {
36      callback(categories);
37    });
38
39    jQuery.each(jQuery(this).data('value'), jQuery.proxy(function(i, id) {
40      this.selectize.addItem(id);
41    }, this));
42  });
43});
44
45{* <!-- TAGS --> *}
46var tagsCache = new LocalStorageCache({
47  key: 'tagsAdminList',
48  serverKey: '{$CACHE_KEYS.tags}',
49  serverId: '{$CACHE_KEYS._hash}',
50
51  loader: function(callback) {
52    jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) {
53      var tags = data.result.tags;
54     
55      for (var i=0, l=tags.length; i<l; i++) {
56        tags[i].id = '~~' + tags[i].id + '~~';
57      }
58     
59      callback(tags);
60    });
61  }
62});
63
64jQuery('[data-selectize=tags]').selectize({
65  valueField: 'id',
66  labelField: 'name',
67  searchField: ['name'],
68  plugins: ['remove_button'],
69  create: true
70});
71
72tagsCache.get(function(tags) {
73  jQuery('[data-selectize=tags]').each(function() {
74    this.selectize.load(function(callback) {
75      callback(tags);
76    });
77
78    jQuery.each(jQuery(this).data('value'), jQuery.proxy(function(i, tag) {
79      this.selectize.addItem(tag.id);
80    }, this));
81  });
82});
83
84{* <!-- DATEPICKER --> *}
85jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *}
86  jQuery('[data-datepicker]').pwgDatepicker({ showTimepicker: true });
87});
88}());
89{/footer_script}
90
91<h2>{$TITLE} &#8250; {'Edit photo'|@translate} {$TABSHEET_TITLE}</h2>
92
93<form action="{$F_ACTION}" method="post" id="catModify">
94
95  <fieldset>
96    <legend>{'Informations'|@translate}</legend>
97
98    <table>
99
100      <tr>
101        <td id="albumThumbnail">
102          <img src="{$TN_SRC}" alt="{'Thumbnail'|@translate}" class="Thumbnail">
103        </td>
104        <td id="albumLinks" style="width:400px;vertical-align:top;">
105          <ul style="padding-left:15px;margin:0;">
106            <li>{$INTRO.file}</li>
107            <li>{$INTRO.add_date}</li>
108            <li>{$INTRO.added_by}</li>
109            <li>{$INTRO.size}</li>
110            <li>{$INTRO.stats}</li>
111            <li>{$INTRO.id}</li>
112          </ul>
113        </td>
114        <td class="photoLinks">
115          <ul>
116          {if isset($U_JUMPTO) }
117            <li><a class="icon-eye" href="{$U_JUMPTO}">{'jump to photo'|@translate} →</a></li>
118          {/if}
119          {if !url_is_remote($PATH)}
120            <li><a class="icon-arrows-cw" href="{$U_SYNC}">{'Synchronize metadata'|@translate}</a></li>
121
122            <li><a class="icon-trash" href="{$U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete photo'|@translate}</a></li>
123          {/if}
124          </ul>
125        </td>
126      </tr>
127    </table>
128
129  </fieldset>
130
131  <fieldset>
132    <legend>{'Properties'|@translate}</legend>
133
134    <p>
135      <strong>{'Title'|@translate}</strong>
136      <br>
137      <input type="text" class="large" name="name" value="{$NAME|@escape}">
138    </p>
139
140    <p>
141      <strong>{'Author'|@translate}</strong>
142      <br>
143      <input type="text" class="large" name="author" value="{$AUTHOR}">
144    </p>
145
146    <p>
147      <strong>{'Creation date'|@translate}</strong>
148      <br>
149      <input type="hidden" name="date_creation" value="{$DATE_CREATION}">
150      <label>
151        <i class="icon-calendar"></i>
152        <input type="text" data-datepicker="date_creation" data-datepicker-unset="date_creation_unset" readonly>
153      </label>
154      <a href="#" class="icon-cancel-circled" id="date_creation_unset">{'unset'|translate}</a>
155    </p>
156
157    <p>
158      <strong>{'Linked albums'|@translate}</strong>
159      <br>
160      <select data-selectize="categories" data-value="{$associate_options_selected|@json_encode|escape:html}"
161        name="associate[]" multiple style="width:600px;" ></select>
162    </p>
163
164    <p>
165      <strong>{'Representation of albums'|@translate}</strong>
166      <br>
167      <select data-selectize="categories" data-value="{$represent_options_selected|@json_encode|escape:html}"
168        name="represent[]" multiple style="width:600px;" ></select>
169    </p>
170
171    <p>
172      <strong>{'Tags'|@translate}</strong>
173      <br>
174      <select data-selectize="tags" data-value="{$tag_selection|@json_encode|escape:html}"
175        name="tags[]" multiple style="width:600px;" ></select>
176    </p>
177
178    <p>
179      <strong>{'Description'|@translate}</strong>
180      <br>
181      <textarea name="description" id="description" class="description">{$DESCRIPTION}</textarea>
182    </p>
183
184    <p>
185      <strong>{'Who can see this photo?'|@translate}</strong>
186      <br>
187      <select name="level" size="1">
188        {html_options options=$level_options selected=$level_options_selected}
189      </select>
190   </p>
191
192  <p style="margin:40px 0 0 0">
193    <input class="submit" type="submit" value="{'Save Settings'|@translate}" name="submit">
194  </p>
195</fieldset>
196
197</form>
Note: See TracBrowser for help on using the repository browser.