{assign var="canQuote" value=!$topicInfo.locked && ($canEdit || $canPost)} {foreach from=$postList item=post}
{add_content key="forum.before_post_add_content" postId=$post.id userId=$post.userId text=$post.text} {if $firstTopicPost->id == $post.id} {assign var="socialSharing" value={add_content key="socialsharing.get_mobile_button" description=$post.text title=$topicInfo.title image='' buttonLabelKey="socialsharing+share_title" entityType="forum_topic" entityId=$post.topicId}} {else} {assign var="socialSharing" value=""} {/if} {assign var="showQuoteButton" value=$canQuote && $post.userId != $userId} {assign var="showFlagButton" value=$userId <> 0} {assign var="showShareButton" value=$socialSharing <> ""} {if $showQuoteButton && $showFlagButton && $showShareButton} {assign var="buttonsClass" value="owm_card_toolbar_3b"} {else if ($showQuoteButton && $showFlagButton) || ($showFlagButton && $showShareButton) || ($showShareButton && $showQuoteButton) } {assign var="buttonsClass" value="owm_card_toolbar_2b"} {else} {assign var="buttonsClass" value="owm_card_toolbar_1b"} {/if}
#{$post.number} {$post.createStamp}
{decorator name="avatar_item" data=$avatars[$post.userId]}
{if ($isModerator || ($userId == $post.userId && !$topicInfo.locked)) && $post.id != $firstTopic->id}
{component class="FORUM_MCMP_ForumPostContextMenu" topicId=$post.topicId postId=$post.id }
{/if}
{$post.text}
{if $enableAttachments && isset($attachments[$post.id])}
{foreach from=$attachments[$post.id] item='attm'}
{/foreach}
{/if}
{if !empty($post.edited) } {/if}
{if $showQuoteButton || $showFlagButton || $showShareButton}
{/if} {add_content key="forum.after_post_add_content" postId=$post.id userId=$post.userId text=$post.text} {if $firstTopic->id == $post.id} {add_content key='forum.topic.content.after_first_post'} {/if}
{/foreach}
{if isset($paging)}{$paging}{/if} {script} $(document).ready(function() { // flag post $(".owm_card_toolbar_flag").bind("click", function(e) { e.preventDefault(); OWM.flagContent($(this).parent().attr("data-type"), $(this).parent().attr("data-id")); }); {if $canQuote } // quote post $(".owm_card_toolbar_quote").bind("click", function(e) { e.preventDefault(); // show the post form OWM.ajaxFloatBox("FORUM_MCMP_ForumAddPost", [{ "topicId" : {$topicInfo.id}, "postId" : $(this).parent().attr("data-id") }], { "title" : "{text key='forum+add_post_title'}" }); }); {/if} {if ($isModerator || ($userId == $post.userId && !$topicInfo.locked))} // delete post $(".forum_delete_post").bind("click", function(e) { e.preventDefault(); if ( confirm("{text key='forum+delete_post_confirm'}") ) { $.post($(this).attr("href"), function(data) { var data = jQuery.parseJSON(data); if (data.result === true && data.url) { location.href = data.url; } }); } }); // edit post $(".forum_edit_post").bind("click", function(e) { e.preventDefault(); OWM.ajaxFloatBox("FORUM_MCMP_ForumEditPost", [{ "topicId" : "{$topicInfo.id}", "postId" : $(this).attr("data-id") }], { "title" : "{text key='forum+edit_post_title'}" }); }); {/if} }); {/script}