<!-- Editor custom -->
<template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor Assets" groups="base.group_user">
<xpath expr="." position="inside">
- <link rel='stylesheet' href="/website_forum/static/src/css/website_forum.css"/>
- <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
<script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
</xpath>
</template>
-<template id="assets_forum" name="Forum Assets">
- <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
- <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
+<!-- Front-end custom css / js + ckeditor lib and customization -->
+<template id="assets_frontend" inherit_id="website.assets_frontend" name="Forum Assets">
+ <xpath expr="." position="inside">
+ <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
+ <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
+ <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
+ <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
+ <script type="text/javascript">
+ var CKEDITOR_BASEPATH = '/web/static/lib/ckeditor/';
+ </script>
+ <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"></script>
+ <script type="text/javascript">
+ CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
+ ,['Outdent','Indent','Link','Unlink','Image'],] ;
+ </script>
- <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
- <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
- <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
- <script type="text/javascript">
- CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
- ,['Outdent','Indent','Link','Unlink','Image'],] ;
- </script>
+ </xpath>
</template>
<!-- Layout add nav and footer -->
<!-- Page Index -->
<template id="header" name="Forum Index">
<t t-call="website.layout">
- <t t-set="head">
- <t t-call-assets="website_forum.assets_forum"/>
- </t>
<div t-if="is_public_user and not no_introduction_message" class="alert alert-success alert-dismissable">
<div class="container">
- <div t-field="forum.introduction_message"/>
+ <h1 class="mt0">Welcome!</h1>
+ <div t-field="forum.description"/>
<a class='btn btn-primary' t-attf-href="/web?redirect=#{ request.httprequest.url }">Register</a>
<button type="button" class="btn btn-link js_close_intro" data-dismiss="alert" aria-hidden="true">Hide Intro</button>
</div>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
- <!-- <span class="icon-bar"></span> -->
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
</div>
<div id="wrap" class="container">
- <div class="row">
+ <div class="row mb16">
<div class="col-sm-9">
<div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
<button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
<div t-field="notification.body"/>
<a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
</div>
+ <div t-if="not validation_email_sent and not is_public_user and user.karma == 0" class="alert alert-danger alert-dismissable">
+ <button type="button" class="close validation_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <div>
+ <p>
+ It appears your email has not been verified.
+ <a class="send_validation_email" href="#" t-att-forum-id="forum.id">Click here to send a verification email allowing you to participate to the forum.</a>
+ </p>
+ </div>
+ </div>
+ <div t-if="validation_email_done" class="alert alert-success alert-dismissable">
+ <button type="button" class="close validated_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <div>
+ <p>Congratulations! Your email has just been validated. You may now participate to our forums.</p>
+ </div>
+ </div>
<t t-raw="0"/>
</div>
<div class="col-sm-3" id="right-column">
- <div t-if="not header.get('ask_hide')" t-attf-class="btn-group btn-block mb16 #{user.karma >= forum.karma_ask and '' or 'karma_required'}" t-attf-data-karma="#{forum.karma_ask}">
- <a type="button" class="btn btn-primary btn-lg col-sm-10" t-attf-href="/forum/#{slug(forum)}/#{forum.default_allow}">
- <t t-if="forum.default_allow == 'ask_question'">Ask a Question</t>
- <t t-if="forum.default_allow == 'post_link'">Submit a Post</t>
- <t t-if="forum.default_allow == 'post_discussion'">New Discussion</t>
+ <div t-if="not header.get('ask_hide')" t-attf-class="btn-group btn-block mb16 #{(user.karma < forum.karma_ask) and 'karma_required' or ''}" t-attf-data-karma="#{forum.karma_ask}">
+ <a type="button" class="btn btn-primary btn-lg col-sm-10" t-attf-href="/forum/#{slug(forum)}/ask?post_type=#{forum.default_post_type}">
+ <t t-if="forum.default_post_type == 'question'">Ask a Question</t>
+ <t t-if="forum.default_post_type == 'link'">Submit a Link</t>
+ <t t-if="forum.default_post_type == 'discussion'">New Discussion</t>
</a>
<button type="button" class="btn btn-primary btn-lg col-sm-2 dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Select Post</span>
</button>
<ul class="dropdown-menu" role="menu">
- <li t-if="forum.allow_link"><a t-attf-href="/forum/#{slug(forum)}/post_link">Submit a Post</a></li>
- <li t-if="forum.allow_question"><a t-attf-href="/forum/#{slug(forum)}/ask_question">Ask a Question</a></li>
- <li t-if="forum.allow_discussion"><a t-attf-href="/forum/#{slug(forum)}/post_discussion">Launch a Discussion</a></li>
+ <li t-if="forum.allow_question"><a t-attf-href="/forum/#{slug(forum)}/ask?post_type=question">Ask a Question</a></li>
+ <li t-if="forum.allow_link"><a t-attf-href="/forum/#{slug(forum)}/ask?post_type=link">Submit a Link</a></li>
+ <li t-if="forum.allow_discussion"><a t-attf-href="/forum/#{slug(forum)}/ask?post_type=discussion">New Discussion</a></li>
</ul>
</div>
<div class="panel panel-default">
<!-- Display a post -->
<template id="display_post">
- <div class="question row">
- <div class="col-md-2 hidden-xs text-center">
+ <div class="question">
+ <div class="pull-left">
<t t-call="website_forum.vote">
<t t-set="post" t-value="question"/>
</t>
</div>
- <div class="col-md-10 clearfix">
+ <div class="question-block">
<div class="question-name">
- <t t-if="question.type == 'link'">
+ <t t-if="question.post_type == 'link'">
<a t-att-href="question.content_link" t-raw="question.name"/>
</t>
- <t t-if="question.type in ('question', 'discussion')">
+ <t t-if="question.post_type in ('question', 'discussion')">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
</t>
<span t-if="not question.active"><b> [Deleted]</b></span>
<!-- Display a post as an answer -->
<template id="display_post_answer">
<div class="clearfix">
- <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
+ <div t-attf-class="pull-left text-center mb16 #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
<div t-esc="len(answer.vote_ids)"/>
</div>
<div class="question-name" style="margin-left: 32px;">
<t t-call="website_forum.header">
<h2 class="page-header mt0">
<t t-esc="question_count"/>
- <span t-if="post_type == 'all'">Posts</span>
+ <span t-if="post_type not in ('link','question','discussion')">Posts</span>
<span t-if="post_type == 'question'">Questions</span>
- <span t-if="post_type == 'link'">Posts</span>
- <span t-if="post_type == 'discussion'">Discussions</span>
+ <span t-if="post_type == 'link'">Links</span>
+ <span t-if="post_type == 'discussion'">Threads</span>
<t t-esc="search"/>
<small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
<a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
</li>
- <li class="dropdown-header">Tags</li>
+ <li t-if="tag" class="dropdown-header">Tags</li>
<li t-if="tag" t-att-class="tag and 'active' or '' ">
<a href=""><t t-esc="tag.name"/></a>
</li>
</template>
<!-- Edition: Post Article -->
-<template id="post_link">
+<template id="new_link">
<t t-call="website_forum.header">
<h1 class="mt0">Submit a Link</h1>
<p class="mb32">
We keep a high level of quality in showcased posts, only 20% of the submited
posts will be featured.
</p>
- <form t-attf-action="/forum/#{ slug(forum) }/link/new" method="post" role="form" class="tag_text form-horizontal">
+ <form t-attf-action="/forum/#{ slug(forum) }/new?post_type=link" method="post" role="form" class="tag_text form-horizontal">
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
<div class="form-group">
<label class="col-sm-2 control-label" for="content_link">URL to Share</label>
</template>
<!-- Edition: Post your Discussion Topic -->
-<template id="post_discussion">
+<template id="new_discussion">
<t t-call="website_forum.header">
<h1 class="mt0">Post Your Discussion Topic</h1>
<p>
<b>Share</b> Start Something Awesome
</p>
- <form t-attf-action="/forum/#{ slug(forum) }/discussion/new" method="post" role="form" class="tag_text">
+ <form t-attf-action="/forum/#{slug(forum)}/new?post_type=discussion" method="post" role="form" class="tag_text">
<input type="text" name="post_name" required="True" t-attf-value="#{post_name}"
class="form-control mb16" placeholder="Your Discussion Title..."/>
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
</textarea>
<br/>
<input type="text" name="post_tags" placeholder="Tags" class="form-control load_tags"/>
- <br/>
- <button class="btn btn-primary" id="btn_ask_your_question">Post Your Topic</button>
+ <br/><br/>
+ <button class="btn btn-primary">Post Your Topic</button>
</form>
</t>
</template>
<!-- Edition: ask your question -->
-<template id="ask_question">
+<template id="new_question">
<t t-call="website_forum.header">
<h1 class="mt0">Ask Your Question</h1>
<p>
<li>Avoid unnecessary introductions (Hi,... Please... Thanks...),</li>
<li>Provide enough details and, if possible, give an example.</li>
</ul>
- <script type="text/javascript">
- $(function () {
- $("[data-toggle='popover']").popover();
- });
- </script>
- <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
+ <form t-attf-action="/forum/#{slug(forum)}/new?post_type=question" method="post" role="form" class="tag_text">
<input type="text" name="post_name" required="True" t-attf-value="#{post_name}"
class="form-control mb16" placeholder="Your Question Title..."/>
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
+
<textarea name="content" required="True" id="content" class="form-control load_editor">
<t t-esc="question_content"/>
</textarea>
<br/>
- <input type="text" name="post_tags" placeholder="Tags" class="form-control load_tags"/>
- <br/>
- <button t-attf-class="btn btn-primary #{(user.karma <= forum.karma_ask) and 'karma_required' or ''}"
- id="btn_ask_your_question" t-att-data-karma="forum.karma_ask">Post Your Question</button>
+ <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
+ <input type="hidden" name="post_tags" placeholder="Tags" class="form-control js_select2"/>
+ <br/><br/>
+ <button t-attf-class="btn btn-primary #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
+ t-att-data-karma="forum.karma_ask">Post Your Question</button>
</form>
</t>
</template>
<!-- Edition: edit a post -->
<template id="edit_post">
<t t-call="website_forum.header">
- <h3 t-if="not is_answer">Edit <span t-field="post.type"/></h3>
+ <h3 t-if="not is_answer">Edit <span t-field="post.post_type"/></h3>
<h3 t-if="is_answer">Edit reply</h3>
<form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
<div t-if="not is_answer">
<input type="text" name="post_name" required="True"
t-attf-value="#{post.name}" class="form-control mb8" placeholder="Edit your Post"/>
- <h5 t-if="post.type == 'question'" class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
+ <h5 t-if="post.post_type == 'question'" class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
</div>
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
+ <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
<textarea name="content" id="content" required="True" class="form-control load_editor">
<t t-esc="post.content"/>
</textarea>
<div t-if="not is_answer">
<br/>
- <input type="text" name="post_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
+ <input type="text" name="post_tag" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-value="#{tags}"/>
<br/>
</div>
<button class="btn btn-primary btn-lg">Save</button>
<div class="css_editable_mode_hidden">
<form t-attf-id="reply#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
t-attf-action="/forum/#{ slug(forum) }/#{slug(object)}/reply" method="post" role="form">
- <h3 class="mt10">Your Reply</h3>
+ <h3 class="mt8">Your Reply</h3>
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
<textarea name="content" t-attf-id="content-#{str(object.id)}" class="form-control load_editor" required="True"/>
- <button class="btn btn-primary" id="btn_ask_your_question">Post Your Reply</button>
+ <button class="btn btn-primary">Post Comment</button>
</form>
</div>
</template>
<!-- Edition: post an answer -->
<template id="post_answer">
- <h3 class="mt10">Your Reply</h3>
- <p t-if="question.type == 'question'">
+ <h3 class="mt8">Your Answer</h3>
+ <p t-if="question.post_type == 'question'">
<b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
<b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
- no need to answer the same question twice. Also, please <b>don't forget to vote</b>
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
<textarea name="content" t-attf-id="content-#{str(question.id)}" class="form-control load_editor" required="True"/>
<button t-attf-class="btn btn-primary mt16 #{not question.can_answer and 'karma_required' or ''}"
- id="btn_ask_your_question" t-att-data-karma="question.karma_answer">Post Your Reply</button>
+ t-att-data-karma="question.forum_id.karma_answer">Post Answer</button>
</form>
</template>
<template id="vote">
- <div t-attf-class="box oe_grey">
- <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''} #{((post.user_vote == 1 and not post.can_downvote) or not post.can_upvote) and 'karma_required' or ''}"
- t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
+ <div class="vote text-center">
+ <a t-attf-class="vote_up fa fa-caret-up no-decoration #{post.user_vote == 1 and 'text-success' or ''} #{((post.user_vote == 1 and not post.can_downvote) or not post.can_upvote) and 'karma_required' or ''}"
+ t-attf-data-karma="#{post.user_vote == 1 and post.forum_id.karma_downvote or post.forum_id.karma_upvote}"
t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
- <span id="vote_count" t-esc="post.vote_count"/>
- <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''} #{((post.user_vote == -1 and not post.can_upvote) or not post.can_downvote) and 'karma_required' or ''}"
- t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
+ <div class="vote_count text-muted" t-esc="post.vote_count"/>
+ <a t-attf-class="vote_down fa fa-caret-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''} #{((post.user_vote == -1 and not post.can_upvote) or not post.can_downvote) and 'karma_required' or ''}"
+ t-attf-data-karma="#{post.user_vote == -1 and post.forum_id.karma_upvote or post.forum_id.karma_downvote}"
t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
- <div t-if="vote_count > 1" class="subtitle">
- votes
- </div>
- <div t-if="vote_count < 2" class="subtitle">
- vote
- </div>
+ <t t-raw="0"/>
</div>
</template>
<!-- Specific Post Layout -->
<template id="post_description_full" name="Question Navigation">
<t t-call="website_forum.header">
- <div t-attf-class="row question">
- <div class="col-md-2 hidden-xs text-center">
+ <div t-attf-class="question">
+ <div class="pull-left">
<t t-call="website_forum.vote">
<t t-set="post" t-value="question"/>
+ <div class="mt4">
+ <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
+ t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
+ </div>
</t>
- <div class="text-muted text-center">
- <span t-field="question.views"/> Views
- </div>
- <div class="mt4">
- <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
- t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
- </div>
</div>
- <div t-attf-class="col-md-10 #{not question.active and 'alert alert-danger' or ''}">
- <h1 class="mt0">
- <t t-if="question.type == 'link'">
+ <div t-attf-class="question-block #{not question.active and 'alert alert-danger' or ''}">
+ <h1 class="mt0 mb0">
+ <t t-if="question.post_type == 'link'">
<a t-att-href="question.content_link" t-raw="question.name"/>
</t>
- <t t-if="question.type in ('question', 'discussion')">
+ <t t-if="question.post_type in ('question', 'discussion')">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
</t>
<span t-if="not question.active"><b> [Deleted]</b></span>
<span t-if="question.state == 'close'"><b> [Closed]</b></span>
</h1>
+ <div class="pull-right">
+ <div class="text-right">
+ <t t-foreach="question.tag_ids" t-as="tag">
+ <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="label label-default" t-field="tag.name"/>
+ </t>
+ </div>
+ </div>
+ <div class="text-muted mb16">
+ By
+ <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
+ t-field="question.create_uid"
+ t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
+ style="display: inline-block;"/>
+ on <span t-field="question.create_date" t-field-options='{"format":"short"}'/>
+ • <span t-field="question.views"/> views
+ </div>
+
<div class="alert alert-info text-center" t-if="question.state == 'close'">
<p class="mt16">
- <b>The <i t-field="question.type"/> has been closed<t t-if="question.closed_reason_id"> for reason: <i t-esc="question.closed_reason_id.name"/></t></b>
+ <b>The <i t-field="question.post_type"/> has been closed<t t-if="question.closed_reason_id"> for reason: <i t-esc="question.closed_reason_id.name"/></t></b>
</p>
<t t-if="question.closed_uid">
<b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
</t>
</div>
</div>
- <div t-if="question.type != 'link'"><t t-raw="question.content"/></div>
- <div class="mt16 clearfix">
- <div class="pull-right">
- <div class="text-right">
- <t t-foreach="question.tag_ids" t-as="tag">
- <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="label lebel-default" t-field="tag.name"/>
+ <div t-if="question.post_type != 'link' and question.create_uid.karma >= forum.karma_dofollow"><span t-field="question.content" class="oe_no_empty"/></div>
+ <div t-if="question.post_type != 'link' and question.create_uid.karma < forum.karma_dofollow"><span t-field="question.content" class="oe_no_empty" t-field-options='{"nofollow": 1}'/></div>
+
+ <div class="clearfix">
+ <ul class="pull-right list-inline mb0">
+ <li t-if="question.state != 'close'">
+ <t t-call="website_forum.link_button">
+ <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
+ <t t-set="label" t-value="'Close'"/>
+ <t t-set="classes" t-value="'fa-times'"/>
+ <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
</t>
- </div>
- <ul class="list-inline" id="options">
- <li t-if="question.type == 'question'">
- <a style="cursor: pointer" t-att-data-toggle="question.can_comment and 'collapse' or ''"
- t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
- t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
- t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
- Comment
- </a>
- </li>
- <li t-if="question.state != 'close'">
- <t t-call="website_forum.link_button">
- <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
- <t t-set="label" t-value="'Close'"/>
- <t t-set="classes" t-value="'fa-times'"/>
- <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
- </t>
- </li>
- <li t-if="question.state == 'close'">
- <t t-call="website_forum.link_button">
- <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
- <t t-set="label" t-value="'Reopen'"/>
- <t t-set="classes" t-value="'fa-undo'"/>
- <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
- </t>
- </li>
- <li>
- <t t-call="website_forum.link_button">
- <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
- <t t-set="label" t-value="'Edit'"/>
- <t t-set="classes" t-value="'fa-edit'"/>
- <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
- </t>
- </li>
- <li t-if="question.active">
- <t t-call="website_forum.link_button">
- <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
- <t t-set="label" t-value="'Delete'"/>
- <t t-set="classes" t-value="'fa-trash-o'"/>
- <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
- </t>
- </li>
- <li t-if="not question.active">
- <t t-call="website_forum.link_button">
- <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
- <t t-set="label" t-value="'Undelete'"/>
- <t t-set="classes" t-value="'fa-trash-o'"/>
- <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
- </t>
- </li>
- </ul>
- </div>
- <div>
- <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
- <div>
- <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
- t-field="question.create_uid"
- t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
- style="display: inline-block;"/>
- <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
- <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
- </div>
- </div>
- <div class="visible-xs text-center">
- <t t-call="website_forum.vote">
- <t t-set="post" t-value="question"/>
- </t>
- <div class="text-muted text-center">
- <span t-field="question.views"/> Views
- </div>
- <div class="mt4">
- <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
- t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
- </div>
- </div>
+ </li>
+ <li t-if="question.state == 'close'">
+ <t t-call="website_forum.link_button">
+ <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
+ <t t-set="label" t-value="'Reopen'"/>
+ <t t-set="classes" t-value="'fa-undo'"/>
+ <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
+ </t>
+ </li>
+ <li>
+ <t t-call="website_forum.link_button">
+ <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
+ <t t-set="label" t-value="'Edit'"/>
+ <t t-set="classes" t-value="'fa-edit'"/>
+ <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
+ </t>
+ </li>
+ <li t-if="question.active">
+ <t t-call="website_forum.link_button">
+ <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
+ <t t-set="label" t-value="'Delete'"/>
+ <t t-set="classes" t-value="'fa-trash-o'"/>
+ <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
+ </t>
+ </li>
+ <li t-if="not question.active">
+ <t t-call="website_forum.link_button">
+ <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
+ <t t-set="label" t-value="'Undelete'"/>
+ <t t-set="classes" t-value="'fa-trash-o'"/>
+ <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
+ </t>
+ </li>
+ </ul>
+ <ul class="list-inline mb0">
+ <li t-if="question.post_type == 'question'">
+ <a style="cursor: pointer" t-att-data-toggle="question.can_comment and 'collapse' or ''"
+ t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
+ t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
+ t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
+ Comment
+ </a>
+ </li>
+ </ul>
</div>
+
<t t-call="website_forum.post_comment">
<t t-set="object" t-value="question"/>
</t>
</div>
</div>
- <hr/>
<div t-foreach="question.child_ids" t-as="post_answer" class="mt16 mb32">
+ <hr class="mb4 mt4"/>
<t t-call="website_forum.post_answers">
<t t-set="answer" t-value="post_answer"/>
</t>
</div>
- <div t-if="question.type != 'question' or question.type == 'question' and not question.uid_has_answered and question.state != 'close' and question.active != False">
+ <div t-if="question.post_type != 'question' or question.post_type == 'question' and not question.uid_has_answered and question.state != 'close' and question.active != False">
<t t-call="website_forum.post_answer"/>
</div>
- <div t-if="question.type == 'question' and question.uid_has_answered" class="mb16">
+ <div t-if="question.post_type == 'question' and question.uid_has_answered" class="mb16">
<a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
<span class="text-muted">(only one answer per question is allowed)</span>
</div>
<template id="post_answers">
<a t-attf-id="answer-#{str(answer.id)}"/>
- <div t-attf-class="forum_answer row" t-attf-id="answer_#{answer.id}" >
- <div class="col-md-2 hidden-xs text-center">
+ <div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
+ <div class="pull-left">
<t t-call="website_forum.vote">
<t t-set="post" t-value="answer"/>
+ <div t-if="question.post_type == 'question'" class="mt4">
+ <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
+ t-attf-data-karma="#{answer.karma_accept}"
+ t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
+ </div>
</t>
- <div t-if="question.type == 'question'" class="text-muted mt8">
- <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
- t-attf-data-karma="#{answer.karma_accept}"
- t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
- </div>
</div>
- <div class="col-md-10 clearfix">
- <t t-raw="answer.content"/>
- <div class="mt16">
- <ul class="list-inline pull-right">
- <li t-if="question.type == 'question'">
- <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
- t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
- style="cursor: pointer" t-att-data-toggle="answer.can_comment and 'collapse' or ''"
- t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
- </a>
- </li>
- <li t-if="question.type != 'question' and not answer.parent_id or answer.parent_id and not answer.parent_id.parent_id">
- <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
- t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
- style="cursor: pointer" data-toggle="collapse"
- t-attf-data-target="#reply#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Reply
- </a>
- </li>
+ <div class="question-block">
+ <div class="pull-right author-box">
+ <img class="pull-left img img-rounded img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
+ <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
+ t-field="answer.create_uid"
+ t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
+ style="display: inline-block;"/>
+ <div class="text-muted">On <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></div>
+ </div>
+ <div class="clearfix" t-if="answer.create_uid.karma >= forum.karma_dofollow"><span t-field="answer.content" class="oe_no_empty"/></div>
+ <div class="clearfix" t-if="answer.create_uid.karma < forum.karma_dofollow"><span t-field="answer.content" class="oe_no_empty" t-field-options='{"nofollow": 1}'/></div>
+ <div class="clearfix">
+ <ul class="list-inline pull-right mb0">
<li>
<t t-call="website_forum.link_button">
<t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
<t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
</t>
</li>
- <li t-if="question.type == 'question'">
+ <li t-if="question.post_type == 'question'">
<t t-call="website_forum.link_button">
<t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
<t t-set="label" t-value="'Convert as a comment'"/>
</t>
</li>
</ul>
- <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
- <div>
- <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
- t-field="answer.create_uid"
- t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
- style="display: inline-block;"/>
- <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
- <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
- </div>
- <div class="visible-xs text-center">
- <t t-call="website_forum.vote">
- <t t-set="post" t-value="answer"/>
- </t>
- <div class="text-muted mt8">
- <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
- t-attf-data-karma="#{answer.karma_accept}"
- t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
- </div>
- </div>
+ <ul class="list-inline mb0">
+ <li t-if="question.post_type == 'question'">
+ <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
+ t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
+ style="cursor: pointer" t-att-data-toggle="answer.can_comment and 'collapse' or ''"
+ t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
+ </a>
+ </li>
+ <li t-if="question.post_type != 'question'">
+ <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
+ t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
+ style="cursor: pointer" data-toggle="collapse"
+ t-attf-data-target="#reply#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Reply
+ </a>
+ </li>
+ </ul>
+
</div>
- <t t-if="answer.type == 'question'" t-call="website_forum.post_comment">
+ <hr class="mt4 mb4"/>
+
+ <t t-if="answer.post_type == 'question'" t-call="website_forum.post_comment">
<t t-set="object" t-value="answer"/>
</t>
- <div t-if="answer.type != 'question' and question.state != 'close' and question.active != False">
+ <div t-if="answer.post_type != 'question' and question.state != 'close' and question.active != False">
<t t-call="website_forum.post_reply">
<t t-set="object" t-value="answer"/>
</t>
</div>
- <div t-foreach="answer.child_ids" t-as="child_answer" class="mt16 mb16">
+ <div t-foreach="answer.child_ids" t-as="child_answer" class="mt4 mb4">
<t t-call="website_forum.post_answers">
<t t-set="answer" t-value="child_answer"/>
</t>
<t t-set="classes" t-value="'close comment_delete fa-times'"/>
</t>
- <span t-field="message.body"/>
+ <div t-if="message.create_uid.karma >= forum.karma_dofollow"><span t-field="message.body" class="oe_no_empty"/></div>
+ <div t-if="message.create_uid.karma < forum.karma_dofollow"><span t-field="message.body" class="oe_no_empty" t-field-options='{"nofollow": 1}'/></div>
<t t-set="required_karma" t-value="message.author_id.id == user.partner_id.id and object.forum_id.karma_comment_convert_own or object.forum_id.karma_comment_convert_all"/>
<t t-if="(object.parent_id and object.parent_id.state != 'close' and object.parent_id.active != False) or (not object.parent_id and object.state != 'close' and object.active != False)">
<t t-set="allow_post_comment" t-value="True" />
</tr>
</table>
<div class="well well-sm">
- <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
+ <div t-if="user.karma >= forum.karma_dofollow"><span t-field="user.partner_id.website_description" class="oe_no_empty"/></div>
+ <div t-if="user.karma < forum.karma_dofollow"><span t-field="user.partner_id.website_description" class="oe_no_empty" t-field-options='{"nofollow": 1}'/></div>
<t t-if="uid == user.id">
<a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
</t>