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

Last change on this file since 10738 was 10738, checked in by mistic100, 13 years ago

cancel r10645

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