source: extensions/gally/gally-default/template/comment_list.tpl @ 16016

Last change on this file since 16016 was 16016, checked in by grum, 12 years ago

feature:2664- compatibility with Piwigo 2.4

  • Property svn:executable set to *
File size: 2.8 KB
Line 
1{*
2 The comment list is defined inside a tabsheet made with the jQuery $().tabs()
3 With jQuery 1.2.6 (don't know how other release manage this) all the anchors <A> tags are considered as a tab.
4 So, can't use <A href="link"> because href is modified by the jQuery function.
5 Links are managed by an event onclick="document.location='link';"
6*}
7
8{footer_script}{literal}
9  function editInside(url, text, imageId, key, index)
10  {
11    $('#editInside'+index).get(0).appendChild($("#formEditInside").get(0));
12    $("#formEditInside").css('display', 'block');
13    $('#feiKey').val(key);
14    $('#feiImageId').val(imageId);
15    $('#contentEditId').val(text);
16    $('#editComment').attr('action', url);
17
18  }
19{/literal}{/footer_script}
20
21
22<div id="formEditInside" style="display:none;">
23  <form  method='post' action='' id='editComment'>
24      {'Edit'|@translate}<br>
25      <textarea name='content' id='contentEditId' rows='5' cols='80'></textarea></label><br>
26      <input type='hidden' name='key' id='feiKey' value=''>
27      <input type="hidden" name="pwg_token" id='feiToken' value="{$gally->getToken()}">
28      <input type='hidden' name='image_id' id='feiImageId' value=''>
29      <input class='submit' type='submit' value='{"Submit"|@translate}'>
30  </form>
31</div>
32
33<ul class="commentList">
34{foreach from=$comments item=comment name=comment_loop}
35<li>
36  <div class="commentDetail">
37    {if isset($comment.src_image)}
38    <div class="illustration">
39      <a href="{$comment.U_PICTURE}">
40        <img src="{$pwg->derivative_url($derivative_params, $comment.src_image)}" alt="{$comment.ALT}">
41      </a>
42    </div>
43    {/if}
44    <div class="description">
45      {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) or isset($comment.U_EDIT)}
46      <ul class="actions" style="float:right">
47        {if isset($comment.U_DELETE)}
48        <li>
49          <span class="button id_delete" onclick="document.location='{$comment.U_DELETE}';" title="{'Delete'|@translate}"></span>
50        </li>
51        {/if}
52
53        {if isset($comment.U_EDIT)}
54        <li>
55          <span class="button id_edit" onclick="editInside('{$comment.U_EDIT}#edit_comment', '{$comment.CONTENT|@escape}', {$gally->getCommentImage($comment.ID)}, '{$gally->getCommentKey($comment.ID)}', {$smarty.foreach.comment_loop.index});" title="{'Edit'|@translate}"></span>
56        </li>
57        {/if}
58        {if isset($comment.U_VALIDATE)}
59        <li>
60          <span class="button id_validate" onclick="document.location='{$comment.U_VALIDATE}';" title="{'Validate'|@translate}"></span>
61        </li>
62        {/if}
63      </ul>
64      {/if}
65      <span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span>
66
67      <div id="editInside{$smarty.foreach.comment_loop.index}">
68        <blockquote>{$comment.CONTENT}</blockquote>
69      </div>
70
71    </div>
72  </div>
73</li>
74
75{/foreach}
76</ul>
Note: See TracBrowser for help on using the repository browser.