[MERGE] forward port of branch 8.0 up to 262eb66
[odoo/odoo.git] / addons / website_forum / views / website_forum.xml
index 9fbd27e..5372f84 100644 (file)
@@ -2,6 +2,28 @@
 <openerp>
     <data>
 
+<!-- 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'/>
+
+    <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>
+</template>
+
 <!-- Layout add nav and footer -->
 <template id="header_footer_custom" inherit_id="website.footer_default"
     name="Footer Questions Link">
     </form>
 </template>
 
-<template id="assets_frontend" inherit_id="website.assets_frontend" name="website_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"/>
-    </xpath>
-</template>
-
-<template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor" groups="base.group_user">
-    <xpath expr="." position="inside">
-        <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>
-
 <!-- Page Index -->
 <template id="header" name="Forum Index">
     <t t-call="website.layout">
         <t t-set="head">
-            <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>
+            <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"/>
+                <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>
+        </div>
         <div class="container mt16 website_forum">
             <div class="navbar navbar-default">
                 <div class="navbar-header">
                 </div>
                 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
                     <ul class="nav navbar-nav">
-                        <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
-                            <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
+                        <li t-att-class="sorting == 'relevancy desc' and 'active' or '' ">
+                            <a t-attf-href="/forum/#{ slug(forum) }?{{ keep_query( 'search', 'post_type', 'filters', sorting='relevancy desc') }}">Trending</a>
+                        </li>
+                        <li t-att-class="sorting == 'create_date desc' and 'active' or '' ">
+                            <a t-attf-href="/forum/#{ slug(forum) }?{{ keep_query( 'search', 'post_type', 'filters', sorting='create_date desc') }}">Newest</a>
                         </li>
                         <li t-att-class="searches.get('users') and 'active' or '' ">
                             <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
                         </li>
                     </ul>
                     <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
-                        <div class="form-group">
-                            <input type="search" class="form-control"
-                                name="search" placeholder="Search a question..."
-                                t-att-value="search or ''"/>
-                            <button type="submit" class="btn btn-default">Search</button>
+                        <div class="input-group">
+                            <input type="search" class="form-control" name="search" t-att-value="search or ''"/>
+                            <span class="input-group-btn">
+                                <button type="submit" class="btn btn-default">Search</button>
+                            </span>
                         </div>
                     </form>
                 </div>
                     <t t-raw="0"/>
                 </div>
                 <div class="col-sm-3" id="right-column">
-                    <a t-if="not header.get('ask_hide')"
-                       t-attf-class="btn btn-primary btn-lg btn-block mb16 #{user.karma &gt;= forum.karma_ask and '' or 'karma_required'}"
-                       t-attf-href="/forum/#{slug(forum)}/ask"
-                       t-attf-data-karma="#{forum.karma_ask}">Ask a Question</a>
+                    <div t-if="not header.get('ask_hide')" t-attf-class="btn-group btn-block mb16 #{user.karma &gt;= 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>
+                        </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>
+                        </ul>
+                    </div>
                     <div class="panel panel-default">
                         <div class="panel-heading">
                             <h3 class="panel-title">Keep Informed</h3>
                     </div>
                     <div class="panel panel-default" id="about_forum">
                         <div class="panel-heading">
-                            <h3 class="panel-title">About This Forum</h3>
+                            <h3 class="panel-title">About This Community</h3>
                         </div>
                         <div class="panel-body">
                             <t t-raw="forum.description"/>
 <template id="display_post">
     <div class="question row">
         <div class="col-md-2 hidden-xs text-center">
-            <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
-                <span t-esc="question.child_count"/>
-                <div t-if="question.child_count&gt;1" class="subtitle">Answers</div>
-                <div t-if="question.child_count&lt;=1" class="subtitle">Answer</div>
-            </div>
+            <t t-call="website_forum.vote">
+                <t t-set="post" t-value="question"/>
+            </t>
         </div>
         <div class="col-md-10 clearfix">
             <div class="question-name">
-                <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
-                    <span t-if="not question.active"><b> [Deleted]</b></span>
-                    <span t-if="question.state == 'close'"><b> [Closed]</b></span>
+                <t t-if="question.type == 'link'">
+                    <a t-att-href="question.content_link" t-raw="question.name"/>
+                </t>
+                <t t-if="question.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>
             </div>
             <t t-foreach="question.tag_ids" t-as="question_tag">
                 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
-                    <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
+                    <span t-attf-class="pull-right label #{tag and tag.name == question_tag.name and 'label-primary' or 'label-default'}" t-field="question_tag.name"
                         style="margin-right: 4px;"/>
                 </a>
             </t>
-            <div class="text-muted">
-                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.write_date" t-field-options='{"format":"short"}'/>
-                <span class="visible-xs">
-                    <b t-esc="question.child_count or 0"/>
-                    <t t-if="question.child_count&gt;1">answers</t>
-                    <t t-if="question.child_count==1">answers</t>
-                </span>
-                with <b t-field="question.views"/> views
-                <span t-if="question.vote_count&gt;0"> and
-                    <b t-esc="question.vote_count or 0"/>
-                    <t t-if="question.vote_count&gt;1">votes</t>
-                    <t t-if="question.vote_count==1">vote</t>
-                </span>
-            </div>
+            <small class="text-muted">
+                By <span t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}' style="display: inline-block;"/>
+                • <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
+                • <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">
+                    <t t-esc="question.child_count"/>
+                    <t t-if="question.child_count&gt;1">comments</t>
+                    <t t-if="question.child_count&lt;=1">comment</t>
+                </a>
+            </small>
         </div>
     </div>
 </template>
 <!-- Specific Forum Layout -->
 <template id="forum_index" name="Forum">
     <t t-call="website_forum.header">
-        <h1 class="page-header mt0">
-            <t t-esc="question_count"/> <span>Questions</span>
+        <h2 class="page-header mt0">
+            <t t-esc="question_count"/>
+                <span t-if="post_type == 'all'">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>
             <t t-esc="search"/>
             <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
               <a href="#" class="dropdown-toggle" data-toggle="dropdown">
-                  <t t-if="filters == 'all'">All</t>
                   <t t-if="filters == 'unanswered'">Unanswered</t>
                   <t t-if="filters == 'followed'">Followed</t>
                   <t t-if="tag"><span t-field="tag.name"/></t>
-                  <t t-if="sorting == 'date'"> by activity date</t>
-                  <t t-if="sorting == 'creation'"> by creation date</t>
-                  <t t-if="sorting == 'answered'"> by most answered</t>
-                  <t t-if="sorting == 'vote'"> by most voted</t>
+                  <t t-if="sorting == 'relevancy desc'"> by relevancy</t>
+                  <t t-if="sorting == 'write_date desc'"> by activity date</t>
+                  <t t-if="sorting == 'create_date desc'"> by newest</t>
+                  <t t-if="sorting == 'child_count desc'"> by most answered</t>
+                  <t t-if="sorting == 'vote_count desc'"> by most voted</t>
                   <b class="caret"/>
               </a>
               <ul class="dropdown-menu">
                       <a href=""><t t-esc="tag.name"/></a>
                   </li>
                   <li class="dropdown-header">Sort by</li>
-                  <li t-att-class="sorting == 'date' and 'active' or '' ">
-                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
+                  <li t-att-class="sorting == 'relevancy desc' and 'active' or '' ">
+                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='relevancy desc')">Relevancy</a>
+                  </li>
+                  <li t-att-class="sorting == 'write_date desc' and 'active' or '' ">
+                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='write_date desc')">Last activity date</a>
                   </li>
-                  <li t-att-class="sorting == 'creation' and 'active' or '' ">
-                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
+                  <li t-att-class="sorting == 'create_date desc' and 'active' or '' ">
+                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='create_date desc')">Newest</a>
                   </li>
-                  <li t-att-class="sorting == 'answered' and 'active' or '' ">
-                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
+                  <li t-att-class="sorting == 'child_count desc' and 'active' or '' ">
+                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='child_count desc')">Most answered</a>
                   </li>
-                  <li t-att-class="sorting == 'vote' and 'active' or '' ">
-                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
+                  <li t-att-class="sorting == 'vote_count desc' and 'active' or '' ">
+                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote_count desc')">Most voted</a>
                   </li>
               </ul>
             </small>
-        </h1>
+        </h2>
         <div t-foreach="question_ids" t-as="question" class="mb16">
             <t t-call="website_forum.display_post"/>
         </div>
     </t>
 </template>
 
+<!-- Edition: Post Article -->
+<template id="post_link">
+    <t t-call="website_forum.header">
+        <h1 class="mt0">Submit a Link</h1>
+        <p class="mb32">
+            Share an awesome link. Your post will appear in the 'Newest' top-menu.
+            If the community vote on your post, it will get traction by being promoted
+            in the homepage.
+        </p><p>
+            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">
+            <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>
+                <div class="col-sm-8">
+                    <input type="text" name="post_name" required="True" t-attf-value="#{post_name}"
+                        class="form-control mb16 link_url" placeholder="e.g. https://www.odoo.com"/>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-2 control-label" for="post_name">Post Title</label>
+                <div class="col-sm-8">
+                    <input type="text" name="content" readonly="True" required="True" t-attf-value="#{content}"
+                        class="form-control"/>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-2 control-label" for="post_tags">Tags</label>
+                <div class="col-sm-8">
+                    <input type="text" name="post_tags" readonly="True" class="form-control load_tags"/>
+                </div>
+            </div>
+            <div class="form-group">
+                <div class="col-sm-offset-2 col-sm-8">
+                    <button class="btn btn-primary" disabled="True" id="btn_post_your_article">Post Your Article</button>
+                </div>
+            </div>
+        </form>
+    </t>
+</template>
+
+<!-- Edition: Post your Discussion Topic -->
+<template id="post_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">
+            <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 name="content" id="content" required="True" 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 class="btn btn-primary" id="btn_ask_your_question">Post Your Topic</button>
+        </form>
+    </t>
+</template>
+
 <!-- Edition: ask your question -->
 <template id="ask_question">
     <t t-call="website_forum.header">
-        <h1 class="mt0">Ask your Question</h1>
+        <h1 class="mt0">Ask Your Question</h1>
+        <p>
+            To improve your chance getting an answer:
+        </p>
         <ul>
-            <li> please, try to make your question interesting to others </li>
-            <li> provide enough details and, if possible, give an example </li>
-            <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
+            <li>Set a clear, explicit and concise question title
+                (check
+                <a href="#" data-placement="top" data-toggle="popover" data-content="Inventory Date Problem, Task remaining hours, Can you help solve solve my tax computation problem in Canada?" title="Click to get bad question samples">bad examples</a>
+                and
+                <a href="#" data-placement="bottom" data-toggle="popover" data-content="How to create a physical inventory at an anterior date?, How is the 'remaining hours' field computed on tasks?, How to configure TPS and TVQ's canadian taxes?" title="Click to get good question titles">good examples</a>
+                ),
+            </li>
+            <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">
-            <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
-                class="form-control" placeholder="Enter your Question"/>
-            <h5 class="mt20">Please enter a descriptive question (should finish with a '?')</h5>
+            <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" class="form-control load_editor">
+            <textarea name="content" required="True" id="content" class="form-control load_editor">
                 <t t-esc="question_content"/>
             </textarea>
             <br/>
-            <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
+            <input type="text" name="post_tags" placeholder="Tags" class="form-control load_tags"/>
             <br/>
             <button t-attf-class="btn btn-primary #{(user.karma &lt;= forum.karma_ask) and 'karma_required' or ''}"
                 id="btn_ask_your_question" t-att-data-karma="forum.karma_ask">Post Your Question</button>
         </form>
-        <script type="text/javascript">
-            CKEDITOR.replace("content");
-        </script>
     </t>
 </template>
 
 <!-- Edition: edit a post -->
 <template id="edit_post">
     <t t-call="website_forum.header">
-        <h3 t-if="not is_answer">Edit question</h3>
-        <h3 t-if="is_answer">Edit answer</h3>
+        <h3 t-if="not is_answer">Edit <span t-field="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="question_name" id="question_name" required="True"
-                    t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
-                <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
+                <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>
             </div>
             <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
-            <textarea name="content" required="True" class="form-control load_editor">
+            <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="question_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 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
                 <br/>
             </div>
             <button class="btn btn-primary btn-lg">Save</button>
         </form>
-        <script type="text/javascript">
-            CKEDITOR.replace("content");
-        </script>
     </t>
 </template>
 
-<!-- Moderation: close a question -->
-<template id="close_question">
+<!-- Moderation: close a post -->
+<template id="close_post">
     <t t-call="website_forum.header">
-        <h1 class="mt0">Close question</h1>
+        <h1 class="mt0">Close Post</h1>
         <p class="text-muted">
-            If you close this question, it will be hidden for most users. Only
-            users having a high karma can see closed questions to moderate
+            If you close this post, it will be hidden for most users. Only
+            users having a high karma can see closed posts to moderate
             them.
         </p>
         <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
             <input name="post_id" t-att-value="question.id" type="hidden"/>
             <div class="form-group">
-                <label class="col-md-3 control-label" for="reason">Question:</label>
+                <label class="col-md-3 control-label" for="reason">Post:</label>
                 <div class="col-md-8 mt8">
                     <span t-field="question.name"/>
                 </div>
             </div>
             <div class="form-group">
                 <div class="col-md-offset-3 col-md-8">
-                    <button class="btn btn-primary">Close question</button>
+                    <button class="btn btn-primary">Close post</button>
                     <span class="text-muted">or</span>
-                    <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
+                    <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to post</a>
                 </div>
             </div>
         </form>
     </t>
 </template>
 
+<!-- Edition: post a reply -->
+<template id="post_reply">
+    <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>
+            <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>
+        </form>
+    </div>
+</template>
+
 <!-- Edition: post an answer -->
 <template id="post_answer">
-    <h3 class="mt10">Your answer</h3>
-    <p>
+    <h3 class="mt10">Your Reply</h3>
+    <p t-if="question.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>
         - it really helps to select the best questions and answers!
     </p>
-    <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
+    <form t-attf-action="/forum/#{ slug(forum) }/#{slug(question)}/reply" method="post" role="form">
         <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
-        <textarea name="content" class="form-control load_editor" required="True"/>
+        <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 Answer</button>
+                id="btn_ask_your_question" t-att-data-karma="question.karma_answer">Post Your Reply</button>
     </form>
-    <script type="text/javascript">
-        CKEDITOR.replace("content");
-    </script>
 </template>
 
 <template id="vote">
 <!-- Specific Post Layout -->
 <template id="post_description_full" name="Question Navigation">
     <t t-call="website_forum.header">
-        <div t-attf-class="row question #{not question.active and 'alert alert-danger' or ''}">
+        <div t-attf-class="row question">
             <div class="col-md-2 hidden-xs text-center">
                 <t t-call="website_forum.vote">
                     <t t-set="post" t-value="question"/>
                         t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
                 </div>
             </div>
-            <div class="col-md-10">
+            <div t-attf-class="col-md-10 #{not question.active and 'alert alert-danger' or ''}">
                 <h1 class="mt0">
-                    <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
+                    <t t-if="question.type == 'link'">
+                        <a t-att-href="question.content_link" t-raw="question.name"/>
+                    </t>
+                    <t t-if="question.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="alert alert-info text-center" t-if="question.state == 'close'">
                     <p class="mt16">
-                        <b>The question 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.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>
-                <t t-raw="question.content"/>
+                <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="badge" t-field="tag.name"/>
+                                <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="label lebel-default" t-field="tag.name"/>
                             </t>
                         </div>
                         <ul class="list-inline" id="options">
-                            <li>
+                            <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}"
             </div>
         </div>
         <hr/>
+        <div t-foreach="question.child_ids" t-as="post_answer" class="mt16 mb32">
+            <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">
+            <t t-call="website_forum.post_answer"/>
+        </div>
+        <div t-if="question.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>
+    </t>
+</template>
 
-        <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
-            <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">
+<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">
+            <t t-call="website_forum.vote">
+                <t t-set="post" t-value="answer"/>
+            </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>
+                    <li>
+                        <t t-call="website_forum.link_button">
+                            <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
+                            <t t-set="label" t-value="'Edit'"/>
+                            <t t-set="classes" t-value="'fa fa-edit'"/>
+                            <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
+                        </t>
+                    </li>
+                    <li>
+                        <t t-call="website_forum.link_button">
+                            <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
+                            <t t-set="label" t-value="'Delete'"/>
+                            <t t-set="classes" t-value="'fa-trash-o'"/>
+                            <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
+                        </t>
+                    </li>
+                    <li t-if="question.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 t-set="classes" t-value="'fa-magic'"/>
+                            <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
+                        </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>
                             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>
-                                <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 t-call="website_forum.link_button">
-                                    <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
-                                    <t t-set="label" t-value="'Edit'"/>
-                                    <t t-set="classes" t-value="'fa fa-edit'"/>
-                                    <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
-                                </t>
-                            </li>
-                            <li>
-                                <t t-call="website_forum.link_button">
-                                    <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
-                                    <t t-set="label" t-value="'Delete'"/>
-                                    <t t-set="classes" t-value="'fa-trash-o'"/>
-                                    <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
-                                </t>
-                            </li>
-                            <li>
-                                <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 t-set="classes" t-value="'fa-magic'"/>
-                                    <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
-                                </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>
-                    </div>
-                    <t t-call="website_forum.post_comment">
-                        <t t-set="object" t-value="answer"/>
-                    </t>
-                </div>
+            </div>
+            <t t-if="answer.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">
+                <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">
+                <t t-call="website_forum.post_answers">
+                    <t t-set="answer" t-value="child_answer"/>
+                </t>
             </div>
         </div>
-        <div t-if="not question.uid_has_answered">
-            <t t-call="website_forum.post_answer"/>
-        </div>
-        <div t-if="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>
-    </t>
+    </div>
 </template>
 
 <!-- Utility template: Post a Comment -->
 
                     <span t-field="message.body"/>
                     <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-call="website_forum.link_button">
-                        <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
-                        <t t-set="label" t-value="'Convert as an answer'"/>
-                        <t t-set="karma" t-value="user.karma&lt;required_karma and required_karma or 0"/>
-                        <t t-set="classes" t-value="'fa-magic pull-right'"/>
+                    <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" />
+                    </t>
+                    <t t-if="allow_post_comment">
+                        <t t-call="website_forum.link_button" >
+                            <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
+                            <t t-set="label" t-value="'Convert as an answer'"/>
+                            <t t-set="karma" t-value="user.karma&lt;required_karma and required_karma or 0"/>
+                            <t t-set="classes" t-value="'fa-magic pull-right'"/>
+                        </t>
                     </t>
                     <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
                         t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
         </p>
         <div class="row">
             <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
-                <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
+                <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="label label-default">
                     <span t-field="tag.name"/>
                 </a>
                 <span>