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

Last change on this file since 5293 was 5293, checked in by patdenice, 11 years ago

Feature 1533: Change "General" by "Options" in Configuration menu.
Change "Default Display" tab by "Guest Settings" tab.
Add display tab in Configuration/Option menu.

Allow to activate/deactivate a lot of display features:

On main page:
# Display only recently posted images
# Sort order
# Display all elements in all sub-categories
# Display a calendar by posted date
# Display a calendar by creation date
# Slideshow

On photo page:
# Show file metadata
# slideshow
# Add this image to your favorites
# Navigation Bar
# Navigation Thumbnails

  • Property svn:eol-style set to LF
File size: 9.7 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  <tr id="Author">
118    <td class="label">{'Author'|@translate}</td>
119    <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
120  </tr>
121  <tr id="datecreate">
122    <td class="label">{'Created on'|@translate}</td>
123    <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
124  </tr>
125  <tr id="datepost">
126    <td class="label">{'Posted on'|@translate}</td>
127    <td class="value">{$INFO_POSTED_DATE}</td>
128  </tr>
129  <tr id="Dimensions">
130    <td class="label">{'Dimensions'|@translate}</td>
131    <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
132  </tr>
133  <tr id="File">
134    <td class="label">{'File'|@translate}</td>
135    <td class="value">{$INFO_FILE}</td>
136  </tr>
137  <tr id="Filesize">
138    <td class="label">{'Filesize'|@translate}</td>
139    <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
140  </tr>
141  <tr id="Tags">
142    <td class="label">{'Tags'|@translate}</td>
143    <td class="value">
144      {if isset($related_tags)}
145        {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}
146        <a href="{$tag.URL}">{$tag.name}</a>{/foreach}
147      {/if}
148    </td>
149  </tr>
150  <tr id="Categories">
151    <td class="label">{'Categories'|@translate}</td>
152    <td class="value">
153      {if isset($related_categories)}
154      <ul>
155        {foreach from=$related_categories item=cat}
156        <li>{$cat}</li>
157        {/foreach}
158      </ul>
159      {/if}
160    </td>
161  </tr>
162  <tr id="Visits">
163    <td class="label">{'Visits'|@translate}</td>
164    <td class="value">{$INFO_VISITS}</td>
165  </tr>
166
167{if isset($rate_summary) }
168        <tr id="Average">
169                <td class="label">{'Average rate'|@translate}</td>
170                <td class="value" id="ratingSummary">
171                {if $rate_summary.count}
172                        {assign var='rate_text' value='%.2f (rated %d times, standard deviation = %.2f)'|@translate }
173                        {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count, $rate_summary.std) }
174                {else}
175                        {'no rate'|@translate}
176                {/if}
177                </td>
178        </tr>
179{/if}
180 
181{if isset($rating)}
182        <tr id="rating">
183                <td class="label">
184                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this picture'|@translate}{/if}</span>
185                </td>
186                <td class="value">
187                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
188                        <div>&nbsp;
189                        {foreach from=$rating.marks item=mark name=rate_loop}
190                        {if !$smarty.foreach.rate_loop.first} | {/if}
191                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
192                          <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
193                        {else}
194                          <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
195                        {/if}
196                        {/foreach}
197                        <script type="text/javascript" src="{$ROOT_URL}themes/default/js/rating.js"></script>
198                        <script type="text/javascript">
199                        makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
200                        updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
201                        ratingSummaryText: "{'%.2f (rated %d times, standard deviation = %.2f)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} );
202                        </script>
203                        </div>
204                        </form>
205                </td>
206        </tr>
207{/if}
208
209{if isset($available_permission_levels) }
210        <tr id="Privacy">
211                <td class="label">{'Privacy level'|@translate}:</td>
212                <td class="value">
213<script type="text/javascript">
214{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
215{
216selectElement.disabled = true;
217var y = new PwgWS(rootUrl);
218y.callService(
219        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
220        {
221                method: "POST",
222                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
223                onSuccess: function(result) { selectElement.disabled = false; }
224        }
225        );
226}{/literal}
227</script>
228        <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)">
229        {foreach from=$available_permission_levels item=level}
230                <option value="{$level}"{if $current.level==$level} selected="selected"{/if}>{$pwg->l10n($pwg->sprintf('Level %d',$level))}</option>
231        {/foreach}
232        </select>
233        </td></tr>
234{/if}
235
236</table>
237
238{if isset($metadata)}
239<table id="Metadata" class="infoTable2" summary="{'Some more (technical) info about this picture'|@translate}">
240{foreach from=$metadata item=meta}
241  <tr id="{$meta.TITLE}">
242    <th colspan="2">{$meta.TITLE}</th>
243  </tr>
244  {foreach from=$meta.lines item=value key=label}
245  <tr id="{$label}" >
246    <td class="label">{$label}</td>
247    <td class="value">{$value}</td>
248  </tr>
249  {/foreach}
250{/foreach}
251</table>
252{/if}
253
254
255<hr class="separation">
256
257{if isset($COMMENT_COUNT)}
258<div id="comments">
259  {if $COMMENT_COUNT > 0}
260                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
261  {/if}
262  {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
263
264        {if isset($comments)}
265                {include file='comment_list.tpl'}
266        {/if}
267
268        {if isset($comment_add)}
269        <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
270        <fieldset>
271                <legend>{'Add a comment'|@translate}</legend>
272                {if $comment_add.SHOW_AUTHOR}
273                <label>{'Author'|@translate}<input type="text" name="author"></label>
274                {/if}
275                <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
276                <input type="hidden" name="key" value="{$comment_add.KEY}">
277                <input class="submit" type="submit" value="{'Submit'|@translate}">
278        </fieldset>
279        </form>
280        {/if}
281</div>
282{/if} {*comments*}
283
284{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.