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

Last change on this file since 2492 was 2481, checked in by rvelices, 16 years ago
  • further reduce css rules and remove unused ones
  • added a smarty prefilter so that html output is nicely indented now ...
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 9.3 KB
Line 
1{* $Id: picture.tpl 2481 2008-08-22 00:45:03Z 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) }{*caddie management BEGIN*}
58<script type="text/javascript">
59{literal}function addToCadie(aElement, rootUrl, id)
60{
61if (aElement.disabled) return;
62aElement.disabled=true;
63var y = new PwgWS(rootUrl);
64
65y.callService(
66  "pwg.caddie.add", {image_id: id} ,
67  {
68    onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
69    onSuccess: function(result) { aElement.disabled = false; }
70  }
71  );
72}{/literal}
73</script>
74      <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>
75    {/if}{*caddie management END*}
76  </div>
77  {include file=$FILE_PICTURE_NAV_BUTTONS}
78</div> <!-- imageToolBar -->
79
80<div id="theImage">
81{$ELEMENT_CONTENT}
82
83{if isset($COMMENT_IMG)}
84<p>{$COMMENT_IMG}</p>
85{/if}
86
87{if isset($U_SLIDESHOW_STOP) }
88<p>
89  [ <a href="{$U_SLIDESHOW_STOP}">{'slideshow_stop'|@translate}</a> ]
90</p>
91{/if}
92
93</div>
94
95{if isset($previous) }
96<a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev">
97  <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}">
98</a>
99{/if}
100{if isset($next) }
101<a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next">
102  <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}">
103</a>
104{/if}
105
106<table class="infoTable" summary="Some info about this picture">
107  <tr>
108    <td class="label">{'Author'|@translate}</td>
109    <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
110  </tr>
111  <tr>
112    <td class="label">{'Created on'|@translate}</td>
113    <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
114  </tr>
115  <tr>
116    <td class="label">{'Posted on'|@translate}</td>
117    <td class="value">{$INFO_POSTED_DATE}</td>
118  </tr>
119  <tr>
120    <td class="label">{'Dimensions'|@translate}</td>
121    <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
122  </tr>
123  <tr>
124    <td class="label">{'File'|@translate}</td>
125    <td class="value">{$INFO_FILE}</td>
126  </tr>
127  <tr>
128    <td class="label">{'Filesize'|@translate}</td>
129    <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
130  </tr>
131  <tr>
132    <td class="label">{'Tags'|@translate}</td>
133    <td class="value">
134      {if isset($related_tags)}
135        {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}
136        <a href="{$tag.URL}">{$tag.name}</a>{/foreach}
137      {/if}
138    </td>
139  </tr>
140  <tr>
141    <td class="label">{'Categories'|@translate}</td>
142    <td class="value">
143      {if isset($related_categories)}
144      <ul>
145        {foreach from=$related_categories item=cat}
146        <li>{$cat}</li>
147        {/foreach}
148      </ul>
149      {/if}
150    </td>
151  </tr>
152  <tr>
153    <td class="label">{'Visits'|@translate}</td>
154    <td class="value">{$INFO_VISITS}</td>
155  </tr>
156  {if isset($available_permission_levels) }
157  <tr>
158    <td class="label">{'Privacy level'|@translate}:</td>
159    <td class="value">
160<script type="text/javascript">
161{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
162{
163selectElement.disabled = true;
164var y = new PwgWS(rootUrl);
165y.callService(
166  "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
167  {
168    onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
169    onSuccess: function(result) { selectElement.disabled = false; }
170  }
171  );
172}{/literal}
173</script>
174    <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)">
175    {foreach from=$available_permission_levels item=level}
176        <option value="{$level}"{if $current.level==$level} selected="selected"{/if}>{$pwg->l10n($pwg->sprintf('Level %d',$level))}</option>
177    {/foreach}
178    </select>
179  </td></tr>
180  {/if}
181
182  {if isset($rate_summary) }
183  <tr>
184    <td class="label">{'Average rate'|@translate}</td>
185    <td class="value" id="ratingSummary">
186    {if $rate_summary.count}
187      {assign var='rate_text' value='%.2f (rated %d times, standard deviation = %.2f)'|@translate }
188      {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count, $rate_summary.std) }
189    {else}
190      {'no_rate'|@translate}
191    {/if}
192    </td>
193  </tr>
194  {/if}
195 
196{if isset($rating)}
197        <tr>
198                <td class="label">
199                        <span id="updateRate">{if isset($rating.USER_RATE)}{'update_rate'|@translate}{else}{'new_rate'|@translate}{/if}</span>
200                </td>
201                <td class="value">
202                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
203                        <div>&nbsp;
204                        {foreach from=$rating.marks item=mark name=rate_loop}
205                        {if !$smarty.foreach.rate_loop.first} | {/if}
206                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
207                          <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" />
208                        {else}
209                          <input type="submit" name="rate" value="{$mark}" class="rateButton" />
210                        {/if}
211                        {/foreach}
212                        <script type="text/javascript" src="{$ROOT_URL}{$themeconf.template_dir}/rating.js"></script>
213                        <script type="text/javascript">
214                        makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
215                        updateRateText: "{'update_rate'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
216                        ratingSummaryText: "{'%.2f (rated %d times, standard deviation = %.2f)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} );
217                        </script>
218                        </div>
219                        </form>
220                </td>
221        </tr>
222{/if}
223
224</table>
225
226{if isset($metadata)}
227<table class="infoTable" summary="Some more (technical) info about this picture">
228{foreach from=$metadata item=meta}
229  <tr>
230    <th colspan="2">{$meta.TITLE}</th>
231  </tr>
232  {foreach from=$meta.lines item=value key=label}
233  <tr>
234    <td class="label">{$label}</td>
235    <td class="value">{$value}</td>
236  </tr>
237  {/foreach}
238{/foreach}
239</table>
240{/if}
241
242
243<hr class="separation">
244
245{if isset($COMMENT_COUNT)}
246<div id="comments">
247        <h3>[{$COMMENT_COUNT}] {'comments_title'|@translate}</h3>
248
249        {if !empty($COMMENT_NAV_BAR)}
250        <div class="navigationBar">{$COMMENT_NAV_BAR}</div>
251        {/if}
252
253        {if isset($comments)}
254                {include file='comment_list.tpl' comment_separator=true}
255        {/if}
256
257        {if isset($comment_add)}
258        <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
259        <fieldset>
260                <legend>{'comments_add'|@translate}</legend>
261                {if $comment_add.SHOW_AUTHOR}
262                <label>{'upload_author'|@translate}<input type="text" name="author"></label>
263                {/if}
264                <label>{'comment'|@translate}<textarea name="content" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
265                <input type="hidden" name="key" value="{$comment_add.KEY}" />
266                <input class="submit" type="submit" value="{'Submit'|@translate}">
267        </fieldset>
268        </form>
269        {/if}
270</div>
271{/if} {*comments*}
272
273
274
275{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.