source: trunk/template/yoga/picture.tpl @ 2413

Last change on this file since 2413 was 2413, checked in by rvelices, 16 years ago
  • first use of web services as Ajax: change the privacy level directly from the picture page
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 8.7 KB
Line 
1{* $Id: picture.tpl 2413 2008-07-02 01:11:26Z rvelices $ *}
2{if isset($errors)}
3<div class="errors">
4  <ul>
5    {foreach from=$errors item=error}
6    <li>{$error}</li>
7    {/foreach}
8  </ul>
9</div>
10{/if}
11
12{if isset($infos)}
13<div class="infos">
14  <ul>
15    {foreach from=$infos item=info}
16    <li>{$info}</li>
17    {/foreach}
18  </ul>
19</div>
20{/if}
21
22<div id="imageHeaderBar">
23  <div class="browsePath">
24    <a href="{$U_HOME}" rel="home">{'home'|@translate}</a>
25    {$LEVEL_SEPARATOR}{$SECTION_TITLE}
26    {$LEVEL_SEPARATOR}{$current.TITLE}
27  </div>
28  <div class="imageNumber">{$PHOTO}</div>
29  {if $SHOW_PICTURE_NAME_ON_TITLE }
30  <h2>{$current.TITLE}</h2>
31  {/if}
32</div>
33
34{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
35<div id="imageToolBar">
36  <div class="randomButtons">
37    {if isset($U_SLIDESHOW_START) }
38      <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>
39    {/if}
40    {if isset($U_SLIDESHOW_STOP) }
41      <a href="{$U_SLIDESHOW_STOP}" title="{'slideshow_stop'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_slideshow.png" class="button" alt="{'slideshow_stop'|@translate}"></a>
42    {/if}
43      <a href="{$U_METADATA}" title="{'picture_show_metadata'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/metadata.png" class="button" alt="metadata" /></a>
44    {if isset($current.U_DOWNLOAD) }
45      <a href="{$current.U_DOWNLOAD}" title="{'download_hint'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/save.png" class="button" alt="{'download'|@translate}"></a>
46    {/if}
47    {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
48    {if isset($favorite) }
49      <a href="{$favorite.U_FAVORITE}" title="{$favorite.FAVORITE_HINT}"><img src="{$favorite.FAVORITE_IMG}" class="button" alt="favorite" title="{$favorite.FAVORITE_HINT}"></a>
50    {/if}
51    {if !empty($U_SET_AS_REPRESENTATIVE) }
52      <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>
53    {/if}
54    {if isset($U_ADMIN) }
55      <a href="{$U_ADMIN}" title="{'link_info_image'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/preferences.png" class="button" alt="{'edit'|@translate}"></a>
56    {/if}
57    {if isset($U_CADDIE) }
58      <a href="{$U_CADDIE}" title="{'add to caddie'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/caddie_add.png" class="button" alt="{'caddie'|@translate}"></a>
59    {/if}
60  </div>
61  {include file=$FILE_PICTURE_NAV_BUTTONS}
62</div> <!-- imageToolBar -->
63
64<div id="theImage">
65{$ELEMENT_CONTENT}
66
67{if isset($COMMENT_IMG)}
68<p>{$COMMENT_IMG}</p>
69{/if}
70
71{if isset($U_SLIDESHOW_STOP) }
72<p>
73  [ <a href="{$U_SLIDESHOW_STOP}">{'slideshow_stop'|@translate}</a> ]
74</p>
75{/if}
76
77</div>
78
79{if isset($previous) }
80<a class="navThumb" id="thumbPrev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev">
81  <img src="{$previous.THUMB_SRC}" class="thumbLink" id="linkPrev" alt="{$previous.TITLE}">
82</a>
83{/if}
84{if isset($next) }
85<a class="navThumb" id="thumbNext" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next">
86  <img src="{$next.THUMB_SRC}" class="thumbLink" id="linkNext" alt="{$next.TITLE}">
87</a>
88{/if}
89
90<table class="infoTable" summary="Some info about this picture">
91  <tr>
92    <td class="label">{'Author'|@translate}</td>
93    <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
94  </tr>
95  <tr>
96    <td class="label">{'Created on'|@translate}</td>
97    <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
98  </tr>
99  <tr>
100    <td class="label">{'Posted on'|@translate}</td>
101    <td class="value">{$INFO_POSTED_DATE}</td>
102  </tr>
103  <tr>
104    <td class="label">{'Dimensions'|@translate}</td>
105    <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
106  </tr>
107  <tr>
108    <td class="label">{'File'|@translate}</td>
109    <td class="value">{$INFO_FILE}</td>
110  </tr>
111  <tr>
112    <td class="label">{'Filesize'|@translate}</td>
113    <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
114  </tr>
115  <tr>
116    <td class="label">{'Tags'|@translate}</td>
117    <td class="value">
118      {if isset($related_tags)}
119        {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}
120        <a href="{$tag.URL}">{$tag.name}</a>{/foreach}
121      {/if}
122    </td>
123  </tr>
124  <tr>
125    <td class="label">{'Categories'|@translate}</td>
126    <td class="value">
127      {if isset($related_categories)}
128      <ul>
129        {foreach from=$related_categories item=cat}
130        <li>{$cat}</li>
131        {/foreach}
132      </ul>
133      {/if}
134    </td>
135  </tr>
136  <tr>
137    <td class="label">{'Visits'|@translate}</td>
138    <td class="value">{$INFO_VISITS}</td>
139  </tr>
140  {if isset($available_permission_levels) }
141  <tr>
142    <td class="label">{'Privacy level'|@translate}:</td>
143    <td class="value">
144<script type="text/javascript">
145{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
146{
147selectElement.disabled = true;
148var y = new PwgWS(rootUrl);
149
150y.callService(
151  "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
152  {
153    onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
154    onSuccess: function(result) { selectElement.disabled = false; }
155  }
156  );
157}{/literal}
158</script>
159    <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)">
160    {foreach from=$available_permission_levels item=level}
161        <option value="{$level}"{if $current.level==$level} selected="selected"{/if}>{$pwg->l10n($pwg->sprintf('Level %d',$level))}</option>
162    {/foreach}
163    </select>
164  </td></tr>
165  {/if}
166  {if isset($rate_summary) }
167  <tr>
168    <td class="label">{'Average rate'|@translate}</td>
169    <td class="value">
170    {if $rate_summary.count}
171      {assign var='rate_text' value='%.2f (rated %d times, standard deviation = %.2f)'|@translate }
172      {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count, $rate_summary.std) }
173    {else}
174      {'no_rate'|@translate}
175    {/if}
176    </td>
177  </tr>
178  {/if}
179</table>
180
181{if isset($metadata)}
182<table class="infoTable" summary="Some more (technical) info about this picture">
183{foreach from=$metadata item=meta}
184  <tr>
185    <th colspan="2">{$meta.TITLE}</th>
186  </tr>
187  {foreach from=$meta.lines item=value key=label}
188  <tr>
189    <td class="label">{$label}</td>
190    <td class="value">{$value}</td>
191  </tr>
192  {/foreach}
193{/foreach}
194</table>
195{/if}
196
197{if isset($rating)}
198<form action="{$rating.F_ACTION}" method="post" id="rateForm">
199<div>
200{if isset($rating.USER_RATE)}{'update_rate'|@translate}{else}{'new_rate'|@translate}{/if}
201:
202{foreach from=$rating.marks item=mark name=rate_loop}
203{if !$smarty.foreach.rate_loop.first} | {/if}
204{if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
205  <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" />
206{else}
207  <input type="submit" name="rate" value="{$mark}" class="rateButton" />
208{/if}
209{/foreach}
210<script type="text/javascript" src="{$ROOT_URL}{$themeconf.template_dir}/rating.js"></script>
211</div>
212</form>
213{/if}
214
215<hr class="separation">
216
217{if isset($COMMENT_COUNT)}
218<div id="comments">
219  <h2>[{$COMMENT_COUNT}] {'comments_title'|@translate}</h2>
220
221  <div class="navigationBar">{$COMMENT_NAV_BAR}</div>
222
223  {if isset($comments)}
224  {foreach from=$comments item=comment}
225  <div class="comment">
226    {if isset($comment.U_DELETE)}
227    <p class="userCommentDelete">
228    <a href="{$comment.U_DELETE}" title="{'comments_del'|@translate}">
229      <img src="{$ROOT_URL}{$themeconf.icon_dir}/delete.png" class="button" style="border:none;vertical-align:middle; margin-left:5px;" alt="[{'delete'|@translate}]"/>
230    </a>
231    </p>
232    {/if}
233    <p class="commentInfo"><span class="author">{$comment.AUTHOR}</span> - {$comment.DATE}</p>
234    <blockquote>{$comment.CONTENT}</blockquote>
235  </div>
236  {/foreach}
237  {/if}
238
239  {if isset($comment_add)}
240  <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
241    <fieldset>
242      <legend>{'comments_add'|@translate}</legend>
243      {if $comment_add.SHOW_AUTHOR}
244      <label>{'upload_author'|@translate}<input type="text" name="author"></label>
245      {/if}
246      <label>{'comment'|@translate}<textarea name="content" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
247      <input type="hidden" name="key" value="{$comment_add.KEY}" />
248      <input class="submit" type="submit" value="{'Submit'|@translate}">
249    </fieldset>
250  </form>
251  {/if}
252
253</div>
254{/if} {*comments*}
255
256{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.