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

Last change on this file since 8711 was 8711, checked in by rvelices, 10 years ago

feature 2102 : rename item/image/picture to photo (public side)

  • Property svn:eol-style set to LF
File size: 10.0 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{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">&nbsp;</span><span class="pwg-button-text">{'slideshow'|@translate}</span>
41        </a>
42{/if}
43{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">&nbsp;</span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
46        </a>
47{/if}
48{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">&nbsp;</span><span class="pwg-button-text">{'download'|@translate}</span>
51        </a>
52{/if}
53{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
54{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}">&nbsp;</span><span class="pwg-button-text">{'Favorites'|@translate}</span>
57        </a>
58{/if}
59{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">&nbsp;</span><span class="pwg-button-text">{'representative'|@translate}</span>
62        </a>
63{/if}
64{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">&nbsp;</span><span class="pwg-button-text">{'edit'|@translate}</span>
67        </a>
68{/if}
69{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">&nbsp;</span><span class="pwg-button-text">{'caddie'|@translate}</span>
87        </a>
88{/if}{*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        {if $display_info.author}
124        <tr id="Author">
125                <td class="label">{'Author'|@translate}</td>
126                <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
127        </tr>
128        {/if}
129        {if $display_info.created_on}
130        <tr id="datecreate">
131                <td class="label">{'Created on'|@translate}</td>
132                <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
133        </tr>
134        {/if}
135        {if $display_info.posted_on}
136        <tr id="datepost">
137                <td class="label">{'Posted on'|@translate}</td>
138                <td class="value">{$INFO_POSTED_DATE}</td>
139        </tr>
140        {/if}
141        {if $display_info.dimensions}
142        <tr id="Dimensions">
143                <td class="label">{'Dimensions'|@translate}</td>
144                <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
145        </tr>
146        {/if}
147        {if $display_info.file}
148        <tr id="File">
149                <td class="label">{'File'|@translate}</td>
150                <td class="value">{$INFO_FILE}</td>
151        </tr>
152        {/if}
153        {if $display_info.filesize}
154        <tr id="Filesize">
155                <td class="label">{'Filesize'|@translate}</td>
156                <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
157        </tr>
158        {/if}
159        {if $display_info.tags}
160        <tr id="Tags">
161                <td class="label">{'Tags'|@translate}</td>
162                <td class="value">
163                        {if isset($related_tags)}
164                                {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach}
165                        {/if}
166                </td>
167        </tr>
168        {/if}
169        {if $display_info.categories}
170        <tr id="Categories">
171                <td class="label">{'Albums'|@translate}</td>
172                <td class="value">
173                        {if isset($related_categories)}
174                        <ul>
175                                {foreach from=$related_categories item=cat}
176                                <li>{$cat}</li>
177                                {/foreach}
178                        </ul>
179                        {/if}
180                </td>
181        </tr>
182        {/if}
183        {if $display_info.visits}
184        <tr id="Visits">
185                <td class="label">{'Visits'|@translate}</td>
186                <td class="value">{$INFO_VISITS}</td>
187        </tr>
188        {/if}
189
190{if $display_info.average_rate and isset($rate_summary)}
191        <tr id="Average">
192                <td class="label">{'Average rate'|@translate}</td>
193                <td class="value" id="ratingSummary">
194                {if $rate_summary.count}
195                        {assign var='rate_text' value='%.2f (rated %d times)'|@translate}
196                        {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count)}
197                {else}
198                        {'no rate'|@translate}
199                {/if}
200                </td>
201        </tr>
202{/if}
203
204{if isset($rating)}
205        <tr id="rating">
206                <td class="label">
207                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
208                </td>
209                <td class="value">
210                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
211                        <div>
212                        {foreach from=$rating.marks item=mark name=rate_loop}
213                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
214                                <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
215                        {else}
216                                <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
217                        {/if}
218                        {/foreach}
219                        {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
220                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
221                        {footer_script}
222                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
223                                _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
224                                        updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
225                                        ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary"){rdelim} );
226                        {/footer_script}
227                        </div>
228                        </form>
229                </td>
230        </tr>
231{/if}
232
233{if $display_info.privacy_level and isset($available_permission_levels)}
234        <tr id="Privacy">
235                <td class="label">{'Who can see this photo?'|@translate}</td>
236                <td class="value">
237{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
238{footer_script}
239{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
240{
241selectElement.disabled = true;
242var y = new PwgWS(rootUrl);
243y.callService(
244        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
245        {
246                method: "POST",
247                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
248                onSuccess: function(result) { selectElement.disabled = false; }
249        }
250        );
251}{/literal}
252{/footer_script}
253        <select onchange="setPrivacyLevel(this, '{$ROOT_URL}', {$current.id}, this.options[selectedIndex].value)">
254                {foreach from=$available_permission_levels item=label key=level}
255                <option label="{$label}" value="{$level}"{if $level == $current.level} selected="selected"{/if}>{$label}</option>
256                {/foreach}
257        </select>
258        </td></tr>
259{/if}
260
261</table>
262
263{if isset($metadata)}
264<table id="Metadata" class="infoTable2">
265{foreach from=$metadata item=meta}
266        <tr>
267                <th colspan="2">{$meta.TITLE}</th>
268        </tr>
269        {foreach from=$meta.lines item=value key=label}
270        <tr>
271                <td class="label">{$label}</td>
272                <td class="value">{$value}</td>
273        </tr>
274        {/foreach}
275{/foreach}
276</table>
277{/if}
278
279<hr class="separation">
280
281{if isset($COMMENT_COUNT)}
282<div id="comments">
283        {if $COMMENT_COUNT > 0}
284                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
285        {/if}
286        {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
287
288        {if isset($comments)}
289                {include file='comment_list.tpl'}
290        {/if}
291
292        {if isset($comment_add)}
293        <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
294        <fieldset>
295                <legend>{'Add a comment'|@translate}</legend>
296                {if $comment_add.SHOW_AUTHOR}
297                <label>{'Author'|@translate}<input type="text" name="author"></label>
298                {/if}
299                <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
300                <input type="hidden" name="key" value="{$comment_add.KEY}">
301                <input class="submit" type="submit" value="{'Submit'|@translate}">
302        </fieldset>
303        </form>
304        {/if}
305</div>
306{/if}{*comments*}
307
308{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.