flectra/addons/im_livechat/views/im_livechat_channel_templates.xml
2018-01-30 15:44:17 +05:30

190 lines
10 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<data>
<!--
Integrate Livechat Conversation in the Mail Chat Client Action
-->
<template id="assets_backend" name="im_livechat assets backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/im_livechat/static/src/js/im_livechat_backend.js"></script>
<script type="text/javascript" src="/im_livechat/static/src/js/copy_clipboard.js"></script>
<link rel="stylesheet" href="/im_livechat/static/src/less/copy_clipboard.less"/>
</xpath>
</template>
<template id="qunit_suite" name="im_livechat tests" inherit_id="web.qunit_suite">
<xpath expr="//script[contains(@src, '/web/static/tests/views/form_tests.js')]" position="after">
<script type="text/javascript" src="/im_livechat/static/tests/copy_clipboard_tests.js"></script>
</xpath>
</template>
<!--
Template rendering the external HTML support page
-->
<template id="support_page" name="Livechat : Support Page">
&lt;!DOCTYPE html&gt;
<html style="height: 100%">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><t t-esc="channel_name"/> Livechat Support Page</title>
<!-- Call the external Bundle to render the css, js, and js loader tags -->
<t t-raw="channel.script_external"/>
<style type="text/css">
body {
height: 100%;
font-size: 16px;
font-weight: 400;
font-family: "Lato", "Lucida Grande", "Helvetica neue", "Helvetica", "Verdana", "Arial", sans-serif;
overflow: hidden;
overflow-y: auto;
display: block;
margin: 0;
padding: 0;
border: none;
width: 100%;
height: 100%;
background: #C9C8E0;
background-image: -webkit-linear-gradient(top, #7c7bad, #ddddee);
background-image: -moz-linear-gradient(top, #7c7bad, #ddddee);
background-image: -ms-linear-gradient(top, #7c7bad, #ddddee);
background-image: -o-linear-gradient(top, #7c7bad, #ddddee);
background-image: linear-gradient(to bottom, #7c7bad, #ddddee);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7c7bad', endColorstr='#ddddee',GradientType=0 );
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
.main {
position: absolute;
opacity: 0;
top: 50%;
width: 100%;
margin-top: -150px;
color: white;
text-shadow: 0 1px 0 rgba(34, 52, 72, 0.2);
text-align: center;
}
.main h1 {
font-size: 54px;
}
.main div {
font-style: italic;
}
</style>
</head>
<body>
<div class="main" style="opacity: 1;">
<h1 class="channel_name"><t t-esc="channel.name"/></h1>
<!-- <div>Website Live Chat Powered by <strong>Flectra</strong>.</div> -->
</div>
</body>
</html>
</template>
<!--
Template rendering all the scripts required to execute the Livechat from an external page (which not contain Flectra)
-->
<template id="external_loader" name="Livechat : external_script field of livechat channel">
<!-- css style -->
<link t-att-href="'%s/im_livechat/external_lib.css' % (url)" rel="stylesheet"/>
<!-- js of all the required lib (internal and external) -->
<script t-att-src="'%s/im_livechat/external_lib.js' % (url)" type="text/javascript" />
<!-- the loader -->
<script t-att-src="'%s/im_livechat/loader/%i' % (url, channel_id)" type="text/javascript"/>
</template>
<!--
Bundle of External Librairies of the Livechat (Flectra + required modules)
-->
<template id="external_lib" name="Livechat : External Librairies of the Livechat, required to make it work">
<!-- Momentjs -->
<script type="text/javascript" src="/web/static/lib/moment/moment.js"></script>
<!-- Flectra minimal lib -->
<script type="text/javascript" src="/web/static/lib/underscore/underscore.js"></script>
<script type="text/javascript" src="/web/static/lib/underscore.string/lib/underscore.string.js"></script>
<!-- jQuery -->
<script type="text/javascript" src="/web/static/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="/web/static/lib/jquery.ui/jquery-ui.js"></script>
<script type="text/javascript" src="/web/static/lib/jquery/jquery.browser.js"></script>
<script type="text/javascript" src="/web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js"></script>
<!-- Qweb2 lib -->
<script type="text/javascript" src="/web/static/lib/qweb/qweb2.js"></script>
<!-- Flectra JS Framework -->
<script type="text/javascript" src="/web/static/src/js/boot.js"></script>
<script type="text/javascript" src="/web/static/src/js/services/config.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/abstract_service.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/class.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/collections.js"/>
<script type="text/javascript" src="/web/static/src/js/core/translation.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/ajax.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/time.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/mixins.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/rpc.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/widget.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/registry.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/session.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/concurrency.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/utils.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/qweb.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/bus.js"></script>
<script type="text/javascript" src="/web/static/src/js/services/core.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/local_storage.js"></script>
<script type="text/javascript" src="/web/static/src/js/services/local_storage_service.js"></script>
<!-- Bus, Mail, Livechat -->
<script type="text/javascript" src="/bus/static/src/js/bus.js"></script>
<script type="text/javascript" src="/mail/static/src/js/chat_window.js"></script>
<script type="text/javascript" src="/mail/static/src/js/thread.js"></script>
<script type="text/javascript" src="/mail/static/src/js/document_viewer.js"></script>
<script type="text/javascript" src="/im_livechat/static/src/js/im_livechat.js"></script>
<t t-call="web.less_helpers"/>
<link rel="stylesheet" href="/im_livechat/static/src/less/im_livechat_bootstrap.less"/>
<link rel="stylesheet" href="/mail/static/src/less/chat_window.less"></link>
<link rel="stylesheet" href="/mail/static/src/less/thread.less"></link>
<link rel="stylesheet" href="/im_livechat/static/src/less/im_livechat.less"/>
</template>
<!-- the js code to initialize the LiveSupport object -->
<template id="loader" name="Livechat : Javascript appending the livechat button">
<t t-translation="off">
<t t-if="not info">
<t t-set="info" t-value="request.env['im_livechat.channel'].get_livechat_info(channel)"/>
</t>
document.addEventListener("DOMContentLoaded", function(event) {
<t t-if="web_session_required">
flectra.define('web.session', function (require) {
var Session = require('web.Session');
var modules = flectra._modules;
return new Session(undefined, "<t t-esc="info['server_url']"/>", {modules:modules, use_cors: false});
});
</t>
flectra.define('im_livechat.livesupport', function (require) {
<t t-if="info['available']" t-translation="off">
var im_livechat = require('im_livechat.im_livechat');
var button = new im_livechat.LivechatButton(
$('body'),
"<t t-esc="info['server_url']"/>",
<t t-raw="json.dumps(info.get('options', {}))"/>
);
button.appendTo($('body'));
window.livechat_button = button;
</t>
});
});
</t>
</template>
</data>
</flectra>