odoo/addons/live_support/live_support_view.xml

103 lines
4.9 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<openerp>
<data>
<menuitem id="live_support" name="Live Chat" parent="mail.mail_feeds_main" groups="group_live_support"/>
<record model="ir.actions.act_window" id="action_support_channels">
<field name="name">Live Chat Channels</field>
<field name="res_model">live_support.channel</field>
<field name="view_mode">kanban,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new live chat channel.
</p><p>
You can create channels for each website on which you want
to integrate the live chat widget, allowing you website
visitors to talk in real time with your operators.
</p>
</field>
</record>
<menuitem name="Channels" parent="live_support" id="support_channels" action="action_support_channels" groups="group_live_support"/>
<record model="ir.ui.view" id="support_channel_kanban">
<field name="name">support_channel.kanban</field>
<field name="model">live_support.channel</field>
<field name="arch" type="xml">
<kanban>
<field name="name"/>
<field name="web_page"/>
<field name="are_you_inside"/>
<field name="user_ids"/>
<templates>
<t t-name="kanban-box">
<div class="oe_group_details">
<h4><a type="open"><field name="name"/></a></h4>
<a t-att-href="record.web_page.raw_value">Test it</a>
<div class="oe_kanban_footer_left">
<span>
<span class="oe_e">+</span> <t t-esc="(record.user_ids.raw_value || []).length"/>
</span>
</div>
<div class="oe_group_button">
<button t-if="record.are_you_inside.raw_value" name="quit" type="object" class="oe_group_join">Quit</button>
<button t-if="! record.are_you_inside.raw_value" name="join" type="object">Join</button>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="support_channel_form" model="ir.ui.view">
<field name="name">support_channel.form</field>
<field name="model">live_support.channel</field>
<field name="arch" type="xml">
<form string="Support Channels" version="7.0">
<sheet>
<h1>
<field name="name"/>
</h1>
<div style="margin-bottom: 12px">
<button type="object" name="join" string="Join" attrs='{"invisible": [["are_you_inside", "=", True]]}'/>
<button type="object" name="quit" string="Quit" attrs='{"invisible": [["are_you_inside", "=", False]]}'/>
</div>
<field name="are_you_inside" invisible="1"/>
<label for="user_ids" colspan="2"/>
<field name="user_ids" readonly="1" nolabel="1" colspan="2" widget="many2many_kanban">
<kanban>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div>
<div class="oe_group_details" style="min-height: 40px">
<img t-att-src="kanban_image('im.user', 'image', record.id.value)"
class="oe_avatar oe_kanban_avatar_smallbox" style="float:left; margin-right: 10px;"/>
<h4><field name="name"/></h4>
</div>
</div>
</t>
</templates>
</kanban>
</field>
<label for="web_page" colspan="2"/>
<field name="web_page" readonly="1" nolabel="1" colspan="2"/>
<label for="script" colspan="2"/>
<field name="script" readonly="1" nolabel="1" colspan="2"/>
<group col="4">
<field name="button_text"/>
<field name="input_placeholder"/>
<field name="default_message"/>
</group>
</sheet>
</form>
</field>
</record>
</data>
</openerp>