summaryrefslogtreecommitdiff
path: root/addons/website_livechat/views
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2015-01-08 11:34:38 +0100
committerJérome Maes <jem@openerp.com>2015-01-08 12:28:22 +0100
commitabcb165d97dc90cbb878dd0f6ad3e35937816c8d (patch)
tree12001df481e64160316a2e39cdda4ac9525d115c /addons/website_livechat/views
parentade60d54bbbc5c9315346a8ede7f79dc6d4eb80a (diff)
[IMP] website_livechat : make it depend on rating_livechat. It now propose to display livechat channel on website pages, with its ratings and description.
Diffstat (limited to 'addons/website_livechat/views')
-rw-r--r--addons/website_livechat/views/website_livechat.xml152
-rw-r--r--addons/website_livechat/views/website_livechat_view.xml17
2 files changed, 162 insertions, 7 deletions
diff --git a/addons/website_livechat/views/website_livechat.xml b/addons/website_livechat/views/website_livechat.xml
index 63f0d334327..dab68cbd414 100644
--- a/addons/website_livechat/views/website_livechat.xml
+++ b/addons/website_livechat/views/website_livechat.xml
@@ -2,13 +2,151 @@
<openerp>
<data>
-<template id="header" inherit_id="website.layout" name="LiveChat Import (internal) Scripts">
- <xpath expr="//body" position="inside">
- <t t-if="website and website.channel_id">
- <t t-raw="website.channel_id.script_internal"/>
- </t>
- </xpath>
-</template>
+ <template id="header" inherit_id="website.layout" name="LiveChat Import (internal) Scripts">
+ <xpath expr="//body" position="inside">
+ <t t-if="website and website.channel_id">
+ <t t-raw="website.channel_id.script_internal"/>
+ </t>
+ </xpath>
+ </template>
+
+ <!-- Layout add footer -->
+ <template id="header_footer_custom" inherit_id="website.footer_default" name="Footer Rating Livechat Link">
+ <xpath expr="//ul[@id='products']" position="inside">
+ <li><a href="/livechat/">Livechat Support</a></li>
+ </xpath>
+ </template>
+
+ <!-- Page Layout -->
+ <template id="channel_page" name="Livechat Channel Satisfaction Page" page="True">
+ <t t-call="website.layout">
+ <div id="wrap">
+ <div class="container">
+ <h1><span>Livechat Channel</span> <small t-field="channel.name" /></h1>
+ <div t-field="channel.website_description" class="oe_structure mt16" />
+ <div class="row mt32">
+ <div class="col-md-8">
+ <t t-if="len(ratings) &gt; 0">
+ <div class="row">
+ <h3>Statistics</h3>
+ <div class="row">
+ <div class="col-md-3">
+ <div class="panel panel-warming">
+ <div class="panel-body text-center bg-warning">
+ <img src="/rating/static/src/img/rating_5.png" style="height:50px"/>
+ </div>
+ <div class="panel-body text-center bg-warning">
+ <h2 style="margin: 0">
+ <b style="font-size: 50px">
+ <t t-esc="percentage['okay']" />
+ </b>
+ <small>%</small>
+ </h2>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="panel panel-success">
+ <div class="panel-body text-center bg-success">
+ <img src="/rating/static/src/img/rating_10.png" style="height:60px"/>
+ </div>
+ <div class="panel-body text-center bg-success">
+ <h2 style="margin: 0">
+ <b style="font-size: 60px">
+ <t t-esc="percentage['great']" />
+ </b>
+ <small>%</small>
+ </h2>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-3">
+ <div class="panel panel-danger">
+ <div class="panel-body text-center bg-danger">
+ <img src="/rating/static/src/img/rating_0.png" style="height:40px"/>
+ </div>
+ <div class="panel-body text-center bg-danger">
+ <h2 style="margin: 0">
+ <b style="font-size: 40px">
+ <t t-esc="percentage['bad']" />
+ </b>
+ <small>%</small>
+ </h2>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12 mb32">
+ <h3>The <t t-esc="len(ratings)"/> last feedbacks</h3>
+ <div style="text-align:center">
+ <t t-foreach="ratings" t-as="rating" class="media">
+ <img t-attf-src='/rating/static/src/img/rating_#{int(rating.rating)}.png' t-att-alt="rating.res_name"/>
+ <t t-if="(rating_index+1) % 10 == 0">
+ <br/>
+ </t>
+ </t>
+ </div>
+ </div>
+ </div>
+ </t>
+ <t t-if="len(ratings) == 0">
+ <h4 style="text-align:center">This is no rating for this channel for now.</h4>
+ </t>
+ </div>
+ <div class="col-md-4 mb32">
+ <h3>The Team</h3>
+ <t t-foreach="team" t-as="user" class="media">
+ <div class="media">
+ <div class="pull-left">
+ <img t-att-src="'data:image/png;base64,' + user.image_small" class="img-rounded" t-att-alt="user.name"/>
+ </div>
+ <div class="media-body">
+ <h5><t t-esc="user.name"/></h5>
+ </div>
+ </div>
+ </t>
+ </div>
+ </div>
+ </div>
+ </div>
+ </t>
+ </template>
+
+
+ <template id="channel_list_page" name="Livechat Channel List Page">
+ <t t-call="website.layout">
+ <div id="wrap">
+ <div class="oe_structure"/>
+ <div class="container">
+ <h1>Livechat Support Channels</h1>
+ <div class="row mt32 mb32">
+ <t t-if="not len(channels)">
+ <div class="col-md-6 col-md-offset-3">
+ There is no public livechat channel to show.
+ </div>
+ </t>
+ <t t-if="len(channels)">
+ <div class="col-md-6 col-md-offset-3">
+ <t t-foreach="channels" t-as="channel">
+ <div class="media">
+ <a class="pull-left" t-attf-href="/livechat/channel/#{ slug(channel)}">
+ <img t-att-src="'data:image/png;base64,' + channel.image_small" t-att-alt="channel.name" />
+ </a>
+ <div class="media-body">
+ <h4 class="media-heading"><t t-esc="channel.name"/></h4>
+ </div>
+ </div>
+ </t>
+ </div>
+ </t>
+ </div>
+ </div>
+ <div class="oe_structure"/>
+ </div>
+ </t>
+ </template>
</data>
</openerp>
diff --git a/addons/website_livechat/views/website_livechat_view.xml b/addons/website_livechat/views/website_livechat_view.xml
new file mode 100644
index 00000000000..013ffa49cf2
--- /dev/null
+++ b/addons/website_livechat/views/website_livechat_view.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="im_livechat_channel_form_view" model="ir.ui.view">
+ <field name="name">im_livechat.channel.form.with.website_published</field>
+ <field name="model">im_livechat.channel</field>
+ <field name="inherit_id" ref="im_livechat.support_channel_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//group[@string='Options']" position="inside">
+ <field name="website_published" widget="website_button"/>
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp>