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

Last change on this file since 5304 was 5304, checked in by patdenice, 14 years ago

Feature 1533: Allow activation or deactivation of download icon.
Add display configuration for picture properties.

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