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

Last change on this file since 6025 was 6025, checked in by plg, 14 years ago

bug 1637: make the privacy level the same everywher, use "who can see this photo?"
instead of "minimum privacy level".

  • Property svn:eol-style set to LF
File size: 9.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="{$favorite.FAVORITE_HINT}"><img src="{$favorite.FAVORITE_IMG}" class="button" alt="favorite" title="{$favorite.FAVORITE_HINT}"></a>
54    {/if}
55    {if !empty($U_SET_AS_REPRESENTATIVE) }
56      <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as category 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<script type="text/javascript">
63{literal}function addToCadie(aElement, rootUrl, id)
64{
65if (aElement.disabled) return;
66aElement.disabled=true;
67var y = new PwgWS(rootUrl);
68
69y.callService(
70  "pwg.caddie.add", {image_id: id} ,
71  {
72    onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
73    onSuccess: function(result) { aElement.disabled = false; }
74  }
75  );
76}{/literal}
77</script>
78      <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>
79    {/if}{*caddie management END*}
80  </div>
81  {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
82</div> <!-- imageToolBar -->
83
84<div id="theImage">
85{$ELEMENT_CONTENT}
86
87{if isset($COMMENT_IMG)}
88<p>{$COMMENT_IMG}</p>
89{/if}
90
91{if isset($U_SLIDESHOW_STOP) }
92<p>
93  [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
94</p>
95{/if}
96
97</div>
98
99{if $DISPLAY_NAV_THUMB}
100{if isset($previous) }
101<a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev">
102  <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}">
103</a>
104{/if}
105{if isset($next) }
106<a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" rel="next">
107  <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}">
108</a>
109{/if}
110{/if}
111
112<table id="standard" class="infoTable" summary="{'Some info about this picture'|@translate}">
113  {if $display_info.author}
114  <tr id="Author">
115    <td class="label">{'Author'|@translate}</td>
116    <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
117  </tr>
118  {/if}
119  {if $display_info.created_on}
120  <tr id="datecreate">
121    <td class="label">{'Created on'|@translate}</td>
122    <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
123  </tr>
124  {/if}
125  {if $display_info.posted_on}
126  <tr id="datepost">
127    <td class="label">{'Posted on'|@translate}</td>
128    <td class="value">{$INFO_POSTED_DATE}</td>
129  </tr>
130  {/if}
131  {if $display_info.dimensions}
132  <tr id="Dimensions">
133    <td class="label">{'Dimensions'|@translate}</td>
134    <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
135  </tr>
136  {/if}
137  {if $display_info.file}
138  <tr id="File">
139    <td class="label">{'File'|@translate}</td>
140    <td class="value">{$INFO_FILE}</td>
141  </tr>
142  {/if}
143  {if $display_info.filesize}
144  <tr id="Filesize">
145    <td class="label">{'Filesize'|@translate}</td>
146    <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
147  </tr>
148  {/if}
149  {if $display_info.tags}
150  <tr id="Tags">
151    <td class="label">{'Tags'|@translate}</td>
152    <td class="value">
153      {if isset($related_tags)}
154        {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}
155        <a href="{$tag.URL}">{$tag.name}</a>{/foreach}
156      {/if}
157    </td>
158  </tr>
159  {/if}
160  {if $display_info.categories}
161  <tr id="Categories">
162    <td class="label">{'Categories'|@translate}</td>
163    <td class="value">
164      {if isset($related_categories)}
165      <ul>
166        {foreach from=$related_categories item=cat}
167        <li>{$cat}</li>
168        {/foreach}
169      </ul>
170      {/if}
171    </td>
172  </tr>
173  {/if}
174  {if $display_info.visits}
175  <tr id="Visits">
176    <td class="label">{'Visits'|@translate}</td>
177    <td class="value">{$INFO_VISITS}</td>
178  </tr>
179  {/if}
180
181{if $display_info.average_rate and isset($rate_summary) }
182        <tr id="Average">
183                <td class="label">{'Average rate'|@translate}</td>
184                <td class="value" id="ratingSummary">
185                {if $rate_summary.count}
186                        {assign var='rate_text' value='%.2f (rated %d times)'|@translate }
187                        {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count) }
188                {else}
189                        {'no rate'|@translate}
190                {/if}
191                </td>
192        </tr>
193{/if}
194 
195{if isset($rating)}
196        <tr id="rating">
197                <td class="label">
198                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this picture'|@translate}{/if}</span>
199                </td>
200                <td class="value">
201                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
202                        <div>&nbsp;
203                        {foreach from=$rating.marks item=mark name=rate_loop}
204                        {if !$smarty.foreach.rate_loop.first} | {/if}
205                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
206                          <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
207                        {else}
208                          <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
209                        {/if}
210                        {/foreach}
211                        <script type="text/javascript" src="{$ROOT_URL}themes/default/js/rating.js"></script>
212                        <script type="text/javascript">
213                        makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
214                        updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
215                        ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} );
216                        </script>
217                        </div>
218                        </form>
219                </td>
220        </tr>
221{/if}
222
223{if $display_info.privacy_level and isset($available_permission_levels) }
224        <tr id="Privacy">
225                <td class="label">{'Who can see this photo?'|@translate}</td>
226                <td class="value">
227<script type="text/javascript">
228{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
229{
230selectElement.disabled = true;
231var y = new PwgWS(rootUrl);
232y.callService(
233        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
234        {
235                method: "POST",
236                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
237                onSuccess: function(result) { selectElement.disabled = false; }
238        }
239        );
240}{/literal}
241</script>
242        <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)">
243          {html_options options=$available_permission_levels selected=$current.level}
244        </select>
245        </td></tr>
246{/if}
247
248</table>
249
250{if isset($metadata)}
251<table id="Metadata" class="infoTable2" summary="{'Some more (technical) info about this picture'|@translate}">
252{foreach from=$metadata item=meta}
253  <tr>
254    <th colspan="2">{$meta.TITLE}</th>
255  </tr>
256  {foreach from=$meta.lines item=value key=label}
257  <tr>
258    <td class="label">{$label}</td>
259    <td class="value">{$value}</td>
260  </tr>
261  {/foreach}
262{/foreach}
263</table>
264{/if}
265
266
267<hr class="separation">
268
269{if isset($COMMENT_COUNT)}
270<div id="comments">
271  {if $COMMENT_COUNT > 0}
272                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
273  {/if}
274  {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
275
276        {if isset($comments)}
277                {include file='comment_list.tpl'}
278        {/if}
279
280        {if isset($comment_add)}
281        <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
282        <fieldset>
283                <legend>{'Add a comment'|@translate}</legend>
284                {if $comment_add.SHOW_AUTHOR}
285                <label>{'Author'|@translate}<input type="text" name="author"></label>
286                {/if}
287                <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
288                <input type="hidden" name="key" value="{$comment_add.KEY}">
289                <input class="submit" type="submit" value="{'Submit'|@translate}">
290        </fieldset>
291        </form>
292        {/if}
293</div>
294{/if} {*comments*}
295
296{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.