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

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