Changeset 2692

Show
Ignore:
Timestamp:
07/03/08 02:52:55 (12 months ago)
Author:
auno
Message:

Fixed to work previewing comment reply. BugzID:80425

Location:
branches/release-41
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/lib/MT/CMS/Comment.pm

    r2643 r2692  
    12901290    $param->{'comment'} = $comment; 
    12911291 
    1292     require MT::Serialize; 
    1293     my $ser   = MT::Serialize->new( $cfg->Serializer ); 
    1294     my $state = $comment->column_values; 
    1295     $state->{static} = $q->param('static'); 
    1296     $param->{'comment_state'} = unpack 'H*', $ser->serialize( \$state ); 
    1297     $param->{'comment_is_static'} = 1; 
    1298     $param->{'entry'} = $entry; 
    1299     $param->{'current_timestamp'} = $ts; 
    1300     $param->{'commenter'} = $app->user; 
    1301     $param->{'blog_id'} = $parent->blog_id; 
    1302     $param->{'blog'} = $parent->blog; 
     1292    my $tmpl = $app->load_tmpl('include/comment_detail.tmpl'); 
     1293    my $ctx  = $tmpl->context; 
     1294    $ctx->stash( 'comment', $comment ); 
     1295    $ctx->stash( 'entry',   $entry ); 
     1296    $ctx->stash( 'blog',    $parent->blog ); 
     1297    $param->{'preview_html'} = $tmpl->output; 
    13031298 
    13041299    return $app->build_page( 'dialog/comment_reply.tmpl', 
     
    17671762    $comment->blog_id( $entry->blog_id ); 
    17681763    $comment->entry_id( $entry->id ); 
     1764    $comment->parent_id( $parent->id ); 
    17691765    $comment->author( remove_html($nick) ); 
    17701766    $comment->email( remove_html( $app->user->email ) ); 
  • branches/release-41/tmpl/cms/dialog/comment_reply.tmpl

    r1710 r2692  
    3131        <div class="intro"><__trans phrase="Preview of your comment"></div> 
    3232        <div id="reply-body"> 
    33 <$mt:include name="include/comment_detail.tmpl"$> 
     33            <mt:var name="preview_html"> 
    3434        </div> 
    3535    </div> 
  • branches/release-41/tmpl/cms/include/comment_detail.tmpl

    r2613 r2692  
    44            <div class="asset-meta"> 
    55               <span class="byline"> 
    6                    <__trans phrase="By [_1]" params='<span class="vcard author"><$MTCommentAuthorLink default_name="Anonymous" show_email="0"$></span><MTIfNonEmpty tag="CommentAuthorIdentity"><$MTCommentAuthorIdentity$></MTIfNonEmpty>'> 
    7                    <MTCommentParent> 
    8                    <__trans phrase="replied to [_1]" params='<a href="#comment-<$MTCommentID$>"><MTCommentAuthor></a>'> 
    9                    </MTCommentParent> 
    10                    <__trans phrase="on [_1]" params='<a href="#comment-<$MTCommentID$>"><abbr class="published" title="<$MTCommentDate format_name="iso8601"$>"><$MTCommentDate$></abbr></a>'> 
    11                    <MTIfCommentsAccepted> | <$MTCommentReplyToLink$></MTIfCommentsAccepted> 
     6                            <$mt:CommentAuthorIdentity$> 
     7        <mt:IfCommentParent> 
     8                            <__trans phrase="[_1] replied to <a href="[_2]">comment from [_3]</a>" params="<span class="vcard author"><$mt:CommentAuthorLink$></span>%%<mt:CommentParent><$mt:CommentLink$></mt:CommentParent>%%<mt:CommentParent><$mt:CommentAuthor$></mt:CommentParent>"> 
     9        <mt:Else> 
     10                            <span class="vcard author"><$mt:CommentAuthorLink$></span> 
     11        </mt:IfCommentParent> 
     12                            | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a> 
     13        <mt:IfCommentsAccepted> 
     14                            | <$mt:CommentReplyToLink$> 
     15        </mt:IfCommentsAccepted> 
    1216               </span> 
    1317            </div>