source: trunk/themes/default/template/picture.tpl @ 7975

Last change on this file since 7975 was 7975, checked in by rvelices, 13 years ago

new template features: combine_script, footer_script and get_combined_scripts
migrated public templates only; need more code doc

  • Property svn:eol-style set to LF
File size: 10.6 KB
Line 
1
2{* Example of resizeable *}
3{*
4{include file='include/autosize.inc.tpl'}
5*}
6
7{if isset($errors)}
8<div class="errors">
9  <ul>
10    {foreach from=$errors item=error}
11    <li>{$error}</li>
12    {/foreach}
13  </ul>
14</div>
15{/if}
16
17{if isset($infos)}
18<div class="infos">
19  <ul>
20    {foreach from=$infos item=info}
21    <li>{$info}</li>
22    {/foreach}
23  </ul>
24</div>
25{/if}
26
27{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
28
29<div id="imageHeaderBar">
30  <div class="browsePath">
31    {$SECTION_TITLE}
32    {$LEVEL_SEPARATOR}{$current.TITLE}
33  </div>
34  <div class="imageNumber">{$PHOTO}</div>
35  {if $SHOW_PICTURE_NAME_ON_TITLE }
36  <h2>{$current.TITLE}</h2>
37  {/if}
38</div>
39
40<div id="imageToolBar">
41  <div class="randomButtons">
42    {if isset($U_SLIDESHOW_START) }
43      <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/start_slideshow.png" class="button" alt="{'slideshow'|@translate}"></a>
44    {/if}
45    {if isset($U_METADATA) }
46      <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/metadata.png" class="button" alt="metadata"></a>
47    {/if}
48    {if isset($current.U_DOWNLOAD) }
49      <a href="{$current.U_DOWNLOAD}" title="{'download this file'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/save.png" class="button" alt="{'download'|@translate}"></a>
50    {/if}
51    {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
52    {if isset($favorite) }
53      <a href="{$favorite.U_FAVORITE}" title="{if $favorite.IS_FAVORITE}{'delete this image from your favorites'|@translate}{else}{'add this image to your favorites'|@translate}{/if}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/{if $favorite.IS_FAVORITE}del_favorite{else}favorite{/if}.png" class="button" alt="favorite" title="{if $favorite.IS_FAVORITE}{'delete this image from your favorites'|@translate}{else}{'add this image to your favorites'|@translate}{/if}"></a>
54    {/if}
55    {if !empty($U_SET_AS_REPRESENTATIVE) }
56      <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/representative.png" class="button" alt="{'representative'|@translate}"></a>
57    {/if}
58    {if isset($U_ADMIN) }
59      <a href="{$U_ADMIN}" title="{'Modify information'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/preferences.png" class="button" alt="{'edit'|@translate}"></a>
60    {/if}
61    {if isset($U_CADDIE) }{*caddie management BEGIN*}
62{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
63<script type="text/javascript">
64{literal}function addToCadie(aElement, rootUrl, id)
65{
66if (aElement.disabled) return;
67aElement.disabled=true;
68var y = new PwgWS(rootUrl);
69
70y.callService(
71  "pwg.caddie.add", {image_id: id} ,
72  {
73    onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
74    onSuccess: function(result) { aElement.disabled = false; }
75  }
76  );
77}{/literal}
78</script>
79      <a href="{$U_CADDIE}" onclick="addToCadie(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}); return false;" title="{'add to caddie'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/caddie_add.png" class="button" alt="{'caddie'|@translate}"></a>
80    {/if}{*caddie management END*}
81  </div>
82  {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
83</div> <!-- imageToolBar -->
84
85<div id="theImage">
86{$ELEMENT_CONTENT}
87
88{if isset($COMMENT_IMG)}
89<p>{$COMMENT_IMG}</p>
90{/if}
91
92{if isset($U_SLIDESHOW_STOP) }
93<p>
94  [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
95</p>
96{/if}
97
98</div>
99
100{if $DISPLAY_NAV_THUMB}
101{if isset($previous) }
102<a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev">
103  <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}">
104</a>
105{/if}
106{if isset($next) }
107<a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" rel="next">
108  <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}">
109</a>
110{/if}
111{/if}
112
113<table id="standard" class="infoTable" summary="{'Some info about this picture'|@translate}">
114  {if $display_info.author}
115  <tr id="Author">
116    <td class="label">{'Author'|@translate}</td>
117    <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
118  </tr>
119  {/if}
120  {if $display_info.created_on}
121  <tr id="datecreate">
122    <td class="label">{'Created on'|@translate}</td>
123    <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
124  </tr>
125  {/if}
126  {if $display_info.posted_on}
127  <tr id="datepost">
128    <td class="label">{'Posted on'|@translate}</td>
129    <td class="value">{$INFO_POSTED_DATE}</td>
130  </tr>
131  {/if}
132  {if $display_info.dimensions}
133  <tr id="Dimensions">
134    <td class="label">{'Dimensions'|@translate}</td>
135    <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
136  </tr>
137  {/if}
138  {if $display_info.file}
139  <tr id="File">
140    <td class="label">{'File'|@translate}</td>
141    <td class="value">{$INFO_FILE}</td>
142  </tr>
143  {/if}
144  {if $display_info.filesize}
145  <tr id="Filesize">
146    <td class="label">{'Filesize'|@translate}</td>
147    <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
148  </tr>
149  {/if}
150  {if $display_info.tags}
151  <tr id="Tags">
152    <td class="label">{'Tags'|@translate}</td>
153    <td class="value">
154      {if isset($related_tags)}
155        {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}
156        <a href="{$tag.URL}">{$tag.name}</a>{/foreach}
157      {/if}
158    </td>
159  </tr>
160  {/if}
161  {if $display_info.categories}
162  <tr id="Categories">
163    <td class="label">{'Albums'|@translate}</td>
164    <td class="value">
165      {if isset($related_categories)}
166      <ul>
167        {foreach from=$related_categories item=cat}
168        <li>{$cat}</li>
169        {/foreach}
170      </ul>
171      {/if}
172    </td>
173  </tr>
174  {/if}
175  {if $display_info.visits}
176  <tr id="Visits">
177    <td class="label">{'Visits'|@translate}</td>
178    <td class="value">{$INFO_VISITS}</td>
179  </tr>
180  {/if}
181
182{if $display_info.average_rate and isset($rate_summary) }
183        <tr id="Average">
184                <td class="label">{'Average rate'|@translate}</td>
185                <td class="value" id="ratingSummary">
186                {if $rate_summary.count}
187                        {assign var='rate_text' value='%.2f (rated %d times)'|@translate }
188                        {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count) }
189                {else}
190                        {'no rate'|@translate}
191                {/if}
192                </td>
193        </tr>
194{/if}
195 
196{if isset($rating)}
197        <tr id="rating">
198                <td class="label">
199                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this picture'|@translate}{/if}</span>
200                </td>
201                <td class="value">
202                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
203                        <div>&nbsp;
204                        {foreach from=$rating.marks item=mark name=rate_loop}
205                        {if !$smarty.foreach.rate_loop.first} | {/if}
206                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
207                          <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
208                        {else}
209                          <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
210                        {/if}
211                        {/foreach}
212                        {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
213                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
214                        <script type="text/javascript">
215                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue || [];
216                                _pwgRatingAutoQueue.push(  {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
217                                        updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
218                                        ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} );
219                                /*(function () {ldelim}
220                                var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '{$ROOT_URL}themes/default/js/rating.js';
221                                var s0 = document.getElementsByTagName('script')[0]; s0.parentNode.insertBefore(s, s0);
222                                })();*/
223                        </script>
224                        </div>
225                        </form>
226                </td>
227        </tr>
228{/if}
229
230{if $display_info.privacy_level and isset($available_permission_levels) }
231        <tr id="Privacy">
232                <td class="label">{'Who can see this photo?'|@translate}</td>
233                <td class="value">
234{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
235<script type="text/javascript">
236{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
237{
238selectElement.disabled = true;
239var y = new PwgWS(rootUrl);
240y.callService(
241        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
242        {
243                method: "POST",
244                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
245                onSuccess: function(result) { selectElement.disabled = false; }
246        }
247        );
248}{/literal}
249</script>
250        <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)">
251                {foreach from=$available_permission_levels item=label key=level}
252                <option label="{$label}" value="{$level}"{if $level == $current.level} selected="selected"{/if}>{$label}</option>
253                {/foreach}
254        </select>
255        </td></tr>
256{/if}
257
258</table>
259
260{if isset($metadata)}
261<table id="Metadata" class="infoTable2" summary="{'Some more (technical) info about this picture'|@translate}">
262{foreach from=$metadata item=meta}
263  <tr>
264    <th colspan="2">{$meta.TITLE}</th>
265  </tr>
266  {foreach from=$meta.lines item=value key=label}
267  <tr>
268    <td class="label">{$label}</td>
269    <td class="value">{$value}</td>
270  </tr>
271  {/foreach}
272{/foreach}
273</table>
274{/if}
275
276
277<hr class="separation">
278
279{if isset($COMMENT_COUNT)}
280<div id="comments">
281  {if $COMMENT_COUNT > 0}
282                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
283  {/if}
284  {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
285
286        {if isset($comments)}
287                {include file='comment_list.tpl'}
288        {/if}
289
290        {if isset($comment_add)}
291        <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
292        <fieldset>
293                <legend>{'Add a comment'|@translate}</legend>
294                {if $comment_add.SHOW_AUTHOR}
295                <label>{'Author'|@translate}<input type="text" name="author"></label>
296                {/if}
297                <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
298                <input type="hidden" name="key" value="{$comment_add.KEY}">
299                <input class="submit" type="submit" value="{'Submit'|@translate}">
300        </fieldset>
301        </form>
302        {/if}
303</div>
304{/if} {*comments*}
305
306{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.