<commit_before><?xml version="1.0" encoding="utf-8"?>
<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">
        <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_frontend" inherit_id="website.assets_frontend" name="Forum Assets">
    <xpath expr="." position="inside">
        <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"/>

        <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="/website_forum/static/src/js/website_forum.share.js"/>
        <script type="text/javascript" src="/website_forum/static/src/js/website_tour_forum_question.js"/>
        <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
    </xpath>
</template>

<!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.footer_default"
    name="Footer Questions Link">
    <xpath expr="//ul[@id='products']" position="inside">
        <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&amp;A</a></li>
        <li><a href="/forum">Forums</a></li>
    </xpath>
</template>

<!-- helper -->
<template id="link_button">
    <form method="POST" t-att-action="url">
        <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
            <t t-esc="label"/></button>
    </form>
</template>

<!-- Page Index -->
<template id="header" name="Forum Index">
    <t t-call="website.layout">
        <div t-if="is_public_user and not forum_welcome_message" class="forum_intro">
            <div t-field="forum.welcome_message"/>
        </div>

        <div class="container mt16 website_forum">
            <div class="navbar navbar-default">
                <div class="navbar-header">
                    <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>
                    </button>
                    <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
                        <span t-field="forum.name"/>
                    </a>
                </div>
                <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
                    <ul class="nav navbar-nav">
                        <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>
                        <li t-att-class="searches.get('tags') and 'active' or '' ">
                            <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
                        </li>
                        <li t-att-class="searches.get('badges') and 'active' or '' ">
                            <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
                        </li>
                        <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
                            <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">
                                <span t-field="user.name"/> (k: <t t-esc="user.karma"/>)
                            </a>
                        </li>
                    </ul>
                    <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
                        <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>
                        <span class="dropdown" groups="base.group_erp_manager">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
                                <i class="fa fa-cog"/>
                            </button>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                                <li role="presentation"><a role="menuitem" tabindex="-1" t-attf-href="/forum/#{slug(forum)}/edit_welcome_message?enable_editor=1">Design Welcome Message</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" t-attf-href="/web#id=#{forum.id}&amp;view_type=form&amp;model=forum.forum">Forum Settings</a></li>
                            </ul>
                        </span>
                    </form>
                </div>
            </div>
        </div>

        <div id="wrap" class="container">
            <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">&amp;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">&amp;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">&amp;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 &lt; forum.karma_ask) and not is_public_user and 'karma_required' or ''}" t-attf-data-karma="#{forum.karma_ask}">
                        <t t-set="multi_type" t-value="(forum.allow_link and forum.allow_question) or (forum.allow_link and forum.allow_discussion) or (forum.allow_question and forum.allow_discussion)"/>
                        <a type="button"  t-attf-class="btn btn-primary btn-lg #{'col-sm-10' if multi_type else 'col-sm-12'}" 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>
                        <t t-if="multi_type">
                            <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_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>
                        </t>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">Keep Informed</h3>
                        </div>
                        <div class="panel-body">
                            <t t-call="website_mail.follow">
                                <t t-set="email" t-value="user.email"/>
                                <t t-set="object" t-value="forum"/>
                            </t>
                        </div>
                    </div>
                    <div class="panel panel-default" id="about_forum">
                        <div class="panel-heading">
                            <h3 class="panel-title">About This Community</h3>
                        </div>
                        <div class="panel-body">
                            <span t-field="forum.description"/>
                            <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
                            <a t-if="header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}" class="fa fa-arrow-right"> Back to <span t-field="forum.name"/></a>
                        </div>
                    </div>
                    <div t-if="header.get('question_data')">
                        <div class="panel panel-default">
                            <div class="panel-heading text-center">
                                <h3 class="panel-title">Question tools</h3>
                            </div>
                            <div class="panel-body text-center">
                                <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
                                <div class="mt8">
                                    <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
                                </div>
                            </div>
                            <div class="panel-heading text-center">
                                <h3 class="panel-title ">Stats</h3>
                            </div>
                            <div class="panel-body">
                                <table class="table">
                                    <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
                                    <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
                                        <span t-if="question.views&gt;1">times</span>
                                        <span t-if="question.views&lt;=1">time</span>
                                    </td></tr>
                                    <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="oe_structure"/>
    </t>
</template>

<!-- Template use to edit the welcome_message -->
<template id="edit_welcome_message">
    <t t-call="website.layout">
        <div t-field="forum.welcome_message"/>
    </t>
</template>

<!-- Display a post -->
<template id="display_post">
    <div class="question">
        <div class="pull-left">
            <t t-call="website_forum.vote">
                <t t-set="post" t-value="question"/>
            </t>
        </div>
        <div class="question-block">
            <div class="question-name">
                <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">
                    <span t-field="question.name"/>
                </a>
                <span t-if="not question.active"><b> [Deleted]</b></span>
                <span t-if="question.state == 'close'"><b> [Closed]</b></span>
                <t t-if="question.post_type == 'link'" >
                    <a title="Redirect to external link" t-att-href="question.content_link" class="text-muted"><i class="fa fa-external-link forum_link"/></a>
                </t>
                <span t-if="question.has_validated_answer" title="Question has accepted answer"><i class="fa fa-check-circle oe_answer_true"/></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 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>
            <small class="text-muted">
                <i t-if="question.post_type == 'question'" t-attf-class="fa fa-question-circle" t-att-title="question.post_type.capitalize()" />
                <i t-if="question.post_type == 'discussion'" t-attf-class="fa fa-comments-o" t-att-title="question.post_type.capitalize()" />
                <i t-if="question.post_type == 'link'" t-attf-class="fa fa-link" t-att-title="question.post_type.capitalize()" />
                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"}'/>
                • <span t-field="question.views" /> View<t t-if="question.views&gt;1">s</t>
                • <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">

                    <t t-esc="question.child_count"/>
                    <t t-if="question.post_type == 'question'">
                        Answer<t t-if="question.child_count&gt;1">s</t>
                    </t>
                    <t t-if="question.post_type != 'question'">
                        Comment<t t-if="question.child_count&gt;1">s</t>
                    </t>
                </a>
            </small>
        </div>
    </div>
</template>

<!-- Display a post as an answer -->
<template id="display_post_answer">
    <div class="clearfix">
        <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;">
            <a style="font-size: 15px;" t-attf-href="/forum/#{ slug(forum) }/question/#{ answer.parent_id.id }/#answer-#{ answer.id }" t-esc="answer.parent_id.name"/>
            <t t-if="len(answer.website_message_ids)&gt;0">
                (<t t-esc="len(answer.website_message_ids)"/>
                <t t-if="len(answer.website_message_ids)&gt;1">Comments</t>
                <t t-if="len(answer.website_message_ids)&lt;=1">Comment</t>)
            </t>
        </div>
    </div>
</template>

<!-- FAQ Layout -->
<template id="faq">
    <t t-call="website_forum.header">
        <div t-field="forum.faq"/>
        <table class="table table-striped">
            <tbody>
                <tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_upvote"/></td>
                    <td>upvote, add comments</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_downvote"/></td>
                    <td>downvote</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_editor"/></td>
                    <td>insert text link, upload files</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_comment_unlink_own"/></td>
                    <td>delete own comment</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_close_own"/></td>
                    <td>flag offensive, close own questions</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_edit_all"/></td>
                    <td>edit any post, view offensive flags</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_answer_accept_all"/></td>
                    <td>accept any answer</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_comment_unlink_all"/></td>
                    <td>delete any comment</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_close_all"/></td>
                    <td>close any posts</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_unlink_all"/></td>
                    <td>delete any question or answer</td>
                </tr>
            </tbody>
        </table>
    </t>
</template>

<!-- All Forums Layout -->
<template id="forum_all">
    <t t-call="website.layout">
        <div class="container">
            <h1 class="mb32">Our forums</h1>
            <div class="row">
                <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
                    <a t-attf-href="/forum/#{ slug(forum) }">
                        <div class="fa fa-5x fa-comment mb16"/>
                        <div t-field="forum.name"/>
                    </a>
                </div>
            </div>
        </div>
    </t>
</template>

<!-- Specific Forum Layout -->
<template id="forum_index" name="Forum">
    <t t-call="website_forum.header">
        <h2 class="page-header mt0">
            <t t-esc="question_count"/>
                <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'">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">
                  <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 == '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">
                  <li class="dropdown-header">Filter on</li>
                  <li t-att-class="filters == 'all' and 'active' or '' ">
                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
                  </li>
                  <li t-att-class="filters == 'unanswered' and 'active' or '' ">
                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
                  </li>
                  <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 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>
                  <li class="dropdown-header">Sort by</li>
                  <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 == '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 == '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_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>
        </h2>
        <div t-foreach="question_ids" t-as="question" class="mb16">
            <t t-call="website_forum.display_post"/>
        </div>
        <t t-call="website.pager"/>
    </t>
</template>

<template id="404">
    <t t-call="website_forum.header">
        <div class="oe_structure oe_empty"/>
        <h1 class="mt32">Question not found!</h1>
        <p>Sorry, this question is not available anymore.</p>
        <p>
            <a t-attf-href="/forum">Return to the question list.</a>
        </p>
    </t>
</template>

<!-- Edition: Post Article -->
<template id="new_link">
    <t t-call="website_forum.header">
        <t t-set="link_create" t-value="False if post_name else True"/>
        <t t-if="link_create">
            <h1 class="mt0" >Submit a Link</h1>
            <t t-set ="action_url" t-value="'/forum/' + slug(forum) +'/new?post_type=link'"/>
        </t>
        <t t-if="not link_create">
            <h1 class="mt0" t-if="not link_create">Edit your Link</h1>
            <t t-set ="action_url" t-value="'/forum/' + slug(forum) +'/post/' + slug(post) + '/save'"/>
        </t>
        <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, around 20% of the submited
            posts will be featured.
        </p>
        <form t-att-action="action_url" method="post" role="form" class="post_link tag_text form-horizontal">
            <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"/>
            <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="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="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="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/><commit_msg>[FIX] website_forum : clean template by removing useless contruction.<commit_after><?xml version="1.0" encoding="utf-8"?>
<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">
        <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_frontend" inherit_id="website.assets_frontend" name="Forum Assets">
    <xpath expr="." position="inside">
        <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"/>

        <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="/website_forum/static/src/js/website_forum.share.js"/>
        <script type="text/javascript" src="/website_forum/static/src/js/website_tour_forum_question.js"/>
        <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
    </xpath>
</template>

<!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.footer_default"
    name="Footer Questions Link">
    <xpath expr="//ul[@id='products']" position="inside">
        <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&amp;A</a></li>
        <li><a href="/forum">Forums</a></li>
    </xpath>
</template>

<!-- helper -->
<template id="link_button">
    <form method="POST" t-att-action="url">
        <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
            <t t-esc="label"/></button>
    </form>
</template>

<!-- Page Index -->
<template id="header" name="Forum Index">
    <t t-call="website.layout">
        <div t-if="is_public_user and not forum_welcome_message" class="forum_intro">
            <div t-field="forum.welcome_message"/>
        </div>

        <div class="container mt16 website_forum">
            <div class="navbar navbar-default">
                <div class="navbar-header">
                    <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>
                    </button>
                    <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
                        <span t-field="forum.<EMAIL>"/>
                    </a>
                </div>
                <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
                    <ul class="nav navbar-nav">
                        <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>
                        <li t-att-class="searches.get('tags') and 'active' or '' ">
                            <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
                        </li>
                        <li t-att-class="searches.get('badges') and 'active' or '' ">
                            <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
                        </li>
                        <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
                            <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">
                                <span t-field="user.name"/> (k: <t t-esc="user.karma"/>)
                            </a>
                        </li>
                    </ul>
                    <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
                        <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>
                        <span class="dropdown" groups="base.group_erp_manager">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
                                <i class="fa fa-cog"/>
                            </button>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                                <li role="presentation"><a role="menuitem" tabindex="-1" t-attf-href="/forum/#{slug(forum)}/edit_welcome_message?enable_editor=1">Design Welcome Message</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" t-attf-href="/web#id=#{forum.id}&amp;view_type=form&amp;model=forum.forum">Forum Settings</a></li>
                            </ul>
                        </span>
                    </form>
                </div>
            </div>
        </div>

        <div id="wrap" class="container">
            <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">&amp;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">&amp;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">&amp;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 &lt; forum.karma_ask) and not is_public_user and 'karma_required' or ''}" t-attf-data-karma="#{forum.karma_ask}">
                        <t t-set="multi_type" t-value="(forum.allow_link and forum.allow_question) or (forum.allow_link and forum.allow_discussion) or (forum.allow_question and forum.allow_discussion)"/>
                        <a type="button"  t-attf-class="btn btn-primary btn-lg #{'col-sm-10' if multi_type else 'col-sm-12'}" 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>
                        <t t-if="multi_type">
                            <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_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>
                        </t>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">Keep Informed</h3>
                        </div>
                        <div class="panel-body">
                            <t t-call="website_mail.follow">
                                <t t-set="email" t-value="user.email"/>
                                <t t-set="object" t-value="forum"/>
                            </t>
                        </div>
                    </div>
                    <div class="panel panel-default" id="about_forum">
                        <div class="panel-heading">
                            <h3 class="panel-title">About This Community</h3>
                        </div>
                        <div class="panel-body">
                            <span t-field="forum.description"/>
                            <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
                            <a t-if="header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}" class="fa fa-arrow-right"> Back to <span t-field="forum.name"/></a>
                        </div>
                    </div>
                    <div t-if="header.get('question_data')">
                        <div class="panel panel-default">
                            <div class="panel-heading text-center">
                                <h3 class="panel-title">Question tools</h3>
                            </div>
                            <div class="panel-body text-center">
                                <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
                                <div class="mt8">
                                    <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
                                </div>
                            </div>
                            <div class="panel-heading text-center">
                                <h3 class="panel-title ">Stats</h3>
                            </div>
                            <div class="panel-body">
                                <table class="table">
                                    <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
                                    <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
                                        <span t-if="question.views&gt;1">times</span>
                                        <span t-if="question.views&lt;=1">time</span>
                                    </td></tr>
                                    <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="oe_structure"/>
    </t>
</template>

<!-- Template use to edit the welcome_message -->
<template id="edit_welcome_message">
    <t t-call="website.layout">
        <div t-field="forum.welcome_message"/>
    </t>
</template>

<!-- Display a post -->
<template id="display_post">
    <div class="question">
        <div class="pull-left">
            <t t-call="website_forum.vote">
                <t t-set="post" t-value="question"/>
            </t>
        </div>
        <div class="question-block">
            <div class="question-name">
                <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">
                    <span t-field="question.name"/>
                </a>
                <span t-if="not question.active"><b> [Deleted]</b></span>
                <span t-if="question.state == 'close'"><b> [Closed]</b></span>
                <t t-if="question.post_type == 'link'" >
                    <a title="Redirect to external link" t-att-href="question.content_link" class="text-muted"><i class="fa fa-external-link forum_link"/></a>
                </t>
                <span t-if="question.has_validated_answer" title="Question has accepted answer"><i class="fa fa-check-circle oe_answer_true"/></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 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>
            <small class="text-muted">
                <i t-if="question.post_type == 'question'" t-attf-class="fa fa-question-circle" t-att-title="question.post_type.capitalize()" />
                <i t-if="question.post_type == 'discussion'" t-attf-class="fa fa-comments-o" t-att-title="question.post_type.capitalize()" />
                <i t-if="question.post_type == 'link'" t-attf-class="fa fa-link" t-att-title="question.post_type.capitalize()" />
                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"}'/>
                • <span t-field="question.views" /> View<t t-if="question.views&gt;1">s</t>
                • <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">

                    <t t-esc="question.child_count"/>
                    <t t-if="question.post_type == 'question'">
                        Answer<t t-if="question.child_count&gt;1">s</t>
                    </t>
                    <t t-if="question.post_type != 'question'">
                        Comment<t t-if="question.child_count&gt;1">s</t>
                    </t>
                </a>
            </small>
        </div>
    </div>
</template>

<!-- Display a post as an answer -->
<template id="display_post_answer">
    <div class="clearfix">
        <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;">
            <a style="font-size: 15px;" t-attf-href="/forum/#{ slug(forum) }/question/#{ answer.parent_id.id }/#answer-#{ answer.id }" t-esc="answer.parent_id.name"/>
            <t t-if="len(answer.website_message_ids)&gt;0">
                (<t t-esc="len(answer.website_message_ids)"/>
                <t t-if="len(answer.website_message_ids)&gt;1">Comments</t>
                <t t-if="len(answer.website_message_ids)&lt;=1">Comment</t>)
            </t>
        </div>
    </div>
</template>

<!-- FAQ Layout -->
<template id="faq">
    <t t-call="website_forum.header">
        <div t-field="forum.faq"/>
        <table class="table table-striped">
            <tbody>
                <tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_upvote"/></td>
                    <td>upvote, add comments</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_downvote"/></td>
                    <td>downvote</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_editor"/></td>
                    <td>insert text link, upload files</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_comment_unlink_own"/></td>
                    <td>delete own comment</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_close_own"/></td>
                    <td>flag offensive, close own questions</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_edit_all"/></td>
                    <td>edit any post, view offensive flags</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_answer_accept_all"/></td>
                    <td>accept any answer</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_comment_unlink_all"/></td>
                    <td>delete any comment</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_close_all"/></td>
                    <td>close any posts</td>
                </tr><tr>
                    <td class="faq-rep-item"><strong t-field="forum.karma_unlink_all"/></td>
                    <td>delete any question or answer</td>
                </tr>
            </tbody>
        </table>
    </t>
</template>

<!-- All Forums Layout -->
<template id="forum_all">
    <t t-call="website.layout">
        <div class="container">
            <h1 class="mb32">Our forums</h1>
            <div class="row">
                <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
                    <a t-attf-href="/forum/#{ slug(forum) }">
                        <div class="fa fa-5x fa-comment mb16"/>
                        <div t-field="forum.name"/>
                    </a>
                </div>
            </div>
        </div>
    </t>
</template>

<!-- Specific Forum Layout -->
<template id="forum_index" name="Forum">
    <t t-call="website_forum.header">
        <h2 class="page-header mt0">
            <t t-esc="question_count"/>
                <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'">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">
                  <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 == '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">
                  <li class="dropdown-header">Filter on</li>
                  <li t-att-class="filters == 'all' and 'active' or '' ">
                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
                  </li>
                  <li t-att-class="filters == 'unanswered' and 'active' or '' ">
                      <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
                  </li>
                  <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 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>
                  <li class="dropdown-header">Sort by</li>
                  <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 == '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 == '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_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>
        </h2>
        <div t-foreach="question_ids" t-as="question" class="mb16">
            <t t-call="website_forum.display_post"/>
        </div>
        <t t-call="website.pager"/>
    </t>
</template>

<template id="404">
    <t t-call="website_forum.header">
        <div class="oe_structure oe_empty"/>
        <h1 class="mt32">Question not found!</h1>
        <p>Sorry, this question is not available anymore.</p>
        <p>
            <a t-attf-href="/forum">Return to the question list.</a>
        </p>
    </t>
</template>

<!-- Edition: Post Article -->
<template id="new_link">
    <t t-call="website_forum.header">
        <t t-if="not post_name">
            <h1 class="mt0" >Submit a Link</h1>
            <t t-set ="action_url" t-value="'/forum/' + slug(forum) +'/new?post_type=link'"/>
        </t>
        <t t-if="post_name">
            <h1 class="mt0">Edit your Link</h1>
            <t t-set ="action_url" t-value="'/forum/' + slug(forum) +'/post/' + slug(post) + '/save'"/>
        </t>
        <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, around 20% of the submited
            posts will be featured.
        </p>
        <form t-att-action="action_url" method="post" role="form" class="tag_text form-horizontal">
            <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"/>
            <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="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="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="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
{'fraction_non_alphanumeric': 0.17110229548605763, 'fraction_numerical': 0.0035818826066861807, 'mean_word_length': 1.65730222085764, 'pattern_counts': {'":': 12, '<': 1187, '<?xml version=': 2, '>': 1187, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1778902', 'n_tokens_mistral': 15975, 'n_tokens_neox': 14922, 'n_words': 2810}