<openerp>
<data>
-<!-- Editor custo -->
-<template id="editor_head" inherit_id="website.editor_head"
- name="Event Editor">
- <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>
-
<!-- Layout add nav and footer -->
-<template id="header_footer_custom" inherit_id="website.layout"
+<template id="header_footer_custom" inherit_id="website.footer_default"
name="Footer Questions Link">
- <xpath expr="//footer//ul[@name='products']" position="inside">
+ <xpath expr="//ul[@id='products']" position="inside">
<li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
<li><a href="/forum">Forums</a></li>
</xpath>
<!-- helper -->
<template id="link_button">
<form method="POST" t-att-action="url">
- <button t-attf-class="fa btn-link #{classes}">
+ <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>
+<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="/web/static/lib/jquery.textext/jquery.textext.js"/>
+ <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"/>
+ </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">
- <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>
</t>
- <div class="container mt16">
+ <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">
<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/#{user.id}">My Profile</a>
+ <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">My Profile</a>
</li>
</ul>
<form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
<div t-field="notification.body"/>
<a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
</div>
+ <div t-if="not validation_email_sent and not is_public_user and user.karma == 0" class="alert alert-danger alert-dismissable">
+ <button type="button" class="close validation_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <div>
+ <p>
+ It appears your email has not been verified.
+ <a class="send_validation_email" href="#" t-att-forum-id="forum.id">Click here to send a verification email allowing you to participate to the forum.</a>
+ </p>
+ </div>
+ </div>
+ <div t-if="validation_email_done" class="alert alert-success alert-dismissable">
+ <button type="button" class="close validated_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
+ <div>
+ <p>Congratulations! Your email has just been validated. You may now participate to our forums.</p>
+ </div>
+ </div>
<t t-raw="0"/>
</div>
<div class="col-sm-3" id="right-column">
- <a t-if="not header.get('ask_hide')" class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{slug(forum)}/ask">Ask a Question</a>
+ <a t-if="not header.get('ask_hide')"
+ t-attf-class="btn btn-primary btn-lg btn-block mb16 #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
+ t-attf-href="/forum/#{slug(forum)}/ask"
+ t-attf-data-karma="#{forum.karma_ask}">Ask a Question</a>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Keep Informed</h3>
<div class="panel-heading text-center">
<h3 class="panel-title ">Stats</h3>
</div>
- <div class="panel-body">
+ <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>
<!-- Display a post -->
<template id="display_post">
- <div class="question clearfix">
- <div class="pull-left text-center">
+ <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>1" class="subtitle">Answers</div>
<div t-if="question.child_count<=1" class="subtitle">Answer</div>
</div>
</div>
- <div style="margin-left: 95px; margin-top:-8px;">
+ <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>
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>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>0"> and
+ <span t-if="question.vote_count>0"> and
<b t-esc="question.vote_count or 0"/>
<t t-if="question.vote_count>1">votes</t>
<t t-if="question.vote_count==1">vote</t>
<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 by a '?')</h5>
+ <h5 class="mt20">Please enter a descriptive question (should finish with a '?')</h5>
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
+ <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
<textarea name="content" required="True" 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="hidden" name="tag_type" value="select2"/>
+ <input type="hidden" name="question_tags" placeholder="Tags" class="form-control js_select2"/>
<br/>
- <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
+ <button t-attf-class="btn btn-primary #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
+ id="btn_ask_your_question" t-att-data-karma="forum.karma_ask">Post Your Question</button>
</form>
<script type="text/javascript">
CKEDITOR.replace("content");
<h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
</div>
<input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
+ <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
<textarea name="content" 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="hidden" name="tag_type" value="select2"/>
+ <input type="hidden" name="question_tag" class="form-control col-md-9 js_select2" placeholder="Tags" value="see data init value" t-attf-data-init-value="#{tags}"/>
<br/>
</div>
<button class="btn btn-primary btn-lg">Save</button>
<form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" 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"/>
- <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
+ <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>
</form>
<script type="text/javascript">
CKEDITOR.replace("content");
<template id="vote">
<div t-attf-class="box oe_grey">
- <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''}"
+ <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''} #{((post.user_vote == 1 and not post.can_downvote) or not post.can_upvote) and 'karma_required' or ''}"
+ t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
<span id="vote_count" t-esc="post.vote_count"/>
- <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''}"
+ <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''} #{((post.user_vote == -1 and not post.can_upvote) or not post.can_downvote) and 'karma_required' or ''}"
+ t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
<div t-if="vote_count > 1" class="subtitle">
votes
<!-- Specific Post Layout -->
<template id="post_description_full" name="Question Navigation">
<t t-call="website_forum.header">
- <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
- <div class="text-center pull-left">
+ <div t-attf-class="row question #{not question.active and 'alert alert-danger' or ''}">
+ <div class="col-md-2 hidden-xs text-center">
<t t-call="website_forum.vote">
<t t-set="post" t-value="question"/>
</t>
t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
</div>
</div>
- <div style="margin-left: 95px;">
+ <div class="col-md-10">
<h1 class="mt0">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
<span t-if="not question.active"><b> [Deleted]</b></span>
style="display: inline-block;"/></b>
</t>
<b>on <span t-field="question.closed_date"/></b>
- <div t-if="question.state == 'close' and user.karma>=500" class="mt16 mb24 text-center">
+ <div class="mt16 mb24 text-center">
<t t-call="website_forum.link_button">
<t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
<t t-set="label" t-value="'Reopen'"/>
<t t-set="classes" t-value="'fa-arrow-right'"/>
+ <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
</t>
</div>
</div>
<t t-raw="question.content"/>
-
<div class="mt16 clearfix">
<div class="pull-right">
<div class="text-right">
</t>
</div>
<ul class="list-inline" id="options">
- <li t-if="user.id == question.create_uid.id or user.karma>=50">
- <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
- t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
+ <li>
+ <a style="cursor: pointer" t-att-data-toggle="question.can_comment and 'collapse' or ''"
+ t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
+ t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
+ t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
Comment
</a>
</li>
- <li t-if="question.state != 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
+ <li t-if="question.state != 'close'">
<t t-call="website_forum.link_button">
<t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
<t t-set="label" t-value="'Close'"/>
- <t t-set="classes" t-vaoue="'text-muted fa-times'"/>
+ <t t-set="classes" t-value="'fa-times'"/>
+ <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
</t>
</li>
- <li t-if="question.state == 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
+ <li t-if="question.state == 'close'">
<t t-call="website_forum.link_button">
<t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
<t t-set="label" t-value="'Reopen'"/>
- <t t-set="classes" t-value="'text-muted fa-undo'"/>
+ <t t-set="classes" t-value="'fa-undo'"/>
+ <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
</t>
</li>
- <li t-if="(user.id == question.create_uid.id and can_edit_own) or can_edit_all">
+ <li>
<t t-call="website_forum.link_button">
- <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
+ <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edition'"/>
<t t-set="label" t-value="'Edit'"/>
- <t t-set="classes" t-value="'text-muted fa-edit'"/>
+ <t t-set="classes" t-value="'fa-edit'"/>
+ <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
</t>
</li>
- <li t-if="question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
+ <li t-if="question.active">
<t t-call="website_forum.link_button">
<t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
<t t-set="label" t-value="'Delete'"/>
- <t t-set="classes" t-value="'text-muted fa-trash-o'"/>
+ <t t-set="classes" t-value="'fa-trash-o'"/>
+ <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
</t>
</li>
- <li t-if="not question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
+ <li t-if="not question.active">
<t t-call="website_forum.link_button">
<t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
<t t-set="label" t-value="'Undelete'"/>
- <t t-set="classes" t-value="'text-muted fa-trash-o'"/>
+ <t t-set="classes" t-value="'fa-trash-o'"/>
+ <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
</t>
</li>
</ul>
<span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
</div>
</div>
+ <div class="visible-xs text-center">
+ <t t-call="website_forum.vote">
+ <t t-set="post" t-value="question"/>
+ </t>
+ <div class="text-muted text-center">
+ <span t-field="question.views"/> Views
+ </div>
+ <div class="mt4">
+ <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
+ t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
+ </div>
+ </div>
</div>
<t t-call="website_forum.post_comment">
<t t-set="object" t-value="question"/>
<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" t-attf-id="answer_#{answer.id}" >
- <div class="text-center pull-left">
+ <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 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'}"
+ <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 style="margin-left: 95px;" class="clearfix">
+ <div class="col-md-10 clearfix">
<t t-raw="answer.content"/>
<div class="mt16">
<ul class="list-inline pull-right">
- <li t-if="user.id == answer.create_uid.id or user.karma>=50">
- <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
- t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
+ <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-if="(user.id == answer.create_uid.id and can_edit_own) or can_edit_all">
- <a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit"> Edit</a>
+ <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-if="(user.id == answer.create_uid.id and can_unlink_own) or can_unlink_all">
+ <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="'text-muted fa-trash-o'"/>
+ <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="user.id == answer.create_uid.id">
+ <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="'text-muted fa-magic'"/>
+ <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>
<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"/>
<div class="col-sm-10 col-sm-offset-2">
<div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
<small class="text-muted">
- <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
- t-attf-data-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
- class="close comment_delete">&times;</button>
+ <t t-set="required_karma" t-value="message.author_id.id == user.partner_id.id and object.forum_id.karma_comment_unlink_own or object.forum_id.karma_comment_unlink_all"/>
+ <t t-call="website_forum.link_button">
+ <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/delete'"/>
+ <t t-set="label" t-value="' '"/>
+ <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
+ <t t-set="classes" t-value="'close comment_delete fa-times'"/>
+ </t>
+
<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="classes" t-value="'text-muted fa-magic pull-right'"/>
+ <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
+ <t t-set="classes" t-value="'fa-magic pull-right'"/>
</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"]}'
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
<span t-field="tag.name"/>
</a>
- <span>
+ <span>
X <t t-esc="tag.posts_count"/>
</span>
</div>
<template id="badge_user">
<t t-call="website_forum.header">
- <h3 class="mt32 mb32">
+ <h3 class="mt32 mb32">
<b>Badge "<span t-field="badge.name"/>"</b>
</h3>
<div>
<template id="users">
<t t-call="website_forum.header">
- <t t-foreach="users" t-as="user">
- <t t-if="user_index % 3 == 0">
- <div class="row"></div>
- </t>
- <div class="col-sm-4">
+ <div t-foreach="users" t-as="row_users" class="row mt16">
+ <div t-foreach="row_users" t-as="user" class="col-sm-4">
<img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
<div>
<a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
<t t-raw="0"/>
</div>
</div>
- </t>
+ </div>
<div class="pull-left">
<t t-call="website.pager"/>
</div>
</t>
</template>
+<!--Private profile-->
+<template id="private_profile">
+ <t t-call="website_forum.header">
+ <h1 class="mt32">This profile is private!</h1>
+ <p>
+ <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
+ </p>
+ </t>
+</template>
+
<template id="edit_profile">
<t t-call="website_forum.header">
- <h3>Edit Profile </h3>
+ <h3>Edit Profile</h3>
+ <div class="row">
<div class="col-md-2">
<img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
</div>
+ <div class="col-md-10">
<form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
<input name="user_id" t-att-value="user.id" type="hidden"/>
- <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
- <div class="col-md-7 mb16">
- <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
- </div>
- <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
- <div class="col-md-7 mb16">
- <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
+ <div class="form-group">
+ <label class="col-md-2 control-label mb16" for="user_name">Real name</label>
+ <div class="col-md-8 mb16">
+ <input type="text" class="form-control" name="name" id="user_name" required="True" t-attf-value="#{user.name}"/>
+ </div>
</div>
- <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
- <div class="col-md-7 mb16">
- <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
+ <div class="form-group">
+ <label class="col-md-2 control-label mb16" for="user_website_published" t-if="user.id == uid">Public profile</label>
+ <div class="col-md-8 mb16" t-if="user.id == uid">
+ <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" t-if="not user.website_published"/>
+ <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" checked="checked" t-if="user.website_published"/>
+ </div>
</div>
- <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
- <div class="col-md-7 mb16">
- <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
+ <div class="form-group">
+ <label class="col-md-2 control-label mb16" for="user_website">Website</label>
+ <div class="col-md-8 mb16">
+ <input type="text" class="form-control" name="website" id="user_website" t-attf-value="#{user.partner_id.website or ''}"/>
+ </div>
</div>
- <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
- <div class="col-md-7 mb16">
- <select class="form-control" name="country">
- <option value="">Country...</option>
- <t t-foreach="countries or []" t-as="country">
- <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
- </t>
- </select>
+ <div class="form-group">
+ <div t-if="email_required" class="alert alert-danger alert-dismissable oe_forum_email_required">
+ <button type="button" class="close" data-dismiss="alert">x</button>
+ <p>Please enter a valid email address in order to receive notifications from answers or comments.</p>
+ </div>
+ <label class="col-md-2 control-label mb16" for="user_email">Email</label>
+ <div class="col-md-8 mb16">
+ <input type="text" class="form-control" name="email" id="user_email" required="True" t-attf-value="#{user.partner_id.email}"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label mb16" for="user_city">City</label>
+ <div class="col-md-8 mb16">
+ <input type="text" class="form-control" name="city" id="user_city" t-attf-value="#{user.partner_id.city or ''}"/>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label mb16">Country</label>
+ <div class="col-md-8 mb16">
+ <select class="form-control" name="country">
+ <option value="">Country...</option>
+ <t t-foreach="countries or []" t-as="country">
+ <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
+ </t>
+ </select>
+ </div>
</div>
<!--Note: using website_description fiels instead of using commnt firld of partner-->
- <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
- <div class="col-md-7 mb16">
- <textarea name="description" style="min-height: 120px" required="True"
- class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
+ <div class="form-group">
+ <label class="col-md-2 control-label mb16" for="description">Biography</label>
+ <div class="col-md-8 mb16">
+ <textarea name="description" id="description" style="min-height: 120px" required="True"
+ class="form-control load_editor"><t t-esc="user.partner_id.website_description"/></textarea>
+ </div>
</div>
- <div class="col-sm-offset-4 col-md-4 mb16">
+ <div class="col-sm-offset-2 col-md-2 mb16">
<button class="btn btn-primary btn-lg">Update</button>
</div>
</form>
+ </div>
+ </div>
+ <script type="text/javascript">
+ CKEDITOR.replace("description");
+ </script>
</t>
</template>
<h1 class="mt0 page-header">
<span t-field="user.name"/>
<small>profile</small>
+ <t t-call="website.publish_management" groups="base.group_website_publisher">
+ <t t-set="object" t-value="user"/>
+ </t>
</h1>
<div class="row">
<div class="col-sm-2">
<span t-if="user.city and user.country_id">, </span>
<span t-field="user.country_id"/>
<t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
-
+
</td>
</tr>
<tr>
<ul class="nav nav-tabs">
<li class="active">
- <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
+ <a href="#questions" data-toggle="tab"><t t-esc="count_questions"/> Questions</a>
</li>
<li>
- <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
+ <a href="#answers" data-toggle="tab"><t t-esc="count_answers"/> Answers</a>
</li>
<li t-if="uid == user.id">
<a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
<div class="tab-pane" id="badges">
<t t-call="website_forum.user_badges"/>
</div>
- <div class="tab-pane" id="favourite_question">
+ <div class="tab-pane" id="favourite_question" t-if="uid == user.id">
<div t-foreach="favourite" t-as="question">
<t t-call="website_forum.display_post"/>
</div>
</div>
- <div class="tab-pane" id="followed_question">
+ <div class="tab-pane" id="followed_question" t-if="uid == user.id">
<div t-foreach="followed" t-as="question" class="mb16">
<t t-call="website_forum.display_post"/>
</div>
</div>
- <div class="tab-pane" id="votes">
+ <div class="tab-pane" id="votes" t-if="uid == user.id">
<t t-call="website_forum.user_votes"/>
</div>
- <div class="tab-pane" id="activity">
+ <div class="tab-pane" id="activity" t-if="uid == user.id">
<ul class="list-unstyled">
<li t-foreach="activities" t-as="activity">
<span t-field="activity.date" t-field-options='{"format": "short"}'/>
<span t-esc="activity.subtype_id.name" class="label label-info"/>
<t t-set="post" t-value="posts[activity.res_id]"/>
- <span t-if="post[1]">
+ <span t-if="post[1]">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
<span t-esc="post[0].name"/>
</a>
</div>
</template>
+<!-- User Navbar -->
+<template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
+ <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
+ <li><a href="#" data-action="new_forum">New Forum</a></li>
+ </xpath>
+</template>
+
</data>
</openerp>