Ignore:
Timestamp:
Apr 29, 2012, 5:09:28 PM (12 years ago)
Author:
mistic100
Message:

update for 2.4
delete useless admin page
now compatible with RV Thumb Scroller

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/template/albums.tpl

    r11267 r14528  
    11{* this is inspired by theme/defaults/template/picture.tpl *}
     2 
     3{* <!-- need some css modifications, specific to each theme --> *}
     4{html_head}
     5<style type="text/css">
     6#comments .commentElement {ldelim} width:98%;}
     7{if $COMMENTS_ON_TOP}
     8#commentAdd, #pictureCommentList {ldelim} float:none; display:inline-block; width:47.5%; vertical-align:top;}
     9#commentsSwitcher {ldelim} float:none; display:inline-block; margin: 2px 0; cursor:pointer;}
     10.noCommentContent #commentsSwitcher     {ldelim} display: none;}
     11.switchArrow{ldelim} width: 16px; height: 16px; margin: 5px;}
     12.commentshidden #pictureComments {ldelim} display: none;}
     13.commentContent .comments_toggle        {ldelim} cursor: pointer;}
     14{/if}
     15{if $themeconf.name == 'Sylvia'}
     16#comments .description {ldelim} padding: 15px 2px 6px 12px;}
     17#comments .commentElement {ldelim} border: 1px solid #666;}
     18{/if}
     19{if $themeconf.name|strstr:"stripped"}
     20#comments {ldelim} text-align: left;}
     21#comments .description {ldelim} height:auto;}
     22#thumbnails_block2 {ldelim} min-height:0;}
     23{/if}
     24
     25</style>
     26{/html_head}
     27
     28{* <!-- if RV Thumb Scroller is installed comments block is displayed on top with a drop-down --> *}
     29{if $COMMENTS_ON_TOP}
     30{footer_script}{literal}
     31        // comments show/hide
     32        var commentsswicther=jQuery("#commentsSwitcher");
     33        var comments=jQuery("#theCategoryPage #comments");
     34       
     35        commentsswicther.html("<div class=\"switchArrow\">&nbsp;</div>");
     36  {/literal}{if $themeconf.name != 'elegant'}switcharrow = commentsswicther.children(".switchArrow");{else}switcharrow = $("<div></div>");{/if}{literal}
     37       
     38        if (comments.length == 1) {
     39                var comments_button=jQuery("#comments h3");
     40
     41                if (comments_button.length == 0) {
     42                        jQuery("#addComment").before("<h3>Comments</h3>");
     43                        comments_button=jQuery("#comments h3");
     44                }
     45       
     46    {/literal}{if $DISPLAY_COMMENTS_BLOCK}
     47                comments.addClass("commentsshown");
     48                comments_button.addClass("comments_toggle").addClass("comments_toggle_on");
     49    switcharrow.html("&uarr;");
     50    {else}
     51    comments.addClass("commentshidden");
     52                comments_button.addClass("comments_toggle").addClass("comments_toggle_off");
     53    switcharrow.html("&darr;");
     54                {/if}{literal}
     55   
     56                comments_button.click(function() { commentsToggle() });
     57                commentsswicther.click(function() { commentsToggle() });
     58       
     59        }
    260 
    3 {combine_css path=$COA_PATH|@cat:'template/style_albums.css'}
    4 {if $themeconf.name == 'Sylvia'}{combine_css path=$COA_PATH|@cat:'template/style_albums_sylvia.css'}{/if}
     61  function commentsToggle() {
     62    var comments=jQuery("#theCategoryPage #comments");
     63    var comments_button=jQuery("#comments h3");
    564
    6 <a name="comments"></a>
     65    if (comments.hasClass("commentshidden")) {
     66        comments.removeClass("commentshidden").addClass("commentsshown");
     67        comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_off");
     68        switcharrow.html("&uarr;");
     69      } else {
     70        comments.addClass("commentshidden").removeClass("commentsshown");
     71        comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_on");
     72        switcharrow.html("&darr;");
     73      }
     74
     75  }
     76{/literal}{/footer_script}
     77{/if}
     78
    779{if isset($COMMENT_COUNT)}
    8 <div id="comments">
    9   {if $COMMENT_COUNT > 0}
    10     <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
    11   {/if}
     80<div id="comments" style="margin:10px 0 10px 0;" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}>
     81  <h3 style="margin:0 0 0 5px;"><div id="commentsSwitcher"></div>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
    1282
    13   {if isset($comments)}
    14     {include file='comment_list.tpl'}
    15   {/if}
    16  
    17   {if !empty($comment_navbar)}{include file=$COA_ABSOLUTE_PATH|@cat:'template/navigation_bar.tpl'}{/if}
     83  <div id="pictureComments"><fieldset>
     84    {if isset($comment_add)}
     85                <div id="commentAdd">
     86                        <h4>{'Add a comment'|@translate}</h4>
     87                        <form method="post" action="{$comment_add.F_ACTION}" id="addComment">
     88                                {if $comment_add.SHOW_AUTHOR}
     89                                        <p><label>{'Author'|@translate} :</label></p>
     90                                        <p><input type="text" name="author"></p>
     91                                        <p><label>{'Comment'|@translate} :</label></p>
     92                                {/if}
     93                                <p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
     94                                <p><input type="hidden" name="key" value="{$comment_add.KEY}">
     95                                        <input type="submit" value="{'Submit'|@translate}"></p>
     96                        </form>
     97                </div>
     98    {/if}
     99    {if isset($comments)}
     100                <div id="pictureCommentList">
     101                        {if (($COMMENT_COUNT > 2) || !empty($comment_navbar))}
     102                                <div id="pictureCommentNavBar">
     103                                        {if $COMMENT_COUNT > 2}
     104                                                <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
     105                                        {/if}
     106                                        {if !empty($comment_navbar) }{include file=$COA_ABSOLUTE_PATH|@cat:'template/navigation_bar.tpl'|@get_extent:'navbar'}{/if}
     107                                </div>
     108                        {/if}
     109      {include file='comment_list.tpl'}
     110                </div>
     111                {/if}
     112                {if not $COMMENTS_ON_TOP}<div style="clear:both"></div>{/if}
     113        </fieldset></div>
    18114
    19   {if isset($comment_add)}
    20   <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
    21     <fieldset>
    22       <legend>{'Add a comment'|@translate}</legend>
    23       {if $comment_add.SHOW_AUTHOR}
    24         <label>{'Author'|@translate}<input type="text" name="author"></label>
    25       {/if}
    26       <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
    27       <input type="hidden" name="key" value="{$comment_add.KEY}">
    28       <input type="submit" value="{'Submit'|@translate}">
    29     </fieldset>
    30   </form>
    31   {/if}
    32115</div>
    33116{/if}{*comments*}
Note: See TracChangeset for help on using the changeset viewer.