Ignore:
Timestamp:
Jun 23, 2009, 3:44:58 PM (15 years ago)
Author:
nikrou
Message:

Feature 1026 : Modify / delete comments for users

+ update config table content
+ minor modification of Sylvia theme
+ need refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/template/yoga/comment_list.tpl

    r3282 r3445  
    33{foreach from=$comments item=comment name=comment_loop}
    44<li>
    5         <div class="thumbnailCategory {if $smarty.foreach.comment_loop.index is odd}odd{else}even{/if}">
     5  <div class="thumbnailCategory {if $smarty.foreach.comment_loop.index is odd}odd{else}even{/if}">
    66    {if isset($comment.TN_SRC)}
    77    <div class="illustration">
     
    1111    </div>
    1212    {/if}
    13     <div class="description">
    14       {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) }
     13    <div class="description" style="height:{if ($comment.IN_EDIT==1)}200{/if}px">
     14      {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) or isset($comment.U_EDIT) }
    1515      <ul class="actions" style="float:right">
    1616        {if isset($comment.U_DELETE)}
    1717        <li>
    18           <a href="{$comment.U_DELETE}" title="{'delete this comment'|@translate}">
     18          <a href="{$comment.U_DELETE}" title="{'delete this comment'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">
    1919            <img src="{$ROOT_URL}{$themeconf.icon_dir}/delete.png" class="button" alt="[delete]">
     20          </a>
     21        </li>
     22        {/if}
     23        {if isset($comment.U_EDIT) and ($comment.IN_EDIT!=1)}
     24        <li>
     25          <a class="editComment" href="{$comment.U_EDIT}#edit_comment" title="{'edit this comment'|@translate}">
     26            <img src="{$ROOT_URL}{$themeconf.icon_dir}/edit.png" class="button" alt="[edit]">
    2027          </a>
    2128        </li>
     
    3138      {/if}
    3239      <span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span>
     40      {if ($comment.IN_EDIT==1)}
     41      <a name="edit_comment"></a>
     42      <form  method="post" action="{$comment.U_EDIT}" class="filter" id="editComment">
     43        <fieldset>
     44          <legend>{'Edit a comment'|@translate}</legend>
     45          <label>{'comment'|@translate}<textarea name="content" id="contenteditid" rows="5" cols="80">{$comment.CONTENT}</textarea></label>
     46          <input type="hidden" name="key" value="{$comment.KEY}">
     47          <input type="hidden" name="image_id" value="{$comment.IMAGE_ID|default:$current.id}">
     48          <input class="submit" type="submit" value="{'Submit'|@translate}">
     49        </fieldset>
     50      </form>
     51      {else}     
    3352      <blockquote>{$comment.CONTENT}</blockquote>
     53      {/if}
    3454    </div>
    3555  </div>
    36 </li>
    37 {if isset($comment_separator)}
    38 <hr>
    39 {/if}
     56<li>
    4057{/foreach}
    4158</ul>
Note: See TracChangeset for help on using the changeset viewer.