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

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