odoo/addons/website_forum/views/website_forum.xml

871 lines
40 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="Fvent Editor">
<xpath expr="//script[@id='website_tour_js']" position="after">
<script type="text/javascript"
src="/website_forum/static/src/js/website_forum.editor.js"></script>
<script type="text/javascript"
src="/website_forum/static/src/js/website.tour.forum.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">Support</a>
</li>
</xpath>
</template>
<!-- Forum Tags -->
<template id="tags">
<t t-foreach="question.tags" t-as="tag">
<a t-attf-href="/forum/tag/#{ tag.id }" class="badge">
<t t-esc="tag.name" />
</a>
</t>
<t t-if="not question.tags">
<div style="visibility:hidden;">No Tags</div>
</t>
</template>
<!-- List of Questions -->
<template id="post_list">
<div class="row">
<div class="col-md-8">
<a t-attf-href="/forum/question/#{ slug(question) }">
<t t-esc="question.name" />
</a>
</div>
<div class="col-md-4 text-right">
<span class="label label-primary status">
<t t-esc="len(question.vote_ids)" />
Votes
</span>
<span class="label label-success status">
<t t-esc="len(question.child_ids)" />
Answers
</span>
<span class="label label-info status">
<t t-esc="question.views" />
Views
</span>
</div>
</div>
<div class="row">
<div class="col-md-8 visible-lg">
<t t-call="website_forum.tags" />
</div>
<div class="col-md-4 text-muted text-right">
<small>
<t t-esc="question.write_date" />
<a t-attf-href="/forum/user/#{ question.create_uid.id }">
<t t-esc="question.create_uid.name" />
</a>
<a href="">
<t t-esc="question.create_uid.karma" />
</a>
</small>
</div>
</div>
</template>
<template id="forum_header">
<div class="navbar navbar-default">
<div class="container">
<div class="raw visible-lg">
<div class="col-md-9 nav nav-pills pull-left">
<ul class="col-md-5 nav nav-pills pull-left" style="visibility:hidden;">
<li>
<a href="#">
<span class="badge pull-right">0</span>
Blank Space
</a>
</li>
</ul>
</div>
<div class="col-md-3 nav nav-pills text-right">
<ul class="nav nav-pills">
<li t-att-class="searches.get('tags') and 'active' or '' ">
<a href="/forum/tags">
tags
</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('badge') and 'active' or '' ">
<a href="/forum/badge">
badges
</a>
</li>
</ul>
</div>
</div>
<div class="raw">
<div class="col-md-4 forum_menu items">
<ul class="nav nav-pills">
<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') }}">
UNANSWERD
</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>
</ul>
</div>
<form action="/forum/" method="get" role="search">
<div class="col-md-5 forum_menu">
<input type="search" class="form-control btn-block input-lg"
name="search" placeholder="Search Or Ask your Question"
t-att-value="searches.get('search') or ''" />
</div>
<div class="col-md-3 pull-right forum_menu visible-lg">
<button type="submit" class="btn btn-danger btn-lg btn-block pull-left">ASK YOUR QUESTION</button>
</div>
</form>
</div>
</div>
</div>
</template>
<!-- Page -->
<template id="index" name="Forum Navigation">
<t t-call="website.layout">
<t t-set="head">
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css' />
</t>
<div> <t t-call="website_forum.forum_header"/> </div>
<div id="wrap" class="container">
<ul class="list-unstyled">
<li t-foreach="question_ids" t-as="question" class="question">
<t t-call="website_forum.post_list" />
</li>
</ul>
<div class="pull-center">
<t t-call="website.pager" />
</div>
</div>
</t>
</template>
<template id="index_right" name="Right Column"
inherit_option_id="website_forum.index">
<xpath expr="//div[@id='wrap']" position="replace">
<div class="container mt16">
<div class="row">
<div class="col-lg-9 col-sm-9">
<ul class="list-unstyled">
<li t-foreach="question_ids" t-as="question" class="question">
<t t-call="website_forum.post_list" />
</li>
</ul>
<div class="pull-left">
<t t-call="website.pager" />
</div>
</div>
<div class="col-lg-2 col-lg-offset-1 col-sm-2 visible-lg" id="question_right_column">
<div>This is right panel</div>
</div>
</div>
</div>
</xpath>
</template>
<!-- Need to improve this template -->
<template id="shorting_answer">
<!--ul class="nav nav-pills pull-left"> <li> <h4> <t t-esc="len(question_ids)"
/> Questions </h4> </li> </ul -->
<!-- div class="col-md-2"> </div> <div class="col-md-2"> Short by » </div>
<div class="col-md-2"> <a href="#">oldest</a> </div> <div class="col-md-2">
<a href="#">newest</a> </div> <div class="col-md-1"> <a href="#">most viewd</a>
</div -->
</template>
<!-- index page of forum -->
<!--template id="index1" name="Posts">
<t t-call="website.layout">
<t t-set="head">
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css' />
</t>
<t t-call="website_forum.forum_header" />
<div id="wrap">
<div class="container">
<div class="col-md-9">
<t t-call="website_forum.shorting_answer" />
<ul class="media-list">
<li t-foreach="question_ids" t-as="question"
class="media media_without_margin">
<t t-call="website_forum.post_list" />
</li>
</ul>
<div class="col-sm-7">
</div>
</div>
<div class="col-md-3">
<t t-raw="0" />
<h4>This is a right panel</h4>
</div>
</div>
</div>
</t>
</template-->
<!-- need to refactor below code -->
<template id="shorting">
<div class="col-xs-3">
<h5>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Short by
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="#">By Date</a>
</li>
<li>
<a href="#">By Activity</a>
</li>
<li>
<a href="#">By Answer</a>
</li>
<li>
<a href="#">By Votes</a>
</li>
</ul>
</h5>
</div>
</template>
<template id="404">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure oe_empty">
<div class="container">
<h1 class="mt32">Question not found!</h1>
<p>Sorry, the requested question is not available anymore.</p>
<p>
<a t-attf-href="/forum/question/">Return to the question list.</a>
</p>
</div>
</div>
</div>
</t>
</template>
<template id="user_detail">
<div class="col-sm-3 col-sm-offset-9 col-md-offset-8 text-right">
<div class="panel panel-primary">
<p class="text-center-heading">
<small>
asked
<span t-esc="question.create_date"></span>
</small>
</p>
<div class="row">
<div class="col-xs-3">
<div class="row">
<div class="col-xs-12">
<span t-field="question.create_uid.image" t-field-options='{"widget": "image"}' />
</div>
</div>
</div>
<div class="col-xs-9">
<div class="row">
<div class="col-xs-12">
<div class="text-left">
<a t-attf-href="/forum/user/#{ question.create_uid.id }">
<t t-esc="question.create_uid.name" />
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div style="font-size:10px" class="text-left">
<b style="color : green">11</b>
<span class="glyphicon glyphicon-certificate badge-gold"></span>
1
<span class="glyphicon glyphicon-certificate badge-silver"></span>
10
<span class="glyphicon glyphicon-certificate badge-bronze"></span>
5
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<template id="post_vote">
<div class="col-md-1 col-xs-1">
<div class="row">
<div class="col-xs-12 custom-arrow-height">
<span class="glyphicon glyphicon-chevron-up" />
</div>
</div>
<div class="row">
<div class="col-xs-12 custom-vote-height">
<h4>
<span>0</span>
</h4>
</div>
</div>
<div class="row">
<div class="col-xs-12 custom-arrow-height">
<span class="glyphicon glyphicon-chevron-down" />
</div>
</div>
</div>
</template>
<template id="post_links">
<div class="row">
<div class="col-xs-12 text-right">
<a class="action-links" href="">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<a class="action-links" href="">
<span class="glyphicon glyphicon-flag"></span>
</a>
<a class="action-links" href="">
<span class="glyphicon glyphicon-trash"></span>
</a>
<a class="action-links" href="">
<span class="glyphicon glyphicon-link"></span>
</a>
</div>
</div>
</template>
<template id="ask_question">
<t t-call="website.layout">
<div class="container">
<div class="col-md-9 col-xs-11">
<div class="row">
<div class="col-xs-12 page-header">
<h3>Please Ask your Question here</h3>
</div>
<div class="col-xs-12">
<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>
</div>
</div>
<div class="row">
<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>
</div>
<script type="text/javascript">
CKEDITOR.replace("textarea_ckeditor");
</script>
</div>
</div>
</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="answer">
<ul class="media-list">
<div>
<li t-foreach="question.child_ids" t-as="answer" class="media">
<div>
<t t-call="website_forum.post_vote"/>
<div class="row col-md-9" style="font-size:14px">
<t t-esc="answer.content" />
</div>
<div class="row">
<t t-call="website_forum.user_detail" />
</div>
<t t-call="website_forum.post_links" />
</div>
</li>
</div>
</ul>
</template>
<template id="post_description_data">
<div class="row">
<div>
<div>
<t t-call="website_forum.post_vote"/>
</div>
<div class="row col-md-9">
<div class="row col-xs-12" style="font-size:12px">
<h4>
<t t-esc="question.name"/>
</h4>
</div>
<t t-call="website_forum.tags" />
<div class="row" t-if="question.content" style="font-size:14px">
<t t-esc="question.content"/>
</div>
</div>
</div>
<div class="row">
<t t-call="website_forum.user_detail" />
</div>
<div class="badge">
<t t-esc="len(question.child_ids)"/> Answer
</div>
<hr/>
<t t-call="website_forum.shorting_answer" />
<div class="row ">
<div>
<t t-call="website_forum.answer"/>
</div>
</div>
<div t-if="not answer_done">
<t t-call="website_forum.post_answer"/>
</div>
<div t-if="answer_done">
<form action="/forum/question/editanswer/" method="post" role="form">
<input name="post_id" t-att-value="question.id" type="hidden"/>
<button class="btn btn-default btn-lg">
Edit Your Answer
</button>
<span> (only one answer per question is allowed) </span>
</form>
</div>
</div>
<hr/>
</template>
<template id="post_description_full" name="Question Navigation">
<t t-call="website.layout">
<div>
<t t-call="website_forum.forum_header"/>
</div>
<div class="container" id="wrap">
<t t-call="website_forum.post_description_data"/>
</div>
</t>
</template>
<template id="post_description_full_right" name="Question Right Column"
inherit_option_id="website_forum.post_description_full">
<xpath expr="//div[@id='wrap']" position="replace">
<div class="container mt16 ">
<div class="row">
<div class="col-lg-9 col-sm-9" id="forum_left_column">
<t t-call="website_forum.post_description_data"/>
</div>
<div class="col-lg-2 col-lg-offset-1 col-sm-2 visible-lg" id="forum_right_column">
<div>This is Question right panel</div>
</div>
</div>
</div>
</xpath>
</template>
<template id="tag">
<t t-call="website.layout">
<div>
<t t-call="website_forum.forum_header"/>
</div>
<!--Todo: Improve kanban-->
<div class="container">
<t t-foreach="tags" t-as="tag">
<a t-attf-href="/forum/tag/#{ tag.id }" class="badge">
<t t-esc="tag.name" />
</a>
<span>
X <t t-esc="len(tag.post_ids)"/>
</span>
</t>
<div class="pull-left">
<t t-call="website.pager" />
</div>
</div>
</t>
</template>
<template id="users">
<t t-call="website.layout">
<div>
<t t-call="website_forum.forum_header"/>
</div>
<div class="container">
<t t-foreach="users" t-as="user">
<div class="row">
<div class="col-xs-3 ">
<div class="row">
<div class="col-xs-12 col-md-3">
<span t-field="user.image" t-field-options='{"widget": "image"}' />
</div>
</div>
</div>
<div class="col-xs-9">
<div class="row">
<div class="col-xs-12">
<div class="text-left">
<a t-attf-href="/forum/user/#{ user.id }">
<t t-esc="user.name" />
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div style="font-size:10px" class="text-left">
<b style="color : green">11</b>
<span class="glyphicon glyphicon-certificate badge-gold"></span>
1
<span class="glyphicon glyphicon-certificate badge-silver"></span>
10
<span class="glyphicon glyphicon-certificate badge-bronze"></span>
5
</div>
</div>
</div>
</div>
</div>
</t>
<div class="pull-left">
<t t-call="website.pager" />
</div>
</div>
</t>
</template>
<template id="user_detail_full">
<t t-call="website.layout">
<div>
<t t-call="website_forum.forum_header"/>
</div>
<div class="container">
<div class="row col-xs-12 page-header">
<h3>
<span>
<t t-esc="user.name" />
's profile - overview
</span>
</h3>
</div>
<div class="row">
<ul class="nav nav-tabs">
<li class="active">
<a href="#overview" data-toggle="tab">Overview</a>
</li>
<li>
<a href="#network" data-toggle="tab">Network</a>
</li>
<li>
<a href="#karma" data-toggle="tab">Karma</a>
</li>
<li>
<a href="#followed_question" data-toggle="tab">Followed Question</a>
</li>
<li>
<a href="#activity" data-toggle="tab">Activity</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="overview">
<div class="row">
<div class="col-xs-3">
<span t-field="user.image" class="user-big-profile-image"
t-field-options='{"widget": "image"}' alt="User Name" />
</div>
<div class="col-xs-9">
<div class="row col-xs-12">
<b>Registerd User</b>
</div>
<div class="row">
<div class="col-xs-6">
Real Name :
</div>
<div class="col-xs-6">
<b>
<t t-esc="user.name" />
</b>
</div>
</div>
<div class="row">
<div class="col-xs-6">
Member since :
</div>
<div class="col-xs-6">
<b>
<t t-esc="user.create_date" />
3
</b>
</div>
</div>
<div class="row">
<div class="col-xs-6">
Last Seen :
</div>
<div class="col-xs-6">
<b>Feb 15'14</b>
</div>
</div>
<div class="row">
<div class="col-xs-12">
Todays unused votes 30 votes left
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-3 text-center" style="overflow : hidden">
<b>
<t t-esc="user.karma" />
</b>
</div>
</div>
<div class="row">
<div class="col-xs-3 text-center">
Karma
</div>
</div>
<div class="row">
<div class="col-xs-12">
<button class="btn btn-default">Follow TressCLoud</button>
</div>
</div>
<div class="row col-xs-12 page-header">
<h3>
<b>
<t t-esc="len(user.question_ids)" />
Questions
</b>
</h3>
</div>
<div class="row col-xs-12">
<ul class="media-list">
<li t-foreach="user.question_ids" t-as="question" class="media">
<t t-call="website_forum.post_list" />
</li>
</ul>
</div>
<div class="row col-xs-12 page-header">
<h3>
<b>
<t t-esc="len(user.answer_ids)" />
Answers
</b>
</h3>
</div>
<!--div class="row col-xs-12"> <ul class="media-list"> <li t-foreach="user.answer_ids"
t-as="question" class="media"> <t t-call="website_forum.post_list" /> </li>
</ul> </div -->
<div class="row col-xs-12 page-header">
<h3>
<b>
<t t-esc="len(user.vote_ids)" />
Votes
</b>
</h3>
</div>
<div class="row">
<div class="col-xs-2">
<h3>
<a href="">
<span class="glyphicon glyphicon-thumbs-up"></span>
</a>
<b> 15 </b>
</h3>
</div>
<div class="col-xs-2">
<h3>
<a href="">
<span class="glyphicon glyphicon-thumbs-down"></span>
</a>
<b> 0 </b>
</h3>
</div>
</div>
<div class="row col-xs-12 page-header">
<h3>
<b>
<t t-esc="len(user.tags)" />
Tags
</b>
</h3>
</div>
<!--div class="row col-xs-12"> <ul class="media-list"> <li t-foreach="user.tags"
t-as="tag" class="media"> <t t-call="website_forum.tags" /> </li> </ul> </div -->
<!--div class="row col-xs-12 page-header"> <h3> <b> <t t-esc="len(user.badges)"/>
Badges </b> </h3> </div> <div class="row col-xs-12"> <ul class="media-list">
<li t-foreach="user.badges" t-as="badge" class="media"> <t t-call="website_forum.badge"
/> </li> </ul> </div -->
</div>
<div class="tab-pane" id="network">
<h1>Network</h1>
</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>
</div>
</div>
</t>
</template>
</data>
</openerp>