[MERGE] forward port of branch 8.0 up to 591e329
[odoo/odoo.git] / addons / website_forum / views / website_forum.xml
index dedeb59..9ded2c9 100644 (file)
     </form>
 </template>
 
+        <script type="text/javascript" src="/web/static/lib/select2/select2.js"></script>
+        <link rel="stylesheet" href="/web/static/lib/select2/select2.css"/>
+        <link rel="stylesheet" href="/website/static/lib/select2-bootstrap-css/select2-bootstrap.css"/>
+        <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
 <!-- Page Index -->
 <template id="header" name="Forum Index">
     <t t-call="website.layout">
         <div class="question-block">
             <div class="question-name">
                 <t t-if="question.post_type == 'link'">
-                    <a t-att-href="question.content_link" t-raw="question.name"/>
+                    <a t-att-href="question.content_link" t-raw="question.name" target="_blank"/>
                 </t>
                 <t t-if="question.post_type in ('question', 'discussion')">
                     <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
             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
+            We keep a high level of quality in showcased posts, around 20% of the submited
             posts will be featured.
         </p>
         <form t-attf-action="/forum/#{ slug(forum) }/new?post_type=link" method="post" role="form" class="tag_text form-horizontal">
             <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}"
+                    <input type="text" name="content_link" 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}"
+                    <input type="text" name="post_name" 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 js_select2"/>
+                    <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
+                    <input type="text" name="post_tags" class="form-control js_select2"/>
                 </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>
+                    <button class="btn btn-primary" disabled="True" id="btn_post_your_article">Post</button>
                 </div>
             </div>
         </form>
                 <t t-esc="question_content"/>
             </textarea>
             <br/>
+            <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
             <input type="text" name="post_tags" placeholder="Tags" class="form-control js_select2"/>
             <br/><br/>
             <button class="btn btn-primary">Post Your Topic</button>
             </textarea>
             <div t-if="not is_answer">
                 <br/>
-                <input type="text" name="post_tag" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-value="#{tags}"/>
+                <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
+                <input type="text" name="post_tag" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-data-init-value="#{tags}"/>
                 <br/>
             </div>
             <button class="btn btn-primary btn-lg">Save</button>
                 <div t-if="question.post_type != 'link' and question.create_uid.karma &lt; 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">
+                    <ul class="pull-right list-inline mb0" id="options">
                         <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'"/>