odoo/addons/website_forum/views/website_forum.xml

559 lines
26 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="editor_head" inherit_id="website.editor_head"
name="Event Editor">
<xpath expr="//script[@id='website_tour_js']" position="after">
<script type="text/javascript"
src="/website_forum/static/src/js/website.tour.forum.js"></script>
<!--
FP Note: Why do we need this ? Can we remove this code?
The problem is that you add your script for every page, not only for the forum
-->
<script type="text/javascript"
src="/website_forum/static/src/js/website_forum.editor.js"></script>
<script type="text/javascript">
CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList']
,['Outdent','Indent','Link','Unlink'],] ;
</script>
</xpath>
</template>
<!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.layout"
name="Footer Questions Link">
<xpath expr="//footer//ul[@name='products']" position="inside">
<li>
<a href="/forum">Q&amp;A</a>
</li>
</xpath>
</template>
<!-- List of Questions -->
<template id="post_list">
<div class="question clearfix">
<div class="pull-left text-center">
<div t-attf-class="box #{len(question.child_ids) and 'oe_green' or 'oe_grey'}">
<span t-esc="len(question.child_ids)"/>
<div t-if="len(question.child_ids)&gt;1">Answers</div>
<div t-if="len(question.child_ids)&lt;=1">Answer</div>
</div>
<div class="text-muted text-center">
<span t-field="question.views"/> Views
</div>
</div>
<div style="margin-left: 95px;">
<div class="question-name">
<a t-attf-href="/forum/question/#{ slug(question) }" t-field="question.name"/>
</div>
<div class="text-muted">
by <a t-attf-href="/forum/user/#{ question.create_uid.id }" t-field="question.create_uid"/>,
on <span t-field="question.write_date"/>
<div t-if="len(question.vote_ids)">
<strong>with <span t-esc="len(question.vote_ids)"/> votes</strong>
</div>
</div>
<t t-foreach="question.tags" t-as="tag">
<a t-attf-href="/forum/tag/#{ tag.id }" class="badge" t-field="tag.name"/>
</t>
</div>
</div>
</template>
<!-- Page Index -->
<template id="header" name="Forum Index">
<t t-call="website.layout">
<t t-set="head">
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css' />
</t>
<div class="container mt16">
<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>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/forum">Help</a>
<!-- FP Note: Replace by this when controllers have changed
<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>
<a href="/forum">Questions</a>
</li>
<li t-att-class="searches.get('users') and 'active' or '' ">
<a href="/forum/users">People</a>
</li>
<li t-att-class="searches.get('tags') and 'active' or '' ">
<a href="/forum/tags">Tags</a>
</li>
<li t-att-class="searches.get('badge') and 'active' or '' ">
<a href="/forum/badge">Badges</a>
</li>
<li>
<a href="/user/1"><span class="label label-success">You got the <em>New Author</em> badge!</span></a>
</li>
</ul>
<form class="navbar-form navbar-right" role="search" action="/forum/" method="get">
<div class="form-group">
<input type="search" class="form-control"
name="search" placeholder="Search a question..."
t-att-value="searches.get('search') or ''" />
<button type="submit" class="btn btn-default">Search</button>
</div>
</form>
</div>
</div>
</div>
<div id="wrap" class="container">
<div class="row">
<div class="col-sm-9">
<t t-raw="0"/>
</div><div class="col-sm-3" id="right-column">
<a class="btn btn-primary btn-lg btn-block mb16" href="/forum/ask">Ask a Question</a>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">About This Forum</h3>
</div>
<div class="panel-body">
This community is for professional and enthusiast about our
products and services.<br/>
<a href="/forum/faq" class="fa fa-arrow-right"> Read Guidelines</a>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="index">
<t t-call="website_forum.faq">
<div t-field="forum.faq"/>
</t>
</template>
<template id="index">
<t t-call="website_forum.header">
<h1 class="page-header mt0">
<t t-esc="total_questions"/>
<span>Questions</span>
<small class="dropdown" t-if="searches.get('type') in ('all', 'unanswered','followed')">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<t t-if="searches.get('type') == 'all'">No filter</t>
<t t-if="searches.get('type') == 'unanswered'">Filter: Unanswered</t>
<t t-if="searches.get('type') == 'followed'">Filter: Followed</t>
<b class="caret"/>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header">Filter on</li>
<li t-att-class="searches.get('type') == 'all' and 'active' or '' ">
<a t-attf-href="/forum/?{{ keep_query( type='all') }}">All</a>
</li>
<li t-att-class="searches.get('type') == 'unanswered' and 'active' or '' ">
<a t-attf-href="/forum/?{{ keep_query( type='unanswered') }}">Unanswered</a>
</li>
<li t-att-class="searches.get('type') == 'followed' and 'active' or '' ">
<a t-attf-href="/forum/?{{ keep_query( type='followed') }}">Followed</a>
</li>
<li class="dropdown-header">Sort by</li>
<li>
<a href="#" class="active">Last activity date</a> <!-- default order to implement -->
</li>
<li>
<a href="#">Most answered</a>
</li>
<li>
<a href="#">Most voted</a>
</li>
</ul>
</small>
</h1>
<div t-foreach="question_ids" t-as="question" class="mb16">
<t t-call="website_forum.post_list" />
</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>
<template id="user_detail">
<div>
<span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}' />
<div>
<a t-attf-href="/forum/user/#{ slug(user) }" t-field="user.name"/>
<t t-raw="separator or ', '"/>
<b>11 badges:</b>
<span class="fa fa-certificate badge-gold"></span>
1
<span class="fa fa-certificate badge-silver"></span>
10
<span class="fa fa-certificate badge-bronze"></span>
5
<br/>
<t t-raw="0"/>
</div>
</div>
</template>
<template id="ask_question">
<t t-call="website_forum.header">
<h1 class="mt0">Ask your Question</h1>
<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>
</ul>
<form action="/forum/question/ask/" method="post" role="form">
<div class="col-xs-12">
<input type="text" name="question_name" required="True"
t-attf-value="#{question_name or ''}" id="textbox_user_question"
class="form-control" placeholder="Enter your Question" />
</div>
<div class="col-xs-12">
Please enter a descriptive question (should
finish by a '?')
</div>
<div class="col-xs-12">
<textarea name="question_content" required="True"
t-attf-value="#{question_content or ''}" class="form-control"
id="textarea_ckeditor" rows="10" style="width : 100%" />
</div>
<div class="col-xs-12">
Tags:
</div>
<div class="col-xs-12">
<input type="text" name="question_tag" t-attf-value="#{question_tag or ''}"
class="form-control" id="textarea_tags" style="width : 100%" />
</div>
<div class="col-xs-8">
<button class="btn btn-default" id="btn_ask_your_question"
style="background-color : #df3f3f; color: white !important;">Post Your Question</button>
</div>
</form>
<script type="text/javascript">
CKEDITOR.replace("textarea_ckeditor");
</script>
</t>
</template>
<template id="post_answer">
<div class="col-md-9 col-xs-11">
<div class="row">
<div class="col-xs-12">
<div class="page-header">
<h3>Your answer</h3>
</div>
</div>
<div class="col-xs-12">
<p>
<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>
</div>
</div>
<div class="row">
<form action="/forum/question/postanswer/" method="post" role="form">
<div class="col-xs-12">
<div class="row">
<div class="col-xs-12">
<textarea name="answer_content" required="True"
t-attf-value="#{answer_content or ''}" class="form-control"
id="textarea_ckeditor" rows="10" style="width : 100%" />
</div>
</div>
</div>
<input name="post_id" t-att-value="question.id" type="hidden" />
<div class="col-xs-8">
<button class="btn btn-default"
style="background-color : #df3f3f; color: white !important;" id="btn_ask_your_question">
Post Your Answer
</button>
</div>
</form>
</div>
<script type="text/javascript">
CKEDITOR.replace("textarea_ckeditor");
</script>
</div>
</template>
<template id="edit_answer">
<t t-call="website.layout">
<div class="container">
<div class="col-md-9 col-xs-11">
<div class="row">
<h3>Edit answer</h3>
</div>
<div class="row">
<form action="/forum/question/saveanswer/" method="post" role="form">
<div >
<div class="row">
<div class="col-xs-12">
<textarea name="answer_content" required="True" value="content" class="form-control"
id="textarea_ckeditor" rows="10" style="width : 100%" />
</div>
</div>
</div>
<input name="post_id" t-att-value="post.id" type="hidden"/>
<input name="answer_id" t-att-value="post_answer.id" type="hidden"/>
<div>
<button class="btn btn-default btn-lg">
Save edit
</button>
</div>
</form>
</div>
<script type="text/javascript">
CKEDITOR.replace("textarea_ckeditor");
</script>
</div>
</div>
</t>
</template>
<template id="post_description_full" name="Question Navigation">
<t t-call="website_forum.header">
<div class="question">
<div class="text-center pull-left">
<div t-attf-class="box oe_grey">
<a href="#" class="fa fa-thumbs-up text-success"/>
<span t-esc="len(question.vote_ids)"/>
<a href="#" class="fa fa-thumbs-down text-warning"/>
<div>
votes
</div>
</div>
<div class="text-muted">
<span t-esc="len(question.child_ids)"/>
<span t-if="len(question.child_ids)&gt;1">Answers</span>
<span t-if="len(question.child_ids)&lt;=1">Answer</span>
</div>
</div>
<div style="margin-left: 95px;">
<h1 t-field="question.name" class="mt0"/>
<t t-raw="question.content"/>
<div class="mt16 clearfix">
<div class="pull-right">
<t t-foreach="question.tags" t-as="tag">
<a t-attf-href="/forum/tag/#{ tag.id }" class="badge" t-field="tag.name"/>
</t>
</div>
<t t-set="user" t-value="question.create_uid"/>
<t t-call="website_forum.user_detail">
<span class="text-muted">Asked on <span t-field="question.write_date"/></span>
</t>
</div>
</div>
</div>
<hr/>
<div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
<div class="text-center pull-left">
<div t-attf-class="box oe_grey">
<a href="#" class="fa fa-thumbs-up text-success"/>
<span t-esc="len(question.vote_ids)"/>
<a href="#" class="fa fa-thumbs-down text-warning"/>
<div>
votes
</div>
</div>
<div class="text-muted">
<a href="#" class="fa fa-2x fa-check"/>
</div>
</div>
<div style="margin-left: 95px;" class="clearfix">
<t t-raw="answer.content" />
<div class="mt16">
<div class="pull-right">
<a class="action-links" href="">
<span class="fa fa-edit"></span>
</a>
<a class="action-links" href="">
<span class="fa fa-flag"></span>
</a>
<a class="action-links" href="">
<span class="fa-trash-o"></span>
</a>
<a class="action-links" href="">
<span class="fa fa-link"></span>
</a>
</div>
<t t-set="user" t-value="answer.create_uid"/>
<t t-call="website_forum.user_detail">
<span class="text-muted">Answered on <span t-field="answer.create_date"/></span>
</t>
</div>
</div>
</div>
<div t-if="not answer_done">
<t t-call="website_forum.post_answer"/>
</div>
</t>
</template>
<template id="tag">
<t t-call="website_forum.header">
<h1 class="mt0">
Question by Tags
</h1>
<div class="row">
<div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
<a t-attf-href="/forum/tag/#{ slug(tag) }" class="badge">
<span t-field="tag.name" />
</a>
<span>
X <t t-esc="len(tag.post_ids)"/>
</span>
</div>
</div>
</t>
</template>
<template id="users">
<t t-call="website_forum.header">
<div class="row">
<div t-foreach="users" t-as="user" class="col-sm-4">
<t t-set="separator"><br/></t>
<t t-call="website_forum.user_detail"/>
<span class="text-muted">Joined on <span t-field="user.create_date"/></span>
</div>
</div>
<div class="pull-left">
<t t-call="website.pager" />
</div>
</t>
</template>
<template id="user_detail_full">
<t t-call="website_forum.header">
<h1 class="mt0 page-header">
<span t-field="user.name" />
<small>profile</small>
</h1>
<div class="row">
<div class="col-sm-2">
<span t-field="user.image"
t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
</div>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-6">
Karma :
</div>
<div class="col-sm-6">
<b t-field="user.karma" />
</div>
<div class="col-sm-6">
Member since :
</div>
<div class="col-sm-6">
<b>
<t t-esc="user.create_date" />
3
</b>
</div>
<div class="col-sm-6">
Last Seen :
</div>
<div class="col-sm-6">
<b>Feb 15'14</b>
</div>
<div class="col-sm-12">
Todays unused votes 30 votes left
</div>
</div>
<h2>
<t t-esc="len(user.vote_ids)" />
<span>Votes</span>
</h2>
<h3>
<span class="glyphicon glyphicon-thumbs-up"></span>
<b> 15 </b>
</h3>
<h3>
<span class="glyphicon glyphicon-thumbs-down"></span>
<b> 0 </b>
</h3>
</div>
</div>
<ul class="nav nav-tabs">
<li class="active">
<a href="#questions" data-toggle="tab"><t t-esc="len(user.question_ids)"/> Questions</a>
</li>
<li>
<a href="#answers" data-toggle="tab"><t t-esc="len(user.answer_ids)"/> Answers</a>
</li>
<li>
<a href="#karma" data-toggle="tab">Activity</a>
</li>
<li>
<a href="#followed_question" data-toggle="tab">Followed Question</a>
</li>
</ul>
<div class="tab-content mt16">
<div class="tab-pane active" id="questions">
<div t-foreach="user.question_ids" t-as="question">
<t t-call="website_forum.post_list" />
</div>
</div><div class="tab-pane" id="answers">
<div t-foreach="answers" t-as="question">
<t t-call="website_forum.post_list" />
</div>
</div>
<div class="tab-pane" id="karma">
<h1>Karma</h1>
</div>
<div class="tab-pane" id="followed_question">
<h1>Followed Questions</h1>
</div>
<div class="tab-pane" id="activity">
<h1>Activity</h1>
</div>
</div>
</t>
</template>
</data>
</openerp>