Browse Source
Merge pull request #1066 from Tecnativa/12.0-web_responsive
Merge pull request #1066 from Tecnativa/12.0-web_responsive
[MIG] web_responsive: Migrate to v12 and refactorpull/1156/head
Pedro M. Baeza
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 2341 additions and 0 deletions
-
155web_responsive/README.rst
-
1web_responsive/__init__.py
-
28web_responsive/__manifest__.py
-
71web_responsive/i18n/da.po
-
64web_responsive/i18n/de.po
-
85web_responsive/i18n/es.po
-
65web_responsive/i18n/hr.po
-
66web_responsive/i18n/pt_BR.po
-
82web_responsive/i18n/web_responsive.pot
-
1web_responsive/models/__init__.py
-
26web_responsive/models/res_users.py
-
5web_responsive/readme/CONTRIBUTORS.rst
-
57web_responsive/readme/DESCRIPTION.rst
-
6web_responsive/readme/ROADMAP.rst
-
6web_responsive/readme/USAGE.rst
-
BINweb_responsive/static/description/icon.png
-
495web_responsive/static/description/index.html
-
427web_responsive/static/src/css/web_responsive.scss
-
409web_responsive/static/src/js/web_responsive.js
-
58web_responsive/static/src/xml/apps.xml
-
141web_responsive/static/src/xml/form_view.xml
-
16web_responsive/static/src/xml/navbar.xml
-
1web_responsive/tests/__init__.py
-
16web_responsive/tests/test_res_users.py
-
20web_responsive/views/assets.xml
-
21web_responsive/views/res_users.xml
-
19web_responsive/views/web.xml
@ -0,0 +1,155 @@ |
|||
============== |
|||
Web Responsive |
|||
============== |
|||
|
|||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
|
|||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
|||
:target: https://odoo-community.org/page/development-status |
|||
:alt: Beta |
|||
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png |
|||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github |
|||
:target: https://github.com/OCA/web/tree/12.0/web_responsive |
|||
:alt: OCA/web |
|||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
|||
:target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_responsive |
|||
:alt: Translate me on Weblate |
|||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png |
|||
:target: https://runbot.odoo-community.org/runbot/162/12.0 |
|||
:alt: Try me on Runbot |
|||
|
|||
|badge1| |badge2| |badge3| |badge4| |badge5| |
|||
|
|||
This module adds responsiveness to web backend. |
|||
|
|||
Features for all devices: |
|||
|
|||
* New navigation with an app drawer |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417193-09a1e080-e74a-11e8-8a0c-e73eb689b2fb.gif |
|||
|
|||
* Quick menu search from the app drawer |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif |
|||
|
|||
Features for mobile: |
|||
|
|||
* App-specific submenus are shown on full screen when toggling them from the |
|||
"hamburger" menu |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417297-51286c80-e74a-11e8-9a47-22c810b18c43.gif |
|||
|
|||
* View type picker dropdown displays confortably |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50964322-e3d55580-14c6-11e9-8249-48db9539600f.gif |
|||
|
|||
* Top app bar is always visible, but the control panel is hidden when |
|||
scrolling down, to save some vaulable vertical space |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50964496-5cd4ad00-14c7-11e9-9261-fd223a329d02.gif |
|||
|
|||
* Form status bar action and status buttons are collapsed in dropdowns. |
|||
Other control panel buttons use icons to save space. |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50965446-e08f9900-14c9-11e9-92d6-dda472cb6557.gif |
|||
|
|||
* Breadcrumbs navigation is collapsed with a "back arrow" button. |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50965168-1d0ec500-14c9-11e9-82a0-dfee82ed0861.gif |
|||
|
|||
Features for computers: |
|||
|
|||
* Keyboard shortcuts for easier navigation, **using ``Alt + Shift + [key]``** |
|||
combination instead of just ``Alt + [key]``. |
|||
See https://github.com/odoo/odoo/issues/30068 to understand why. |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417578-ff341680-e74a-11e8-8881-017709e912bc.png |
|||
|
|||
|
|||
* Autofocus on search menu box when opening the drawer |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif |
|||
|
|||
* Set chatter on the side of the screen, optional per user |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417270-41108d00-e74a-11e8-9172-cba825d027ed.gif |
|||
|
|||
* Full width form sheets |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417428-ac5a5f00-e74a-11e8-8839-5bc538c54c1d.png |
|||
|
|||
**Table of contents** |
|||
|
|||
.. contents:: |
|||
:local: |
|||
|
|||
Usage |
|||
===== |
|||
|
|||
The following keyboard shortcuts are implemented: |
|||
|
|||
* Toggle app drawer - ``Alt + Shift + H`` |
|||
* Navigate app search results - Arrow keys |
|||
* Choose app result - ``Enter`` |
|||
* ``Esc`` to close app drawer |
|||
|
|||
Known issues / Roadmap |
|||
====================== |
|||
|
|||
* To view the full experience in a device, the page must be loaded with the |
|||
device screen size. This means that, if you change the size of your browser, |
|||
you should reload the web client to get the full experience for that |
|||
new size. This is Odoo's own limitation. |
|||
* App navigation with keyboard. |
|||
* Make it more beautiful. Maybe OCA-branded? |
|||
|
|||
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 <https://github.com/OCA/web/issues/new?body=module:%20web_responsive%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
Do not contact contributors directly about support or help with technical issues. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Authors |
|||
~~~~~~~ |
|||
|
|||
* LasLabs |
|||
* Tecnativa |
|||
* Alexandre Díaz |
|||
|
|||
Contributors |
|||
~~~~~~~~~~~~ |
|||
|
|||
* Dave Lasley <dave@laslabs.com> |
|||
* Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
* Dennis Sluijk <d.sluijk@onestein.nl> |
|||
* Sergio Teruel <sergio.teruel@tecnativa.com> |
|||
* Alexandre Díaz <dev@redneboa.es> |
|||
|
|||
Maintainers |
|||
~~~~~~~~~~~ |
|||
|
|||
This module is maintained by the OCA. |
|||
|
|||
.. image:: https://odoo-community.org/logo.png |
|||
:alt: Odoo Community Association |
|||
:target: https://odoo-community.org |
|||
|
|||
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. |
|||
|
|||
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_responsive>`_ project on GitHub. |
|||
|
|||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
@ -0,0 +1 @@ |
|||
from . import models |
@ -0,0 +1,28 @@ |
|||
# Copyright 2016-2017 LasLabs Inc. |
|||
# Copyright 2018 Alexandre Díaz |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
|
|||
{ |
|||
"name": "Web Responsive", |
|||
"summary": "Responsive web client, community-supported", |
|||
"version": "12.0.1.0.0", |
|||
"category": "Website", |
|||
"website": "https://github.com/OCA/web", |
|||
"author": "LasLabs, Tecnativa, Alexandre Díaz, " |
|||
"Odoo Community Association (OCA)", |
|||
"license": "LGPL-3", |
|||
"installable": True, |
|||
"depends": [ |
|||
'web', |
|||
], |
|||
"data": [ |
|||
'views/assets.xml', |
|||
'views/res_users.xml', |
|||
'views/web.xml', |
|||
], |
|||
'qweb': [ |
|||
'static/src/xml/apps.xml', |
|||
'static/src/xml/form_view.xml', |
|||
'static/src/xml/navbar.xml', |
|||
], |
|||
} |
@ -0,0 +1,71 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_responsive |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 11.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"PO-Revision-Date: 2018-09-02 05:11+0000\n" |
|||
"Last-Translator: Hans Henrik Gabelgaard <hhg@gabelgaard.org>\n" |
|||
"Language-Team: none\n" |
|||
"Language: da\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Plural-Forms: nplurals=2; plural=n != 1;\n" |
|||
"X-Generator: Weblate 3.1.1\n" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle App Drawer</span>" |
|||
msgstr "<span class=\"sr-only\">Skift App skuffe</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle Navigation</span>" |
|||
msgstr "<span class=\"sr-only\">Skift navigation</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "Apps" |
|||
msgstr "Applikationer" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model.fields,field_description:web_responsive.field_res_users_chatter_position |
|||
msgid "Chatter Position" |
|||
msgstr "Log position" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:35 |
|||
#, python-format |
|||
msgid "More" |
|||
msgstr "Mere" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "More <b class=\"caret\"/>" |
|||
msgstr "Mere <b class=\"caret\"/>" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Normal" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Sided" |
|||
msgstr "Side" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:54 |
|||
#, python-format |
|||
msgid "Task" |
|||
msgstr "Opgave" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_res_users |
|||
msgid "Users" |
|||
msgstr "Brugere" |
@ -0,0 +1,64 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_responsive |
|||
# |
|||
# Translators: |
|||
# Niki Waibel <niki.waibel@gmail.com>, 2017 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 10.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2017-02-03 01:37+0000\n" |
|||
"PO-Revision-Date: 2017-02-03 01:37+0000\n" |
|||
"Last-Translator: Niki Waibel <niki.waibel@gmail.com>, 2017\n" |
|||
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" |
|||
"Language: de\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle App Drawer</span>" |
|||
msgstr "<span class=\"sr-only\">App Ordner umschalten</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle Navigation</span>" |
|||
msgstr "<span class=\"sr-only\">Navigation umschalten</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "Apps" |
|||
msgstr "Apps" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model.fields,field_description:web_responsive.field_res_users_chatter_position |
|||
msgid "Chatter Position" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_ir_http |
|||
msgid "HTTP routing" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "More <b class=\"caret\"/>" |
|||
msgstr "Mehr <b class=\"caret\"/>" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Normal" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Sided" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_res_users |
|||
msgid "Users" |
|||
msgstr "" |
@ -0,0 +1,85 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_responsive |
|||
# |
|||
# Translators: |
|||
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2016 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 10.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2019-01-10 10:49+0000\n" |
|||
"PO-Revision-Date: 2019-01-10 10:50+0000\n" |
|||
"Last-Translator: Jairo Llopis <yajo.sk8@gmail.com>\n" |
|||
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" |
|||
"Language: es\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: 8bit\n" |
|||
"Plural-Forms: nplurals=2; plural=n != 1;\n" |
|||
"X-Generator: Poedit 2.2\n" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model.fields,field_description:web_responsive.field_res_users__chatter_position |
|||
msgid "Chatter Position" |
|||
msgstr "Posición del chatter" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:57 |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:96 |
|||
#, python-format |
|||
msgid "Create" |
|||
msgstr "Crear" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:71 |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:110 |
|||
#, python-format |
|||
msgid "Discard" |
|||
msgstr "Descartar" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:50 |
|||
#, python-format |
|||
msgid "Edit" |
|||
msgstr "Editar" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Normal" |
|||
msgstr "Normal" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:27 |
|||
#, python-format |
|||
msgid "Quick actions" |
|||
msgstr "Acciones rápidas" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:64 |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:103 |
|||
#, python-format |
|||
msgid "Save" |
|||
msgstr "Guardar" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/apps.xml:29 |
|||
#, python-format |
|||
msgid "Search menus..." |
|||
msgstr "Buscar menús..." |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Sided" |
|||
msgstr "Lateral" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_res_users |
|||
msgid "Users" |
|||
msgstr "Usuarios" |
@ -0,0 +1,65 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_responsive |
|||
# |
|||
# Translators: |
|||
# Bole <bole@dajmi5.com>, 2017 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 10.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2017-04-28 18:03+0000\n" |
|||
"PO-Revision-Date: 2017-04-28 18:03+0000\n" |
|||
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n" |
|||
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" |
|||
"Language: hr\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" |
|||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle App Drawer</span>" |
|||
msgstr "<span class=\"sr-only\">Izmjeni izbornik aplikacije</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle Navigation</span>" |
|||
msgstr "<span class=\"sr-only\">Izmjeni navigaciju</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "Apps" |
|||
msgstr "Apikacije" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model.fields,field_description:web_responsive.field_res_users_chatter_position |
|||
msgid "Chatter Position" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_ir_http |
|||
msgid "HTTP routing" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "More <b class=\"caret\"/>" |
|||
msgstr "Više <b class=\"caret\"/>" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Normal" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Sided" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_res_users |
|||
msgid "Users" |
|||
msgstr "" |
@ -0,0 +1,66 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_responsive |
|||
# |
|||
# Translators: |
|||
# Rodrigo de Almeida Sottomaior Macedo <rmsolucoeseminformatic4@gmail.com>, 2017 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 10.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2017-06-22 08:27+0000\n" |
|||
"PO-Revision-Date: 2018-08-03 13:16+0000\n" |
|||
"Last-Translator: Rodrigo Macedo <rmsolucoeseminformatic4@gmail.com>\n" |
|||
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" |
|||
"23907/pt_BR/)\n" |
|||
"Language: pt_BR\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Plural-Forms: nplurals=2; plural=n > 1;\n" |
|||
"X-Generator: Weblate 3.1.1\n" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle App Drawer</span>" |
|||
msgstr "<span class=\"sr-only\">Aplicativo Desenhador Alternativo</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.webclient_bootstrap |
|||
msgid "<span class=\"sr-only\">Toggle Navigation</span>" |
|||
msgstr "<span class=\"sr-only\">Navegação Alternativa</span>" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "Apps" |
|||
msgstr "Aplicativos" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model.fields,field_description:web_responsive.field_res_users_chatter_position |
|||
msgid "Chatter Position" |
|||
msgstr "Posição do Chatter" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_ir_http |
|||
msgid "HTTP routing" |
|||
msgstr "roteamento HTTP" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.ui.view,arch_db:web_responsive.menu |
|||
msgid "More <b class=\"caret\"/>" |
|||
msgstr "Mais <b class=\"caret\"/>" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Normal" |
|||
msgstr "Normal" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Sided" |
|||
msgstr "Frente e verso" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_res_users |
|||
msgid "Users" |
|||
msgstr "Usuários" |
@ -0,0 +1,82 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_responsive |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 12.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2019-01-10 10:49+0000\n" |
|||
"PO-Revision-Date: 2019-01-10 10:49+0000\n" |
|||
"Last-Translator: <>\n" |
|||
"Language-Team: \n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Plural-Forms: \n" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model.fields,field_description:web_responsive.field_res_users__chatter_position |
|||
msgid "Chatter Position" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:57 |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:96 |
|||
#, python-format |
|||
msgid "Create" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:71 |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:110 |
|||
#, python-format |
|||
msgid "Discard" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:50 |
|||
#, python-format |
|||
msgid "Edit" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Normal" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:27 |
|||
#, python-format |
|||
msgid "Quick actions" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:64 |
|||
#: code:addons/web_responsive/static/src/xml/form_view.xml:103 |
|||
#, python-format |
|||
msgid "Save" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#. openerp-web |
|||
#: code:addons/web_responsive/static/src/xml/apps.xml:29 |
|||
#, python-format |
|||
msgid "Search menus..." |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: selection:res.users,chatter_position:0 |
|||
msgid "Sided" |
|||
msgstr "" |
|||
|
|||
#. module: web_responsive |
|||
#: model:ir.model,name:web_responsive.model_res_users |
|||
msgid "Users" |
|||
msgstr "" |
|||
|
@ -0,0 +1 @@ |
|||
from . import res_users |
@ -0,0 +1,26 @@ |
|||
# Copyright 2018 Alexandre Díaz |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from odoo import models, fields |
|||
|
|||
|
|||
class ResUsers(models.Model): |
|||
_inherit = 'res.users' |
|||
|
|||
chatter_position = fields.Selection([ |
|||
('normal', 'Normal'), |
|||
('sided', 'Sided'), |
|||
], string="Chatter Position", default='normal') |
|||
|
|||
def __init__(self, pool, cr): |
|||
""" Override of __init__ to add access rights. |
|||
Access rights are disabled by default, but allowed on some specific |
|||
fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS. |
|||
""" |
|||
super(ResUsers, self).__init__(pool, cr) |
|||
# duplicate list to avoid modifying the original reference |
|||
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS) |
|||
type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position']) |
|||
# duplicate list to avoid modifying the original reference |
|||
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS) |
|||
type(self).SELF_READABLE_FIELDS.extend(['chatter_position']) |
@ -0,0 +1,5 @@ |
|||
* Dave Lasley <dave@laslabs.com> |
|||
* Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
* Dennis Sluijk <d.sluijk@onestein.nl> |
|||
* Sergio Teruel <sergio.teruel@tecnativa.com> |
|||
* Alexandre Díaz <dev@redneboa.es> |
@ -0,0 +1,57 @@ |
|||
This module adds responsiveness to web backend. |
|||
|
|||
Features for all devices: |
|||
|
|||
* New navigation with an app drawer |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417193-09a1e080-e74a-11e8-8a0c-e73eb689b2fb.gif |
|||
|
|||
* Quick menu search from the app drawer |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif |
|||
|
|||
Features for mobile: |
|||
|
|||
* App-specific submenus are shown on full screen when toggling them from the |
|||
"hamburger" menu |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417297-51286c80-e74a-11e8-9a47-22c810b18c43.gif |
|||
|
|||
* View type picker dropdown displays confortably |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50964322-e3d55580-14c6-11e9-8249-48db9539600f.gif |
|||
|
|||
* Top app bar is always visible, but the control panel is hidden when |
|||
scrolling down, to save some vaulable vertical space |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50964496-5cd4ad00-14c7-11e9-9261-fd223a329d02.gif |
|||
|
|||
* Form status bar action and status buttons are collapsed in dropdowns. |
|||
Other control panel buttons use icons to save space. |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50965446-e08f9900-14c9-11e9-92d6-dda472cb6557.gif |
|||
|
|||
* Breadcrumbs navigation is collapsed with a "back arrow" button. |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/50965168-1d0ec500-14c9-11e9-82a0-dfee82ed0861.gif |
|||
|
|||
Features for computers: |
|||
|
|||
* Keyboard shortcuts for easier navigation, **using ``Alt + Shift + [key]``** |
|||
combination instead of just ``Alt + [key]``. |
|||
See https://github.com/odoo/odoo/issues/30068 to understand why. |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417578-ff341680-e74a-11e8-8881-017709e912bc.png |
|||
|
|||
|
|||
* Autofocus on search menu box when opening the drawer |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif |
|||
|
|||
* Set chatter on the side of the screen, optional per user |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417270-41108d00-e74a-11e8-9172-cba825d027ed.gif |
|||
|
|||
* Full width form sheets |
|||
|
|||
.. image:: https://user-images.githubusercontent.com/973709/48417428-ac5a5f00-e74a-11e8-8839-5bc538c54c1d.png |
@ -0,0 +1,6 @@ |
|||
* To view the full experience in a device, the page must be loaded with the |
|||
device screen size. This means that, if you change the size of your browser, |
|||
you should reload the web client to get the full experience for that |
|||
new size. This is Odoo's own limitation. |
|||
* App navigation with keyboard. |
|||
* Make it more beautiful. Maybe OCA-branded? |
@ -0,0 +1,6 @@ |
|||
The following keyboard shortcuts are implemented: |
|||
|
|||
* Toggle app drawer - ``Alt + Shift + H`` |
|||
* Navigate app search results - Arrow keys |
|||
* Choose app result - ``Enter`` |
|||
* ``Esc`` to close app drawer |
After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -0,0 +1,495 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" /> |
|||
<title>Web Responsive</title> |
|||
<style type="text/css"> |
|||
|
|||
/* |
|||
:Author: David Goodger (goodger@python.org) |
|||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ |
|||
:Copyright: This stylesheet has been placed in the public domain. |
|||
|
|||
Default cascading style sheet for the HTML output of Docutils. |
|||
|
|||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to |
|||
customize this style sheet. |
|||
*/ |
|||
|
|||
/* used to remove borders from tables and images */ |
|||
.borderless, table.borderless td, table.borderless th { |
|||
border: 0 } |
|||
|
|||
table.borderless td, table.borderless th { |
|||
/* Override padding for "table.docutils td" with "! important". |
|||
The right padding separates the table cells. */ |
|||
padding: 0 0.5em 0 0 ! important } |
|||
|
|||
.first { |
|||
/* Override more specific margin styles with "! important". */ |
|||
margin-top: 0 ! important } |
|||
|
|||
.last, .with-subtitle { |
|||
margin-bottom: 0 ! important } |
|||
|
|||
.hidden { |
|||
display: none } |
|||
|
|||
.subscript { |
|||
vertical-align: sub; |
|||
font-size: smaller } |
|||
|
|||
.superscript { |
|||
vertical-align: super; |
|||
font-size: smaller } |
|||
|
|||
a.toc-backref { |
|||
text-decoration: none ; |
|||
color: black } |
|||
|
|||
blockquote.epigraph { |
|||
margin: 2em 5em ; } |
|||
|
|||
dl.docutils dd { |
|||
margin-bottom: 0.5em } |
|||
|
|||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { |
|||
overflow: hidden; |
|||
} |
|||
|
|||
/* Uncomment (and remove this text!) to get bold-faced definition list terms |
|||
dl.docutils dt { |
|||
font-weight: bold } |
|||
*/ |
|||
|
|||
div.abstract { |
|||
margin: 2em 5em } |
|||
|
|||
div.abstract p.topic-title { |
|||
font-weight: bold ; |
|||
text-align: center } |
|||
|
|||
div.admonition, div.attention, div.caution, div.danger, div.error, |
|||
div.hint, div.important, div.note, div.tip, div.warning { |
|||
margin: 2em ; |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.admonition p.admonition-title, div.hint p.admonition-title, |
|||
div.important p.admonition-title, div.note p.admonition-title, |
|||
div.tip p.admonition-title { |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
div.attention p.admonition-title, div.caution p.admonition-title, |
|||
div.danger p.admonition-title, div.error p.admonition-title, |
|||
div.warning p.admonition-title, .code .error { |
|||
color: red ; |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
/* Uncomment (and remove this text!) to get reduced vertical space in |
|||
compound paragraphs. |
|||
div.compound .compound-first, div.compound .compound-middle { |
|||
margin-bottom: 0.5em } |
|||
|
|||
div.compound .compound-last, div.compound .compound-middle { |
|||
margin-top: 0.5em } |
|||
*/ |
|||
|
|||
div.dedication { |
|||
margin: 2em 5em ; |
|||
text-align: center ; |
|||
font-style: italic } |
|||
|
|||
div.dedication p.topic-title { |
|||
font-weight: bold ; |
|||
font-style: normal } |
|||
|
|||
div.figure { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
div.footer, div.header { |
|||
clear: both; |
|||
font-size: smaller } |
|||
|
|||
div.line-block { |
|||
display: block ; |
|||
margin-top: 1em ; |
|||
margin-bottom: 1em } |
|||
|
|||
div.line-block div.line-block { |
|||
margin-top: 0 ; |
|||
margin-bottom: 0 ; |
|||
margin-left: 1.5em } |
|||
|
|||
div.sidebar { |
|||
margin: 0 0 0.5em 1em ; |
|||
border: medium outset ; |
|||
padding: 1em ; |
|||
background-color: #ffffee ; |
|||
width: 40% ; |
|||
float: right ; |
|||
clear: right } |
|||
|
|||
div.sidebar p.rubric { |
|||
font-family: sans-serif ; |
|||
font-size: medium } |
|||
|
|||
div.system-messages { |
|||
margin: 5em } |
|||
|
|||
div.system-messages h1 { |
|||
color: red } |
|||
|
|||
div.system-message { |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.system-message p.system-message-title { |
|||
color: red ; |
|||
font-weight: bold } |
|||
|
|||
div.topic { |
|||
margin: 2em } |
|||
|
|||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, |
|||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { |
|||
margin-top: 0.4em } |
|||
|
|||
h1.title { |
|||
text-align: center } |
|||
|
|||
h2.subtitle { |
|||
text-align: center } |
|||
|
|||
hr.docutils { |
|||
width: 75% } |
|||
|
|||
img.align-left, .figure.align-left, object.align-left, table.align-left { |
|||
clear: left ; |
|||
float: left ; |
|||
margin-right: 1em } |
|||
|
|||
img.align-right, .figure.align-right, object.align-right, table.align-right { |
|||
clear: right ; |
|||
float: right ; |
|||
margin-left: 1em } |
|||
|
|||
img.align-center, .figure.align-center, object.align-center { |
|||
display: block; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
table.align-center { |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.align-left { |
|||
text-align: left } |
|||
|
|||
.align-center { |
|||
clear: both ; |
|||
text-align: center } |
|||
|
|||
.align-right { |
|||
text-align: right } |
|||
|
|||
/* reset inner alignment in figures */ |
|||
div.align-right { |
|||
text-align: inherit } |
|||
|
|||
/* div.align-center * { */ |
|||
/* text-align: left } */ |
|||
|
|||
.align-top { |
|||
vertical-align: top } |
|||
|
|||
.align-middle { |
|||
vertical-align: middle } |
|||
|
|||
.align-bottom { |
|||
vertical-align: bottom } |
|||
|
|||
ol.simple, ul.simple { |
|||
margin-bottom: 1em } |
|||
|
|||
ol.arabic { |
|||
list-style: decimal } |
|||
|
|||
ol.loweralpha { |
|||
list-style: lower-alpha } |
|||
|
|||
ol.upperalpha { |
|||
list-style: upper-alpha } |
|||
|
|||
ol.lowerroman { |
|||
list-style: lower-roman } |
|||
|
|||
ol.upperroman { |
|||
list-style: upper-roman } |
|||
|
|||
p.attribution { |
|||
text-align: right ; |
|||
margin-left: 50% } |
|||
|
|||
p.caption { |
|||
font-style: italic } |
|||
|
|||
p.credits { |
|||
font-style: italic ; |
|||
font-size: smaller } |
|||
|
|||
p.label { |
|||
white-space: nowrap } |
|||
|
|||
p.rubric { |
|||
font-weight: bold ; |
|||
font-size: larger ; |
|||
color: maroon ; |
|||
text-align: center } |
|||
|
|||
p.sidebar-title { |
|||
font-family: sans-serif ; |
|||
font-weight: bold ; |
|||
font-size: larger } |
|||
|
|||
p.sidebar-subtitle { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
p.topic-title { |
|||
font-weight: bold } |
|||
|
|||
pre.address { |
|||
margin-bottom: 0 ; |
|||
margin-top: 0 ; |
|||
font: inherit } |
|||
|
|||
pre.literal-block, pre.doctest-block, pre.math, pre.code { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
pre.code .ln { color: grey; } /* line numbers */ |
|||
pre.code, code { background-color: #eeeeee } |
|||
pre.code .comment, code .comment { color: #5C6576 } |
|||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } |
|||
pre.code .literal.string, code .literal.string { color: #0C5404 } |
|||
pre.code .name.builtin, code .name.builtin { color: #352B84 } |
|||
pre.code .deleted, code .deleted { background-color: #DEB0A1} |
|||
pre.code .inserted, code .inserted { background-color: #A3D289} |
|||
|
|||
span.classifier { |
|||
font-family: sans-serif ; |
|||
font-style: oblique } |
|||
|
|||
span.classifier-delimiter { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
span.interpreted { |
|||
font-family: sans-serif } |
|||
|
|||
span.option { |
|||
white-space: nowrap } |
|||
|
|||
span.pre { |
|||
white-space: pre } |
|||
|
|||
span.problematic { |
|||
color: red } |
|||
|
|||
span.section-subtitle { |
|||
/* font-size relative to parent (h1..h6 element) */ |
|||
font-size: 80% } |
|||
|
|||
table.citation { |
|||
border-left: solid 1px gray; |
|||
margin-left: 1px } |
|||
|
|||
table.docinfo { |
|||
margin: 2em 4em } |
|||
|
|||
table.docutils { |
|||
margin-top: 0.5em ; |
|||
margin-bottom: 0.5em } |
|||
|
|||
table.footnote { |
|||
border-left: solid 1px black; |
|||
margin-left: 1px } |
|||
|
|||
table.docutils td, table.docutils th, |
|||
table.docinfo td, table.docinfo th { |
|||
padding-left: 0.5em ; |
|||
padding-right: 0.5em ; |
|||
vertical-align: top } |
|||
|
|||
table.docutils th.field-name, table.docinfo th.docinfo-name { |
|||
font-weight: bold ; |
|||
text-align: left ; |
|||
white-space: nowrap ; |
|||
padding-left: 0 } |
|||
|
|||
/* "booktabs" style (no vertical lines) */ |
|||
table.docutils.booktabs { |
|||
border: 0px; |
|||
border-top: 2px solid; |
|||
border-bottom: 2px solid; |
|||
border-collapse: collapse; |
|||
} |
|||
table.docutils.booktabs * { |
|||
border: 0px; |
|||
} |
|||
table.docutils.booktabs th { |
|||
border-bottom: thin solid; |
|||
text-align: left; |
|||
} |
|||
|
|||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, |
|||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { |
|||
font-size: 100% } |
|||
|
|||
ul.auto-toc { |
|||
list-style-type: none } |
|||
|
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div class="document" id="web-responsive"> |
|||
<h1 class="title">Web Responsive</h1> |
|||
|
|||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> |
|||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_responsive"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_responsive"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> |
|||
<p>This module adds responsiveness to web backend.</p> |
|||
<p>Features for all devices:</p> |
|||
<ul> |
|||
<li><p class="first">New navigation with an app drawer</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/48417193-09a1e080-e74a-11e8-8a0c-e73eb689b2fb.gif" src="https://user-images.githubusercontent.com/973709/48417193-09a1e080-e74a-11e8-8a0c-e73eb689b2fb.gif" /> |
|||
</li> |
|||
<li><p class="first">Quick menu search from the app drawer</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif" src="https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif" /> |
|||
</li> |
|||
</ul> |
|||
<p>Features for mobile:</p> |
|||
<ul> |
|||
<li><p class="first">App-specific submenus are shown on full screen when toggling them from the |
|||
“hamburger” menu</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/48417297-51286c80-e74a-11e8-9a47-22c810b18c43.gif" src="https://user-images.githubusercontent.com/973709/48417297-51286c80-e74a-11e8-9a47-22c810b18c43.gif" /> |
|||
</li> |
|||
<li><p class="first">View type picker dropdown displays confortably</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/50964322-e3d55580-14c6-11e9-8249-48db9539600f.gif" src="https://user-images.githubusercontent.com/973709/50964322-e3d55580-14c6-11e9-8249-48db9539600f.gif" /> |
|||
</li> |
|||
<li><p class="first">Top app bar is always visible, but the control panel is hidden when |
|||
scrolling down, to save some vaulable vertical space</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/50964496-5cd4ad00-14c7-11e9-9261-fd223a329d02.gif" src="https://user-images.githubusercontent.com/973709/50964496-5cd4ad00-14c7-11e9-9261-fd223a329d02.gif" /> |
|||
</li> |
|||
<li><p class="first">Form status bar action and status buttons are collapsed in dropdowns. |
|||
Other control panel buttons use icons to save space.</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/50965446-e08f9900-14c9-11e9-92d6-dda472cb6557.gif" src="https://user-images.githubusercontent.com/973709/50965446-e08f9900-14c9-11e9-92d6-dda472cb6557.gif" /> |
|||
</li> |
|||
<li><p class="first">Breadcrumbs navigation is collapsed with a “back arrow” button.</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/50965168-1d0ec500-14c9-11e9-82a0-dfee82ed0861.gif" src="https://user-images.githubusercontent.com/973709/50965168-1d0ec500-14c9-11e9-82a0-dfee82ed0861.gif" /> |
|||
</li> |
|||
</ul> |
|||
<p>Features for computers:</p> |
|||
<ul> |
|||
<li><p class="first">Keyboard shortcuts for easier navigation, <strong>using ``Alt + Shift + [key]``</strong> |
|||
combination instead of just <tt class="docutils literal">Alt + [key]</tt>. |
|||
See <a class="reference external" href="https://github.com/odoo/odoo/issues/30068">https://github.com/odoo/odoo/issues/30068</a> to understand why.</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/48417578-ff341680-e74a-11e8-8881-017709e912bc.png" src="https://user-images.githubusercontent.com/973709/48417578-ff341680-e74a-11e8-8881-017709e912bc.png" /> |
|||
</li> |
|||
<li><p class="first">Autofocus on search menu box when opening the drawer</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif" src="https://user-images.githubusercontent.com/973709/48417213-17576600-e74a-11e8-846a-57691e82636b.gif" /> |
|||
</li> |
|||
<li><p class="first">Set chatter on the side of the screen, optional per user</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/48417270-41108d00-e74a-11e8-9172-cba825d027ed.gif" src="https://user-images.githubusercontent.com/973709/48417270-41108d00-e74a-11e8-9172-cba825d027ed.gif" /> |
|||
</li> |
|||
<li><p class="first">Full width form sheets</p> |
|||
<img alt="https://user-images.githubusercontent.com/973709/48417428-ac5a5f00-e74a-11e8-8839-5bc538c54c1d.png" src="https://user-images.githubusercontent.com/973709/48417428-ac5a5f00-e74a-11e8-8839-5bc538c54c1d.png" /> |
|||
</li> |
|||
</ul> |
|||
<p><strong>Table of contents</strong></p> |
|||
<div class="contents local topic" id="contents"> |
|||
<ul class="simple"> |
|||
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li> |
|||
<li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li> |
|||
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li> |
|||
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul> |
|||
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li> |
|||
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li> |
|||
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li> |
|||
</ul> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="usage"> |
|||
<h1><a class="toc-backref" href="#id1">Usage</a></h1> |
|||
<p>The following keyboard shortcuts are implemented:</p> |
|||
<ul class="simple"> |
|||
<li>Toggle app drawer - <tt class="docutils literal">Alt + Shift + H</tt></li> |
|||
<li>Navigate app search results - Arrow keys</li> |
|||
<li>Choose app result - <tt class="docutils literal">Enter</tt></li> |
|||
<li><tt class="docutils literal">Esc</tt> to close app drawer</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="known-issues-roadmap"> |
|||
<h1><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h1> |
|||
<ul class="simple"> |
|||
<li>To view the full experience in a device, the page must be loaded with the |
|||
device screen size. This means that, if you change the size of your browser, |
|||
you should reload the web client to get the full experience for that |
|||
new size. This is Odoo’s own limitation.</li> |
|||
<li>App navigation with keyboard.</li> |
|||
<li>Make it more beautiful. Maybe OCA-branded?</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="bug-tracker"> |
|||
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1> |
|||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. |
|||
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 |
|||
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_responsive%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
|||
<p>Do not contact contributors directly about support or help with technical issues.</p> |
|||
</div> |
|||
<div class="section" id="credits"> |
|||
<h1><a class="toc-backref" href="#id4">Credits</a></h1> |
|||
<div class="section" id="authors"> |
|||
<h2><a class="toc-backref" href="#id5">Authors</a></h2> |
|||
<ul class="simple"> |
|||
<li>LasLabs</li> |
|||
<li>Tecnativa</li> |
|||
<li>Alexandre Díaz</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="contributors"> |
|||
<h2><a class="toc-backref" href="#id6">Contributors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Dave Lasley <<a class="reference external" href="mailto:dave@laslabs.com">dave@laslabs.com</a>></li> |
|||
<li>Jairo Llopis <<a class="reference external" href="mailto:jairo.llopis@tecnativa.com">jairo.llopis@tecnativa.com</a>></li> |
|||
<li>Dennis Sluijk <<a class="reference external" href="mailto:d.sluijk@onestein.nl">d.sluijk@onestein.nl</a>></li> |
|||
<li>Sergio Teruel <<a class="reference external" href="mailto:sergio.teruel@tecnativa.com">sergio.teruel@tecnativa.com</a>></li> |
|||
<li>Alexandre Díaz <<a class="reference external" href="mailto:dev@redneboa.es">dev@redneboa.es</a>></li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="maintainers"> |
|||
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2> |
|||
<p>This module is maintained by the OCA.</p> |
|||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> |
|||
<p>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.</p> |
|||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_responsive">OCA/web</a> project on GitHub.</p> |
|||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,427 @@ |
|||
/* Copyright 2018 Tecnativa - Jairo Llopis |
|||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ |
|||
|
|||
@mixin full-screen-dropdown { |
|||
border: none; |
|||
box-shadow: none; |
|||
display: flex; |
|||
flex-direction: column; |
|||
height: calc(100vh - #{$o-navbar-height}); |
|||
max-height: calc(100vh - #{$o-navbar-height}); |
|||
position: fixed; |
|||
width: 100vw; |
|||
z-index: 100; |
|||
// Inline style will override our `top`, so we need !important here |
|||
top: $o-navbar-height !important; |
|||
transform: none !important; |
|||
} |
|||
|
|||
// Main navbar (with apps menu, user menu, debug menu...) |
|||
@include media-breakpoint-down(sm) { |
|||
.o_main_navbar { |
|||
// This allows to have a sane layout for mobiles |
|||
display: flex; |
|||
|
|||
// Remove clutter to only have small icons that fit in a small screen |
|||
> .dropdown { |
|||
display: flex; |
|||
|
|||
.navbar-toggler { |
|||
color: white; |
|||
} |
|||
|
|||
.o_menu_sections, |
|||
.o_menu_systray, |
|||
{ |
|||
padding: 0; |
|||
} |
|||
} |
|||
|
|||
// Whitespace before systray icons |
|||
.o_menu_systray { |
|||
margin-left: auto; |
|||
} |
|||
|
|||
// Hide big things |
|||
.o_menu_brand, |
|||
.o_menu_sections, |
|||
.oe_topbar_name, |
|||
{ |
|||
display: none; |
|||
} |
|||
|
|||
// Fix toggler button padding |
|||
.o-menu-toggle { |
|||
cursor: pointer; |
|||
padding: 0 $o-horizontal-padding; |
|||
} |
|||
|
|||
// Custom fullscreen layout when showing submenus |
|||
.o_menu_sections.show { |
|||
@include full-screen-dropdown(); |
|||
background-color: $dropdown-bg; |
|||
|
|||
.show { |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.dropdown-menu { |
|||
margin-left: 1rem; |
|||
min-width: auto; |
|||
width: calc(100vw - 2rem); |
|||
} |
|||
} |
|||
|
|||
> li, |
|||
.o_menu_entry_lvl_1, |
|||
.o_menu_header_lvl_1, |
|||
{ |
|||
// Homogeneous background color |
|||
background-color: $dropdown-bg; |
|||
color: $dropdown-link-color; |
|||
|
|||
&:hover { |
|||
background-color: $dropdown-link-hover-bg; |
|||
color: $dropdown-link-hover-color; |
|||
} |
|||
|
|||
// Disable the .o-no-caret class effect, to display the caret |
|||
&.o-no-caret::after { |
|||
content: ""; |
|||
} |
|||
|
|||
// Fix a strange glitch leaving headers invisible |
|||
.dropdown-header { |
|||
color: $dropdown-header-color; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Custom fullscreen layout for systray items |
|||
.o_mail_systray_dropdown.show { |
|||
@include full-screen-dropdown(); |
|||
|
|||
// Fix stretchy images |
|||
.o_mail_preview_image { |
|||
align-items: center; |
|||
display: flex; |
|||
flex-direction: row; |
|||
|
|||
img { |
|||
display: block; |
|||
height: auto; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Higher height for dropdown items, for those with sausage fingers |
|||
.dropdown-menu .dropdown-item { |
|||
padding: { |
|||
bottom: 0.5rem; |
|||
top: 0.5rem; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Iconized full screen apps menu |
|||
.o_menu_apps { |
|||
|
|||
.search-input:focus { |
|||
border-color: $o-brand-primary; |
|||
} |
|||
|
|||
.dropdown-menu.show { |
|||
@include full-screen-dropdown(); |
|||
|
|||
// Display apps in a grid |
|||
align-content: flex-start; |
|||
display: flex; |
|||
flex-direction: row; |
|||
flex-wrap: wrap; |
|||
justify-content: flex-start; |
|||
|
|||
@include media-breakpoint-up(lg) { |
|||
padding: { |
|||
left: 20vw; |
|||
right: 20vw; |
|||
} |
|||
} |
|||
|
|||
.o_app { |
|||
align-items: center; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: flex-start; |
|||
|
|||
// Size depends on screen |
|||
width: 33.33333333%; |
|||
@include media-breakpoint-up(sm) { |
|||
width: 25%; |
|||
} |
|||
@include media-breakpoint-up(md) { |
|||
width: 16.6666666%; |
|||
} |
|||
} |
|||
|
|||
// Hide app icons when searching |
|||
.has-results ~ .o_app { |
|||
display: none; |
|||
} |
|||
|
|||
.o-app-icon { |
|||
height: auto; |
|||
max-width: 7rem; |
|||
width: 100%; |
|||
} |
|||
|
|||
// Search input for menus |
|||
.form-row { |
|||
width: 100%; |
|||
} |
|||
|
|||
.o-menu-search-result { |
|||
align-items: center; |
|||
background-position: left; |
|||
background-repeat: no-repeat; |
|||
background-size: contain; |
|||
cursor: pointer; |
|||
display: flex; |
|||
padding-left: 3rem; |
|||
white-space: normal; |
|||
} |
|||
|
|||
// Allow to scroll only on results, keeping static search box above |
|||
.search-container.has-results { |
|||
height: 100%; |
|||
|
|||
.search-input { |
|||
height: 3em; |
|||
} |
|||
|
|||
.search-results { |
|||
height: calc(100% - 3em); |
|||
overflow: auto; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Scroll all but top bar |
|||
html .o_web_client .o_main .o_main_content { |
|||
@include media-breakpoint-down(sm) { |
|||
overflow: auto; |
|||
|
|||
.o_content { |
|||
overflow: initial; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Control panel (breadcrumbs, search box, buttons...) |
|||
@include media-breakpoint-down(sm) { |
|||
.o_control_panel { |
|||
// Arrange buttons to use space better |
|||
.breadcrumb, |
|||
.o_cp_buttons, |
|||
.o_cp_left, |
|||
.o_cp_right, |
|||
.o_cp_searchview, |
|||
{ |
|||
flex: 1 1 100%; |
|||
@include media-breakpoint-up(md) { |
|||
flex-basis: 50%; |
|||
} |
|||
} |
|||
|
|||
.breadcrumb { |
|||
flex-basis: 80%; |
|||
} |
|||
|
|||
.o_cp_searchview, |
|||
.o_cp_right, |
|||
{ |
|||
flex-basis: 10%; |
|||
} |
|||
|
|||
.o_cp_left { |
|||
flex-basis: 50%; |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
.o_cp_pager { |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
// Hide all but 2 last breadcrumbs, and render 2nd-to-last as arrow |
|||
.breadcrumb-item { |
|||
&:not(.active) { |
|||
padding-left: 0; |
|||
} |
|||
|
|||
&::before { |
|||
content: none; |
|||
padding-right: 0; |
|||
} |
|||
|
|||
&:nth-last-of-type(1n+3) { |
|||
display: none; |
|||
} |
|||
|
|||
&:nth-last-of-type(2) { |
|||
&::before { |
|||
color: var(--primary); |
|||
content: "\f048"; // .fa-step-backward |
|||
cursor: pointer; |
|||
font-family: FontAwesome; |
|||
} |
|||
|
|||
a { |
|||
display: none; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Ellipsize long breadcrumbs |
|||
.breadcrumb { |
|||
max-width: 100%; |
|||
text-overflow: ellipsis; |
|||
} |
|||
|
|||
// Empty sidebar should not break layout |
|||
.o_cp_sidebar:blank { |
|||
display: none; |
|||
} |
|||
|
|||
// In case you install `mail`, there is a mess on BS vs inline styles |
|||
// we need to fix |
|||
.o_cp_buttons .btn.d-block:not(.d-none) { |
|||
display: inline-block !important; |
|||
} |
|||
|
|||
// Dropdown with buttons to switch the view type |
|||
.o_cp_switch_buttons.show { |
|||
.dropdown-menu { |
|||
align-content: center; |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-around; |
|||
padding: 0; |
|||
|
|||
.btn { |
|||
border: { |
|||
bottom: 0; |
|||
radius: 0; |
|||
top: 0; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Normal views |
|||
.o_content, .modal-content { |
|||
max-width: 100%; |
|||
|
|||
// Form views |
|||
.o_form_view { |
|||
.o_form_sheet { |
|||
max-width: calc(100% - 32px); |
|||
} |
|||
|
|||
@include media-breakpoint-down(sm) { |
|||
min-width: auto; |
|||
|
|||
// Avoid overflow on forms with title and/or button box |
|||
.oe_button_box, |
|||
.oe_title, |
|||
{ |
|||
max-width: 100%; |
|||
} |
|||
|
|||
// Avoid overflow on modals |
|||
.o_form_sheet { |
|||
min-width: auto; |
|||
} |
|||
|
|||
// Render website inputs properly in phones |
|||
.o_group .o_field_widget.o_text_overflow { |
|||
// Overrides another !important |
|||
width: auto !important; |
|||
} |
|||
|
|||
// Make all input groups vertical |
|||
.o_group_col_6 { |
|||
width: 100%; |
|||
} |
|||
|
|||
// Statusbar buttons dropdown for mobiles |
|||
.o_statusbar_buttons_dropdown { |
|||
border: { |
|||
bottom: 0; |
|||
radius: 0; |
|||
top: 0; |
|||
} |
|||
height: 100%; |
|||
} |
|||
.o_statusbar_buttons > .btn { |
|||
border-radius: 0; |
|||
border: 0; |
|||
width: 100%; |
|||
margin-bottom: 0.2rem; |
|||
|
|||
&:last-child { |
|||
margin-bottom: 0; |
|||
} |
|||
} |
|||
|
|||
.o_statusbar_status { |
|||
// Arrow from rightmost button exceeds allowed width |
|||
.o_arrow_button:first-child::before { |
|||
content: none; |
|||
display: none; |
|||
} |
|||
} |
|||
|
|||
// Full width in form sheets |
|||
.o_form_sheet, |
|||
.oe_chatter, |
|||
{ |
|||
min-width: auto; |
|||
max-width: 98%; |
|||
} |
|||
|
|||
// Settings pages |
|||
.app_settings_block { |
|||
.row { |
|||
margin: 0; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Sided chatter, if user wants |
|||
.o_chatter_position_sided & { |
|||
@include media-breakpoint-up(md) { |
|||
.o_form_view:not(.o_form_nosheet) { |
|||
display: flex; |
|||
flex-flow: row nowrap; |
|||
height: 100%; |
|||
|
|||
.o_form_sheet_bg { |
|||
flex: 1 1 60%; |
|||
overflow: auto; |
|||
} |
|||
|
|||
.o_chatter { |
|||
border-left: 1px solid gray('400'); |
|||
flex: 1 1 40%; |
|||
max-width: 50%; |
|||
min-width: 30%; |
|||
overflow: auto; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,409 @@ |
|||
/* Copyright 2018 Tecnativa - Jairo Llopis |
|||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
|||
|
|||
odoo.define('web_responsive', function (require) { |
|||
'use strict'; |
|||
|
|||
var AbstractWebClient = require("web.AbstractWebClient"); |
|||
var AppsMenu = require("web.AppsMenu"); |
|||
var config = require("web.config"); |
|||
var core = require("web.core"); |
|||
var FormRenderer = require('web.FormRenderer'); |
|||
var Menu = require("web.Menu"); |
|||
var RelationalFields = require('web.relational_fields'); |
|||
|
|||
/** |
|||
* Reduce menu data to a searchable format understandable by fuzzy.js |
|||
* |
|||
* `AppsMenu.init()` gets `menuData` in a format similar to this (only |
|||
* relevant data is shown): |
|||
* |
|||
* ```js
|
|||
* { |
|||
* [...], |
|||
* children: [ |
|||
* // This is a menu entry:
|
|||
* { |
|||
* action: "ir.actions.client,94", // Or `false`
|
|||
* children: [... similar to above "children" key], |
|||
* name: "Actions", |
|||
* parent_id: [146, "Settings/Technical/Actions"], // Or `false`
|
|||
* }, |
|||
* ... |
|||
* ] |
|||
* } |
|||
* ```
|
|||
* |
|||
* This format is very hard to process to search matches, and it would |
|||
* slow down the search algorithm, so we reduce it with this method to be |
|||
* able to later implement a simpler search. |
|||
* |
|||
* @param {Object} memo |
|||
* Reference to current result object, passed on recursive calls. |
|||
* |
|||
* @param {Object} menu |
|||
* A menu entry, as described above. |
|||
* |
|||
* @returns {Object} |
|||
* Reduced object, without entries that have no action, and with a |
|||
* format like this: |
|||
* |
|||
* ```js
|
|||
* { |
|||
* "Discuss": {Menu entry Object}, |
|||
* "Settings": {Menu entry Object}, |
|||
* "Settings/Technical/Actions/Actions": {Menu entry Object}, |
|||
* ... |
|||
* } |
|||
* ```
|
|||
*/ |
|||
function findNames (memo, menu) { |
|||
if (menu.action) { |
|||
var key = menu.parent_id ? menu.parent_id[1] + "/" : ""; |
|||
memo[key + menu.name] = menu; |
|||
} |
|||
if (menu.children.length) { |
|||
_.reduce(menu.children, findNames, memo); |
|||
} |
|||
return memo; |
|||
} |
|||
|
|||
AppsMenu.include({ |
|||
events: _.extend({ |
|||
"keydown .search-input input": "_searchResultsNavigate", |
|||
"click .o-menu-search-result": "_searchResultChosen", |
|||
"shown.bs.dropdown": "_searchFocus", |
|||
"hidden.bs.dropdown": "_searchReset", |
|||
}, AppsMenu.prototype.events), |
|||
|
|||
/** |
|||
* Rescue some menu data stripped out in original method. |
|||
* |
|||
* @override |
|||
*/ |
|||
init: function (parent, menuData) { |
|||
this._super.apply(this, arguments); |
|||
// Keep base64 icon for main menus
|
|||
for (var n in this._apps) { |
|||
this._apps[n].web_icon_data = |
|||
menuData.children[n].web_icon_data; |
|||
} |
|||
// Store menu data in a format searchable by fuzzy.js
|
|||
this._searchableMenus = _.reduce( |
|||
menuData.children, |
|||
findNames, |
|||
{} |
|||
); |
|||
// Search only after timeout, for fast typers
|
|||
this._search_def = $.Deferred(); |
|||
}, |
|||
|
|||
/** |
|||
* @override |
|||
*/ |
|||
start: function () { |
|||
this.$search_container = this.$(".search-container"); |
|||
this.$search_input = this.$(".search-input input"); |
|||
this.$search_results = this.$(".search-results"); |
|||
return this._super.apply(this, arguments); |
|||
}, |
|||
|
|||
/** |
|||
* Get all info for a given menu. |
|||
* |
|||
* @param {String} key |
|||
* Full path to requested menu. |
|||
* |
|||
* @returns {Object} |
|||
* Menu definition, plus extra needed keys. |
|||
*/ |
|||
_menuInfo: function (key) { |
|||
var original = this._searchableMenus[key]; |
|||
return _.extend({ |
|||
action_id: parseInt(original.action.split(',')[1], 10), |
|||
}, original); |
|||
}, |
|||
|
|||
/** |
|||
* Autofocus on search field on big screens. |
|||
*/ |
|||
_searchFocus: function () { |
|||
if (!config.device.isMobile) { |
|||
this.$search_input.focus(); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Reset search input and results |
|||
*/ |
|||
_searchReset: function () { |
|||
this.$search_container.removeClass("has-results"); |
|||
this.$search_results.empty(); |
|||
this.$search_input.val(""); |
|||
}, |
|||
|
|||
/** |
|||
* Schedule a search on current menu items. |
|||
*/ |
|||
_searchMenusSchedule: function () { |
|||
this._search_def.reject(); |
|||
this._search_def = $.Deferred(); |
|||
setTimeout(this._search_def.resolve.bind(this._search_def), 50); |
|||
this._search_def.done(this._searchMenus.bind(this)); |
|||
}, |
|||
|
|||
/** |
|||
* Search among available menu items, and render that search. |
|||
*/ |
|||
_searchMenus: function () { |
|||
var query = this.$search_input.val(); |
|||
if (query === "") { |
|||
this.$search_container.removeClass("has-results"); |
|||
this.$search_results.empty(); |
|||
return; |
|||
} |
|||
var results = fuzzy.filter( |
|||
query, |
|||
_.keys(this._searchableMenus), |
|||
{ |
|||
pre: "<b>", |
|||
post: "</b>", |
|||
} |
|||
); |
|||
this.$search_container.toggleClass( |
|||
"has-results", |
|||
Boolean(results.length) |
|||
); |
|||
this.$search_results.html( |
|||
core.qweb.render( |
|||
"web_responsive.MenuSearchResults", |
|||
{ |
|||
results: results, |
|||
widget: this, |
|||
} |
|||
) |
|||
); |
|||
}, |
|||
|
|||
/** |
|||
* Use chooses a search result, so we navigate to that menu |
|||
* |
|||
* @param {jQuery.Event} event |
|||
*/ |
|||
_searchResultChosen: function (event) { |
|||
event.preventDefault(); |
|||
var $result = $(event.currentTarget), |
|||
text = $result.text().trim(), |
|||
data = $result.data(), |
|||
suffix = ~text.indexOf("/") ? "/" : ""; |
|||
// Load the menu view
|
|||
this.trigger_up("menu_clicked", { |
|||
action_id: data.actionId, |
|||
id: data.menuId, |
|||
previous_menu_id: data.parentId, |
|||
}); |
|||
// Find app that owns the chosen menu
|
|||
var app = _.find(this._apps, function (_app) { |
|||
return text.indexOf(_app.name + suffix) === 0; |
|||
}); |
|||
// Update navbar menus
|
|||
core.bus.trigger("change_menu_section", app.menuID); |
|||
}, |
|||
|
|||
/** |
|||
* Navigate among search results |
|||
* |
|||
* @param {jQuery.Event} event |
|||
*/ |
|||
_searchResultsNavigate: function (event) { |
|||
// Exit soon when not navigating results
|
|||
if (this.$search_results.is(":empty")) { |
|||
// Just in case it is the 1st search
|
|||
this._searchMenusSchedule(); |
|||
return; |
|||
} |
|||
// Find current results and active element (1st by default)
|
|||
var all = this.$search_results.find(".o-menu-search-result"), |
|||
pre_focused = all.filter(".active") || $(all[0]), |
|||
offset = all.index(pre_focused), |
|||
key = event.key; |
|||
// Transform tab presses in arrow presses
|
|||
if (key === "Tab") { |
|||
event.preventDefault(); |
|||
key = event.shiftKey ? "ArrowUp" : "ArrowDown"; |
|||
} |
|||
switch (key) { |
|||
// Pressing enter is the same as clicking on the active element
|
|||
case "Enter": |
|||
pre_focused.click(); |
|||
break; |
|||
// Navigate up or down
|
|||
case "ArrowUp": |
|||
offset--; |
|||
break; |
|||
case "ArrowDown": |
|||
offset++; |
|||
break; |
|||
// Other keys trigger a search
|
|||
default: |
|||
this._searchMenusSchedule(); |
|||
return; |
|||
} |
|||
// Allow looping on results
|
|||
if (offset < 0) { |
|||
offset = all.length + offset; |
|||
} else if (offset >= all.length) { |
|||
offset -= all.length; |
|||
} |
|||
// Switch active element
|
|||
var new_focused = $(all[offset]); |
|||
pre_focused.removeClass("active"); |
|||
new_focused.addClass("active"); |
|||
this.$search_results.scrollTo(new_focused, { |
|||
offset: { |
|||
top: this.$search_results.height() * -0.5, |
|||
}, |
|||
}); |
|||
}, |
|||
}); |
|||
|
|||
Menu.include({ |
|||
events: _.extend({ |
|||
// Clicking a hamburger menu item should close the hamburger
|
|||
"click .o_menu_sections [role=menuitem]": "_hideMobileSubmenus", |
|||
// Opening any dropdown in the navbar should hide the hamburger
|
|||
"show.bs.dropdown .o_menu_systray, .o_menu_apps": |
|||
"_hideMobileSubmenus", |
|||
}, Menu.prototype.events), |
|||
|
|||
start: function () { |
|||
this.$menu_toggle = this.$(".o-menu-toggle"); |
|||
return this._super.apply(this, arguments); |
|||
}, |
|||
|
|||
/** |
|||
* Hide menus for current app if you're in mobile |
|||
*/ |
|||
_hideMobileSubmenus: function () { |
|||
if ( |
|||
this.$menu_toggle.is(":visible") && |
|||
this.$section_placeholder.is(":visible") |
|||
) { |
|||
this.$section_placeholder.collapse("hide"); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* No menu brand in mobiles |
|||
* |
|||
* @override |
|||
*/ |
|||
_updateMenuBrand: function () { |
|||
if (!config.device.isMobile) { |
|||
return this._super.apply(this, arguments); |
|||
} |
|||
}, |
|||
}); |
|||
|
|||
RelationalFields.FieldStatus.include({ |
|||
|
|||
/** |
|||
* Fold all on mobiles. |
|||
* |
|||
* @override |
|||
*/ |
|||
_setState: function () { |
|||
this._super.apply(this, arguments); |
|||
if (config.device.isMobile) { |
|||
_.map(this.status_information, function (value) { |
|||
value.fold = true; |
|||
}); |
|||
} |
|||
}, |
|||
}); |
|||
|
|||
// Responsive view "action" buttons
|
|||
FormRenderer.include({ |
|||
|
|||
/** |
|||
* In mobiles, put all statusbar buttons in a dropdown. |
|||
* |
|||
* @override |
|||
*/ |
|||
_renderHeaderButtons: function () { |
|||
var $buttons = this._super.apply(this, arguments); |
|||
if ( |
|||
!config.device.isMobile || |
|||
!$buttons.is(":has(>:not(.o_invisible_modifier))") |
|||
) { |
|||
return $buttons; |
|||
} |
|||
|
|||
// $buttons must be appended by JS because all events are bound
|
|||
$buttons.addClass("dropdown-menu"); |
|||
var $dropdown = $(core.qweb.render( |
|||
'web_responsive.MenuStatusbarButtons' |
|||
)); |
|||
$buttons.addClass("dropdown-menu").appendTo($dropdown); |
|||
return $dropdown; |
|||
}, |
|||
}); |
|||
|
|||
/** |
|||
* Use ALT+SHIFT instead of ALT as hotkey triggerer. |
|||
* |
|||
* HACK https://github.com/odoo/odoo/issues/30068 - See it to know why.
|
|||
* |
|||
* Cannot patch in `KeyboardNavigationMixin` directly because it's a mixin, |
|||
* not a `Class`, and altering a mixin's `prototype` doesn't alter it where |
|||
* it has already been used. |
|||
* |
|||
* Instead, we provide an additional mixin to be used wherever you need to |
|||
* enable this behavior. |
|||
*/ |
|||
var KeyboardNavigationShiftAltMixin = { |
|||
|
|||
/** |
|||
* Alter the key event to require pressing Shift. |
|||
* |
|||
* This will produce a mocked event object where it will seem that |
|||
* `Alt` is not pressed if `Shift` is not pressed. |
|||
* |
|||
* The reason for this is that original upstream code, found in |
|||
* `KeyboardNavigationMixin` is very hardcoded against the `Alt` key, |
|||
* so it is more maintainable to mock its input than to rewrite it |
|||
* completely. |
|||
* |
|||
* @param {keyEvent} keyEvent |
|||
* Original event object |
|||
* |
|||
* @returns {keyEvent} |
|||
* Altered event object |
|||
*/ |
|||
_shiftPressed: function (keyEvent) { |
|||
var alt = keyEvent.altKey || keyEvent.key === "Alt", |
|||
newEvent = _.extend({}, keyEvent), |
|||
shift = keyEvent.shiftKey || keyEvent.key === "Shift"; |
|||
// Mock event to make it seem like Alt is not pressed
|
|||
if (alt && !shift) { |
|||
newEvent.altKey = false; |
|||
if (newEvent.key === "Alt") { |
|||
newEvent.key = "Shift"; |
|||
} |
|||
} |
|||
return newEvent; |
|||
}, |
|||
|
|||
_onKeyDown: function (keyDownEvent) { |
|||
return this._super(this._shiftPressed(keyDownEvent)); |
|||
}, |
|||
|
|||
_onKeyUp: function (keyUpEvent) { |
|||
return this._super(this._shiftPressed(keyUpEvent)); |
|||
}, |
|||
}; |
|||
|
|||
// Include the SHIFT+ALT mixin wherever
|
|||
// `KeyboardNavigationMixin` is used upstream
|
|||
AbstractWebClient.include(KeyboardNavigationShiftAltMixin); |
|||
}); |
@ -0,0 +1,58 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- Copyright 2018 Tecnativa - Jairo Llopis |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
|
|||
<template> |
|||
<t t-extend="AppsMenu"> |
|||
<!-- App icons should be more than a text --> |
|||
<t t-jquery=".o_app > t" t-operation="replace"> |
|||
<t t-call="web_responsive.AppIcon"/> |
|||
</t> |
|||
|
|||
<!-- Same hotkey as in EE --> |
|||
<t t-jquery=".full" t-operation="attributes"> |
|||
<attribute name="accesskey">a</attribute> |
|||
</t> |
|||
|
|||
<!-- Search bar --> |
|||
<t t-jquery="[t-as=app]" t-operation="before"> |
|||
<div class="search-container form-row align-items-center mb-4 col-12"> |
|||
<div class="search-input col-md-10 ml-auto mr-auto mb-2"> |
|||
<div class="input-group"> |
|||
<div class="input-group-prepend"> |
|||
<div class="input-group-text"> |
|||
<i class="fa fa-search"/> |
|||
</div> |
|||
</div> |
|||
<input type="search" |
|||
placeholder="Search menus..." |
|||
class="form-control"/> |
|||
</div> |
|||
</div> |
|||
<div class="search-results col-md-10 ml-auto mr-auto"/> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
|
|||
<!-- Separate app icon template, for easier inheritance --> |
|||
<t t-name="web_responsive.AppIcon"> |
|||
<img class="o-app-icon" |
|||
t-attf-src="data:image/png;base64,#{app.web_icon_data}"/> |
|||
<span class="o-app-name"> |
|||
<t t-esc="app.name"/> |
|||
</span> |
|||
</t> |
|||
|
|||
<!-- A search result --> |
|||
<t t-name="web_responsive.MenuSearchResults"> |
|||
<t t-foreach="results" t-as="result"> |
|||
<t t-set="menu" t-value="widget._menuInfo(result.original)"/> |
|||
<div t-attf-class="o-menu-search-result dropdown-item col-12 ml-auto mr-auto #{result_first ? 'active' : ''}" |
|||
t-attf-style="background-image:url('data:image/png;base64,#{menu.web_icon_data}')" |
|||
t-att-data-menu-id="menu.id" |
|||
t-att-data-action-id="menu.action_id" |
|||
t-att-data-parent-id="menu.parent_id[0]" |
|||
t-raw="result.string"/> |
|||
</t> |
|||
</t> |
|||
</template> |
@ -0,0 +1,141 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Copyright 2017 LasLabs Inc. |
|||
Copyright 2018 Alexandre Díaz |
|||
Copyright 2018 Tecnativa - Jairo Llopis |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
--> |
|||
|
|||
<templates id="form_view" xml:space="preserve"> |
|||
|
|||
<!-- Template for buttons that display only the icon in xs --> |
|||
<t t-name="web_responsive.icon_button"> |
|||
<i t-attf-class="fa fa-#{icon}" |
|||
t-att-title="label"/> |
|||
<span class="d-none d-sm-inline" t-esc="label"/> |
|||
</t> |
|||
|
|||
<t t-name="web_responsive.MenuStatusbarButtons"> |
|||
<div class="dropdown"> |
|||
<button class="o_statusbar_buttons_dropdown btn btn-secondary dropdown-toggle" |
|||
type="button" |
|||
data-toggle="dropdown" |
|||
aria-haspopup="true" |
|||
aria-expanded="false"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'cogs'"/> |
|||
<t t-set="label">Quick actions</t> |
|||
</t> |
|||
</button> |
|||
<!-- A div.o_statusbar_buttons.dropdown-menu |
|||
is appended here from JS --> |
|||
</div> |
|||
</t> |
|||
|
|||
<t t-extend="FormView.buttons"> |
|||
<!-- Change "Edit" button hotkey to "E" --> |
|||
<t t-jquery=".o_form_button_edit" t-operation="attributes"> |
|||
<attribute name="accesskey">e</attribute> |
|||
</t> |
|||
|
|||
<!-- Change "Discard" button hotkey to "D" --> |
|||
<t t-jquery=".o_form_button_cancel" t-operation="attributes"> |
|||
<attribute name="accesskey">d</attribute> |
|||
</t> |
|||
|
|||
<!-- Add responsive icons to buttons --> |
|||
<t t-jquery=".o_form_button_edit" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'pencil'"/> |
|||
<t t-set="label">Edit</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-jquery=".o_form_button_create" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'plus'"/> |
|||
<t t-set="label">Create</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-jquery=".o_form_button_save" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'check'"/> |
|||
<t t-set="label">Save</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-jquery=".o_form_button_cancel" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'times'"/> |
|||
<t t-set="label">Discard</t> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-extend="KanbanView.buttons"> |
|||
<!-- Add responsive icons to buttons --> |
|||
<t t-jquery="button" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'plus'"/> |
|||
<t t-set="label" t-value="create_text || _t('Create')"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-extend="ListView.buttons"> |
|||
<!-- Change "Discard" button hotkey to "D" --> |
|||
<t t-jquery=".o_list_button_discard" t-operation="attributes"> |
|||
<attribute name="accesskey">d</attribute> |
|||
</t> |
|||
|
|||
<!-- Add responsive icons to buttons --> |
|||
<t t-jquery=".o_list_button_add" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'plus'"/> |
|||
<t t-set="label">Create</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-jquery=".o_list_button_save" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'check'"/> |
|||
<t t-set="label">Save</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-jquery=".o_list_button_discard" t-operation="inner"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'times'"/> |
|||
<t t-set="label">Discard</t> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
|
|||
<t t-extend="Sidebar"> |
|||
<!-- Replace some common sections by icons in mobile --> |
|||
<t t-jquery=".o_dropdown_toggler_btn t[t-esc='section.label']" |
|||
t-operation="replace"> |
|||
<t t-set="label" t-value="section.label"/> |
|||
<t t-if="section.name == 'files'"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'paperclip'"/> |
|||
</t> |
|||
</t> |
|||
<t t-elif="section.name == 'print'"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'print'"/> |
|||
</t> |
|||
</t> |
|||
<t t-elif="section.name == 'other'"> |
|||
<t t-call="web_responsive.icon_button"> |
|||
<t t-set="icon" t-value="'wrench'"/> |
|||
</t> |
|||
</t> |
|||
<t t-else=""> |
|||
<span t-esc="label"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
|
|||
</templates> |
@ -0,0 +1,16 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- Copyright 2017-2018 Tecnativa - Jairo Llopis |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
|
|||
<template> |
|||
<t t-extend="Menu"> |
|||
<t t-jquery=".o_menu_apps" t-operation="after"> |
|||
<!-- Hamburger button to show submenus in sm screens --> |
|||
<button class="o-menu-toggle d-md-none" |
|||
data-toggle="collapse" |
|||
data-target=".o_main_navbar .o_menu_sections"> |
|||
<i class="fa fa-bars"/> |
|||
</button> |
|||
</t> |
|||
</t> |
|||
</template> |
@ -0,0 +1 @@ |
|||
from . import test_res_users |
@ -0,0 +1,16 @@ |
|||
# Copyright 2018 Alexandre Díaz |
|||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
|
|||
from odoo.tests import common |
|||
|
|||
|
|||
class TestResUsers(common.TransactionCase): |
|||
|
|||
def test_chatter_position_wr(self): |
|||
user_public = self.env.ref('base.public_user') |
|||
|
|||
self.assertEqual(user_public.chatter_position, 'normal') |
|||
user_public.sudo(user_public).write({ |
|||
'chatter_position': 'sided', |
|||
}) |
|||
self.assertEqual(user_public.chatter_position, 'sided') |
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<!-- |
|||
Copyright 2016 LasLabs Inc. |
|||
@author Dave Lasley <dave@laslabs.com> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
--> |
|||
|
|||
<odoo> |
|||
<template id="assets_backend" name="Open Mobile Assets" inherit_id="web.assets_backend"> |
|||
<xpath expr="."> |
|||
<link rel="stylesheet" |
|||
href="/web_responsive/static/src/css/web_responsive.scss" |
|||
/> |
|||
<script type="application/javascript" |
|||
src="/web_responsive/static/src/js/web_responsive.js" |
|||
/> |
|||
</xpath> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0"?> |
|||
|
|||
<!-- |
|||
Copyright 2018 |
|||
@author Alexanre Díaz <dev@redneboa.es> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
--> |
|||
|
|||
<odoo> |
|||
|
|||
<record id="view_users_form_simple_modif" model="ir.ui.view"> |
|||
<field name="model">res.users</field> |
|||
<field name="inherit_id" ref="base.view_users_form_simple_modif" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='email']" position="after"> |
|||
<field name="chatter_position" readonly="0" /> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -0,0 +1,19 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<!-- |
|||
Copyright 2018 Alexandre Díaz |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). |
|||
--> |
|||
|
|||
<odoo> |
|||
|
|||
<template id="webclient_bootstrap" |
|||
inherit_id="web.webclient_bootstrap" |
|||
name="App Drawer - Web Client" |
|||
> |
|||
<xpath expr="//*[hasclass('o_main')]" position="attributes"> |
|||
<attribute name="t-attf-class">o_main o_chatter_position_{{ request.env.user.chatter_position or 'normal' }}</attribute> |
|||
</xpath> |
|||
</template> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue