1{include file='include/autosize.inc.tpl'}
2{include file='include/datepicker.inc.tpl'}
3{include file='include/colorbox.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.{$themeconf.colorscheme}.css"}
9
10{combine_script id='jquery.confirm' load='footer' require='jquery' path='themes/default/js/plugins/jquery-confirm.min.js'}
11{combine_css path="themes/default/js/plugins/jquery-confirm.min.css"}
12
13{footer_script}
14(function(){
15{* <!-- CATEGORIES --> *}
16var categoriesCache = new CategoriesCache({
17  serverKey: '{$CACHE_KEYS.categories}',
18  serverId: '{$CACHE_KEYS._hash}',
19  rootUrl: '{$ROOT_URL}'
20});
21
22categoriesCache.selectize(jQuery('[data-selectize=categories]'));
23
24{* <!-- TAGS --> *}
25var tagsCache = new TagsCache({
26  serverKey: '{$CACHE_KEYS.tags}',
27  serverId: '{$CACHE_KEYS._hash}',
28  rootUrl: '{$ROOT_URL}'
29});
30
31tagsCache.selectize(jQuery('[data-selectize=tags]'), { lang: {
32  'Add': '{'Create'|translate}'
33}});
34
35{* <!-- DATEPICKER --> *}
36jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *}
37  jQuery('[data-datepicker]').pwgDatepicker({
38    showTimepicker: true,
39    cancelButton: '{'Cancel'|translate}'
40  });
41});
42
43{* <!-- THUMBNAILS --> *}
44jQuery("a.preview-box").colorbox({
45	photo: true
46});
47
48str_are_you_sure = '{'Are you sure?'|translate}';
49str_yes = '{'Yes, delete'|translate}';
50str_no = '{'No, I have changed my mind'|translate|@escape:'javascript'}';
51url_delete = '{$U_DELETE}';
52
53{literal}
54$('#action-delete-picture').on('click', function() {
55  $.confirm({
56    title: str_are_you_sure,
57    draggable: false,
58    titleClass: "groupDeleteConfirm",
59    theme: "modern",
60    content: "",
61    animation: "zoom",
62    boxWidth: '30%',
63    useBootstrap: false,
64    type: 'red',
65    animateFromElement: false,
66    backgroundDismiss: true,
67    typeAnimated: false,
68    buttons: {
69        confirm: {
70          text: str_yes,
71          btnClass: 'btn-red',
72          action: function () {
73            window.location.href = url_delete.replaceAll('amp;', '');
74          }
75        },
76        cancel: {
77          text: str_no
78        }
79    }
80  });
81})
82{/literal}
83
84}());
85{/footer_script}
86
87<form action="{$F_ACTION}" method="post" id="pictureModify">
88  <div id='picture-preview'>
89    <div class='picture-preview-actions'>
90      {if isset($U_JUMPTO)}
91        <a class="icon-eye" href="{$U_JUMPTO}" title="{'Open in gallery'|@translate}"></a>
92      {else}
93        <a class="icon-eye unavailable" title="{'You don\'t have access to this photo'|translate}"></a>
94      {/if}
95      <a class="icon-download" href="{$U_DOWNLOAD}" title="{'Download'|translate}"></a>
96      {if !url_is_remote($PATH)}
97      <a class="icon-arrows-cw" href="{$U_SYNC}" title="{'Synchronize metadata'|@translate}"></a>
98      <a class="icon-trash" title="{'delete photo'|@translate}" id='action-delete-picture'></a>
99      {/if}
100    </div>
101    <a href="{$FILE_SRC}" class="preview-box icon-zoom-in" title="{$TITLE|htmlspecialchars}" style="{if $FORMAT}width{else}height{/if}:35vw">
102      <img src="{$TN_SRC}" alt="{'Thumbnail'|translate}" style="{if $FORMAT}width{else}height{/if}:100%">
103    </a>
104  </div>
105  <div id='picture-content'>
106    <div id='picture-infos'>
107      <div class='picture-infos-category'>
108        <div class='picture-infos-icon'>
109          <span class='icon-picture'></span>
110        </div>
111        <div class='picture-infos-container'>
112          <div class='picture-infos-title'>{$INTRO.file}</div>
113          <div>{$INTRO.size}</div>
114          <div>{$INTRO.formats}</div>
115          <div>{$INTRO.ext}</div>
116        </div>
117      </div>
118
119      <div class='picture-infos-category'>
120        <div class='picture-infos-icon'>
121          <span class='icon-calendar'></span>
122        </div>
123        <div class='picture-infos-container'>
124          <div class='picture-infos-title'>{$INTRO.date}</div>
125          <div>{$INTRO.age}</div>
126          <div>{$INTRO.added_by}</div>
127          <div>{$INTRO.stats}</div>
128        </div>
129      </div>
130    </div>
131
132
133    <p>
134      <strong>{'Title'|@translate}</strong>
135      <br>
136      <input type="text" class="large" name="name" value="{$NAME|@escape}">
137    </p>
138
139    <p>
140      <strong>{'Author'|@translate}</strong>
141      <br>
142      <input type="text" class="large" name="author" value="{$AUTHOR}">
143    </p>
144
145    <p>
146      <strong>{'Creation date'|@translate}</strong>
147      <br>
148      <input type="hidden" name="date_creation" value="{$DATE_CREATION}">
149      <label class="date-input">
150        <i class="icon-calendar"></i>
151        <input type="text" data-datepicker="date_creation" data-datepicker-unset="date_creation_unset" readonly>
152      </label>
153      <a href="#" class="icon-cancel-circled" id="date_creation_unset">{'unset'|translate}</a>
154    </p>
155
156    <p>
157      <strong>{'Linked albums'|@translate}</strong>
158      <br>
159      <select data-selectize="categories" data-value="{$associated_albums|@json_encode|escape:html}"
160        placeholder="{'Type in a search term'|translate}"
161        data-default="{$STORAGE_ALBUM}" name="associate[]" multiple style="width:calc(100% + 2px);"></select>
162    </p>
163
164    <p>
165      <strong>{'Representation of albums'|@translate}</strong>
166      <br>
167      <select data-selectize="categories" data-value="{$represented_albums|@json_encode|escape:html}"
168        placeholder="{'Type in a search term'|translate}"
169        name="represent[]" multiple style="width:calc(100% + 2px);"></select>
170    </p>
171
172    <p>
173      <strong>{'Tags'|@translate}</strong>
174      <br>
175      <select data-selectize="tags" data-value="{$tag_selection|@json_encode|escape:html}"
176        placeholder="{'Type in a search term'|translate}"
177        data-create="true" name="tags[]" multiple style="width:calc(100% + 2px);"></select>
178    </p>
179
180    <p>
181      <strong>{'Description'|@translate}</strong>
182      <br>
183      <textarea name="description" id="description" class="description">{$DESCRIPTION}</textarea>
184    </p>
185
186    <p>
187      <strong>{'Who can see this photo?'|@translate}</strong>
188      <br>
189      <div class='select-icon icon-down-open'> </div>
190      <select name="level" size="1">
191        {html_options options=$level_options selected=$level_options_selected}
192      </select>
193   </p>
194
195    <p>
196      <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
197      <input class="submit" type="submit" value="{'Save Settings'|@translate}" name="submit">
198    </p>
199  </div>
200
201</form>
202