mirror of
https://github.com/bringout/oca-website.git
synced 2026-04-18 10:52:02 +02:00
Initial commit: OCA Website packages (16 packages)
This commit is contained in:
commit
0578ef7638
660 changed files with 37334 additions and 0 deletions
|
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="website.res_config_settings_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<div id="google_analytics_setting" position="after">
|
||||
<div
|
||||
class="col-xs-12 col-md-6 o_setting_box"
|
||||
id="matomo_analytics_setting"
|
||||
>
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="has_matomo_analytics" />
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="has_matomo_analytics" />
|
||||
<div class="text-muted">
|
||||
Track visits in Matomo Analytics
|
||||
</div>
|
||||
<div
|
||||
class="content-group"
|
||||
attrs="{'invisible': [('has_matomo_analytics', '=', False)]}"
|
||||
>
|
||||
<div class="row mt16">
|
||||
<label
|
||||
class="col-md-3 o_light_label"
|
||||
for="matomo_analytics_id"
|
||||
/>
|
||||
<field name="matomo_analytics_id" />
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label
|
||||
class="col-md-3 o_light_label"
|
||||
for="matomo_analytics_host"
|
||||
/>
|
||||
<field
|
||||
name="matomo_analytics_host"
|
||||
placeholder="https://matomo.host.name/"
|
||||
/>
|
||||
</div>
|
||||
<div class="row mt16" id="matomo_enable_userid">
|
||||
<div class="col-12">
|
||||
<label
|
||||
for="matomo_enable_userid"
|
||||
string="Enable User ID"
|
||||
class="p-0 col-4 o_light_label"
|
||||
/>
|
||||
<field
|
||||
name="matomo_enable_userid"
|
||||
class=" w-auto"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt16" id="matomo_enable_heartbeat">
|
||||
<div class="col-12">
|
||||
<label
|
||||
for="matomo_enable_heartbeat"
|
||||
string="Enable heartbeat"
|
||||
class="p-0 col-4 o_light_label"
|
||||
/>
|
||||
<field
|
||||
name="matomo_enable_heartbeat"
|
||||
class=" w-auto"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="content-group"
|
||||
attrs="{'invisible': [('matomo_enable_heartbeat', '=', False)]}"
|
||||
>
|
||||
<div class="text-muted">
|
||||
Set the Active Time in seconds. Only if the page was viewed for at least this
|
||||
amount of time (and the user leaves the page or focuses away from the tab)
|
||||
then a ping request will be sent.
|
||||
</div>
|
||||
<div class="row mt16">
|
||||
<label
|
||||
class="col-md-3 o_light_label"
|
||||
for="matomo_heartbeat_timer"
|
||||
string="Active Time (seconds)"
|
||||
/>
|
||||
<field name="matomo_heartbeat_timer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<template id="layout" inherit_id="website.layout">
|
||||
<xpath expr="//div[@id='wrapwrap']" position="after">
|
||||
<t
|
||||
t-if="website and website.has_matomo_analytics and website.matomo_analytics_host"
|
||||
>
|
||||
<script id="matomo_analytics" type="text/javascript">
|
||||
var _paq = window._paq = window._paq || [];
|
||||
<t t-if="website.matomo_enable_userid and website.user_id">
|
||||
_paq.push(['setUserId', '<t
|
||||
t-esc="website.matomo_get_userid"
|
||||
/>']);
|
||||
</t>
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
<t t-if="website.matomo_enable_heartbeat">
|
||||
_paq.push(['enableHeartBeatTimer', <t
|
||||
t-out="website.matomo_heartbeat_timer"
|
||||
/>]);
|
||||
</t>
|
||||
(function() {
|
||||
var u="<t t-out="website.matomo_analytics_host_url" />/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '<t
|
||||
t-out="website.matomo_analytics_id"
|
||||
/>']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img
|
||||
t-attf-src="#{website.matomo_analytics_host_url}/matomo.php?idsite='#{website.matomo_analytics_id}'"
|
||||
style="border:0;"
|
||||
alt=""
|
||||
/></p></noscript>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue