Browse Source

[ADD] Initial Commit

pull/79/merge
Sreejith P 7 years ago
parent
commit
93ab208836
  1. 43
      website_hotjar/README.rst
  2. 5
      website_hotjar/__init__.py
  3. 43
      website_hotjar/__manifest__.py
  4. 4
      website_hotjar/models/__init__.py
  5. 34
      website_hotjar/models/res_config_settings.py
  6. 9
      website_hotjar/models/website.py
  7. BIN
      website_hotjar/static/description/banner.jpg
  8. BIN
      website_hotjar/static/description/cybro_logo.png
  9. BIN
      website_hotjar/static/description/icon.png
  10. 76
      website_hotjar/static/description/index.html
  11. BIN
      website_hotjar/static/description/tracking.gif
  12. BIN
      website_hotjar/static/description/tracking_code.png
  13. BIN
      website_hotjar/static/description/verify_installation.png
  14. BIN
      website_hotjar/static/description/website_settings.png
  15. 36
      website_hotjar/views/res_config_settings_views.xml
  16. 10
      website_hotjar/views/website_templates.xml

43
website_hotjar/README.rst

@ -0,0 +1,43 @@
Hotjar Analytics
================
Hotjar Analytics & Feedback for Odoo website
Depends
=======
[Website] addon Odoo
Tech
====
* [Python] - Models
* [XML] - Odoo views
Installation
============
- www.odoo.com/documentation/10.0/setup/install.html
- Install our custom addon
License
=======
GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3)
(http://www.gnu.org/licenses/agpl.html)
Bug Tracker
===========
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Credits
=======
* Cybrosys Techno Solutions <https://www.cybrosys.com>
Author
------
Developer: fasluca, faslu@cybrosys.in
Maintainer
----------
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com.

5
website_hotjar/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from . import models
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

43
website_hotjar/__manifest__.py

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Fasluca(<faslu@cybrosys.in>)
# you can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Hotjar Analytics',
'version': '11.0.1.0.0',
'summary': """Hotjar Analytics & Feedback for Odoo website""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "https://cybrosys.com/",
'category': 'Website',
'depends': ['website'],
'data': [
'views/res_config_settings_views.xml',
'views/website_templates.xml'
],
'demo': [],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'application': False
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

4
website_hotjar/models/__init__.py

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import website
from . import res_config_settings

34
website_hotjar/models/res_config_settings.py

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
from ast import literal_eval
from odoo import api, fields, models
from odoo.exceptions import AccessDenied
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
has_hotjar_analytics = fields.Boolean("Hotjar Analytics")
hotjar_analytics_script = fields.Text('Hotjar Analytics Script', related='website_id.hotjar_analytics_script')
@api.onchange('has_hotjar_analytics')
def onchange_has_hotjar_analytics(self):
if not self.has_hotjar_analytics:
self.hotjar_analytics_script = False
@api.model
def get_values(self):
res = super(ResConfigSettings, self).get_values()
get_param = self.env['ir.config_parameter'].sudo().get_param
res.update(
has_hotjar_analytics=get_param('website.has_hotjar_analytics'),
)
return res
def set_values(self):
if not self.user_has_groups('website.group_website_designer'):
raise AccessDenied()
super(ResConfigSettings, self).set_values()
set_param = self.env['ir.config_parameter'].sudo().set_param
set_param('website.has_hotjar_analytics', self.has_hotjar_analytics)

9
website_hotjar/models/website.py

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models
class Website(models.Model):
_inherit = "website"
hotjar_analytics_script = fields.Text('Hotjar Analytics Script')

BIN
website_hotjar/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
website_hotjar/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
website_hotjar/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

76
website_hotjar/static/description/index.html

@ -0,0 +1,76 @@
<section class="oe_container oe_dark">
<h2 class="oe_slogan">Hotjar Analytics</h2>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a></h4>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan"><b>Hotjar Analytics & Feedback for Odoo website</b></h3>
<h5 class="oe_slogan"><b>Step-1:Get Your Tracking Code from Hotjar</b></h5>
<div class="col-md-12">
<div class="oe_row_img oe_demo oe_picture oe_screenshot">
<img src="tracking_code.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h5 class="oe_slogan"><b>Step-2:Add Tracking Code to Website Settings</b></h5>
<div class="col-md-12">
<div class=" oe_demo oe_picture oe_screenshot">
<img src="website_settings.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h5 class="oe_slogan"><b>Step-3:Verify Installation</b></h5>
<div class="col-md-12">
<div class=" oe_demo oe_picture oe_screenshot">
<img src="verify_installation.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h5 class="oe_slogan"><b>Step-4:Enjoy Tracking in Hotjar</b></h5>
<div class="col-md-12">
<div class=" oe_demo oe_picture oe_screenshot">
<img src="tracking.gif">
</div>
</div>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
website_hotjar/static/description/tracking.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 MiB

BIN
website_hotjar/static/description/tracking_code.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
website_hotjar/static/description/verify_installation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
website_hotjar/static/description/website_settings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

36
website_hotjar/views/res_config_settings_views.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.website</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="20"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@data-key='website']/div[hasclass('o_settings_container')]/div[hasclass('o_setting_box')][5]" position="after">
<div class="col-xs-12 col-md-6 o_setting_box" id="google_analytics_setting">
<div class="o_setting_left_pane">
<field name="has_hotjar_analytics"/>
</div>
<div class="o_setting_right_pane">
<label for="has_hotjar_analytics"/>
<div class="text-muted">
Track visits in Hotjar Analytics
</div>
<div class="content-group" attrs="{'invisible': [('has_hotjar_analytics', '=', False)]}">
<div class="row mt16">
<label class="col-md-3 o_light_label" string="Hotjar Script" for="hotjar_analytics_script"/>
<field name="hotjar_analytics_script" placeholder="UA-XXXXXXXX-Y"/>
</div>
</div>
<!--<div attrs="{'invisible': [('has_google_analytics', '=', False)]}">-->
<!--<a href="https://www.odoo.com/documentation/user/11.0/website/optimize/google_analytics.html"-->
<!--class="oe_link fa fa-arrow-right" target="_blank">-->
<!--How to get my Tracking ID-->
<!--</a>-->
<!--</div>-->
</div>
</div>
</xpath>
</field>
</record>
</odoo>

10
website_hotjar/views/website_templates.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="layout_hotjar" inherit_id="website.layout">
<xpath expr="//t[@t-set='head_website']" position="inside">
<script type="text/javascript" name="Hotjar">
<t t-esc="website.hotjar_analytics_script"/>
</script>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save