Browse Source

Merge pull request #188 from OpenCode/8.0-add-test_ribbon_environment

Add module web_environment_ribbon
pull/181/merge
Daniel Reis 9 years ago
parent
commit
ff96180fa0
  1. 58
      web_environment_ribbon/README.rst
  2. 20
      web_environment_ribbon/__init__.py
  3. 39
      web_environment_ribbon/__openerp__.py
  4. BIN
      web_environment_ribbon/static/description/screenshot.png
  5. 24
      web_environment_ribbon/static/src/css/ribbon.css
  6. 21
      web_environment_ribbon/view/base_view.xml

58
web_environment_ribbon/README.rst

@ -0,0 +1,58 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Web Environment Ribbon
======================
Mark a Test Environment with a red ribbon on the top left corner in every page
.. image:: /web_environment_ribbon/static/description/screenshot.png
:alt: Screenshot
Installation
============
* No special setup
Configuration
=============
* No special setup
Usage
=====
To use this module, you need only to install it. After installation, a red ribbon will be visible on top left corner of every Odoo page
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/web/issues/new?body=module:%20web_environment_ribbon%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Francesco Apruzzese <cescoap@gmail.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.

20
web_environment_ribbon/__init__.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Francesco OpenCode Apruzzese (<cescoap@gmail.com>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

39
web_environment_ribbon/__openerp__.py

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Francesco OpenCode Apruzzese (<cescoap@gmail.com>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "Web Environment Ribbon",
'version': '0.1',
'category': 'Web',
'author': 'Francesco OpenCode Apruzzese,Odoo Community Association (OCA)',
'website': 'https://it.linkedin.com/in/francescoapruzzese',
'license': 'AGPL-3',
"depends": [
'web',
],
"data": [
'view/base_view.xml',
],
"update_xml": [],
"demo_xml": [],
"auto_install": False,
"installable": True
}

BIN
web_environment_ribbon/static/description/screenshot.png

After

Width: 607  |  Height: 198  |  Size: 43 KiB

24
web_environment_ribbon/static/src/css/ribbon.css

@ -0,0 +1,24 @@
.test-ribbon{
width: 200px;
background: #e43;
position: absolute;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
z-index: 10000;
position: fixed;
box-shadow: 0 0 3px rgba(0,0,0,.3);
background: #e43;
}
.test-ribbon b {
font-size: 20px;
}

21
web_environment_ribbon/view/base_view.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Load css for ribbons -->
<template id="assets_backend" name="ribbon_test assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/web_environment_ribbon/static/src/css/ribbon.css"/>
</xpath>
</template>
<!-- Add ribbon to page -->
<template id="body_with_ribbon_test" name="ribbon_test web.webclient_bootstrap" inherit_id="web.webclient_bootstrap">
<xpath expr="//div[@class='openerp openerp_webclient_container']" position="before">
<div class="test-ribbon"><b>TEST</b></div>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save