Browse Source

Revert v10 migration changes to adapt to v9 again

Mostly rename things the other way around
than f83647946167a0e08053511eb97b3796ef273118:

- __manifest__.py -> __openerp__.py
- .o_sub_menu_content -> .oe_secondary_menus_container
- .o_sub_menu_logo -> .oe_logo
- .o_sub_menu_foote -> .oe_footer
- .o_sub_menu -> .oe_leftbar

It also includes a complete refactor of #514, to make it work in v9.
pull/529/head
Jairo Llopis 8 years ago
parent
commit
ac3c1de637
  1. 2
      web_responsive/README.rst
  2. 2
      web_responsive/__openerp__.py
  3. 2
      web_responsive/static/src/js/web_responsive.js
  4. 123
      web_responsive/static/src/less/form_view.less
  5. 6
      web_responsive/static/src/less/main.less
  6. 2
      web_responsive/static/src/less/navbar.less
  7. 4
      web_responsive/static/src/less/variables.less
  8. 2
      web_responsive/static/tests/js/web_responsive.js
  9. 2
      web_responsive/views/assets.xml
  10. 6
      web_responsive/views/web.xml

2
web_responsive/README.rst

@ -35,7 +35,7 @@ The following keyboard shortcuts are implemented:
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/154/10.0
:target: https://runbot.odoo-community.org/runbot/154/9.0
Known issues / Roadmap
======================

2
web_responsive/__manifest__.py → web_responsive/__openerp__.py

@ -6,7 +6,7 @@
"name": "Web Responsive",
"summary": "It provides a mobile compliant interface for Odoo Community "
"web",
"version": "10.0.1.0.0",
"version": "9.0.2.0.0",
"category": "Website",
"website": "https://laslabs.com/",
"author": "LasLabs, Tecnativa, Odoo Community Association (OCA)",

2
web_responsive/static/src/js/web_responsive.js

@ -120,7 +120,7 @@ odoo.define('web_responsive', function(require) {
// It provides handlers to hide drawer when "unfocused"
handleClickZones: function() {
this.$el.drawer('close');
$('.o_sub_menu_content')
$('.oe_secondary_menus_container')
.parent()
.collapse('hide');
},

123
web_responsive/static/src/less/form_view.less

@ -1,84 +1,73 @@
/* Copyright 2016 Ponto Suprimentos Ltda.
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
.o_form_view {
> .o_form_sheet_bg > .o_form_sheet {
@media (max-width: @screen-xs-max) {
min-width: 0px; // allow thinner form_sheet width for smaller screens
}
}
@media (max-width: @screen-xs) {
.o_form_field > .o_form_input_dropdown {
width: 80%;
.openerp .oe_formview .oe_form {
// Form must fill 100% width in any size
.oe_form_sheetbg {
padding: 16px;
.oe_form_sheet_width {
min-width: auto;
max-width: 100%;
}
}
.o_group {
&.o_inner_group > tbody > tr > td {
// prevent td content from breaking into lines
white-space: nowrap;
.note-editor > .note-toolbar {
// prevent wysiwyg editor buttons from expanding the screen
white-space: initial;
}
@media (max-width: @screen-sm-max) {
.oe_form_field > .ui-autocomplete-input {
width: 80%;
}
// reduce form maximum columns for smaller screens
@media (max-width: @screen-xs-max) {
.o-generate-groups(12);
.o-generate-groups(@n, @i: 1) when (@i =< @n) {
.o_group_col_@{i} {
width: 100%;
}
.o-generate-groups(@n, @i + 1);
}
.oe_form_group_row .oe_form_group_row {
margin: 0;
}
// break field label into a separate line from field on small screens
@media (max-width: @screen-xs) {
&.o_inner_group {
.oe_form_group, .oe_form_group_row, .oe_form_group_cell {
&, & tbody {
display: block;
> tbody {
display: block;
> tr {
margin-top: 8px;
.o-flex-display();
.o-flex-flow(row, wrap);
> td {
.o-flex(1, 0, auto);
padding: 0;
display: block;
padding: 0;
// odoo adds a `style="width: 100%"` by javascript
// directly on the tag so we need `!important` here:
width: auto!important;
max-width: 100%;
&.o_td_label {
border-right: 0;
// keep 6% space on line to fit checkboxes
// see above about `!important`
width: 94%!important;
}
}
margin-top: 8px;
width: 100%;
}
&.oe_group_right {
padding: 0;
}
.oe_form_group_row {
display: table;
}
.oe_form_group_cell {
margin: 0;
width: 100%;
}
.oe_form_group_cell_label {
@media (min-width: @screen-sm-min) {
display: table-cell;
min-width: 30%;
width: 30%;
}
@media (max-width: @screen-xs-max) {
border: none;
}
+ .oe_form_group_cell {
@media (min-width: @screen-sm-min) {
display: table-cell;
max-width: 70%;
width: 70%;
}
}
}
}
}
// Make image editing controls always available, instead of depending on resolution or hover
.o_form_field_image > .o_form_image_controls {
position: initial;
opacity: 1;
> .fa {
width: 50%;
padding: 6px;
margin: 0px;
text-align: center;
}
> .fa.o_select_file_button {
background: @odoo-brand-primary;
}
> .fa.o_clear_file_button {
background: @brand-danger;
}
// Make image editing controls always available, instead of depending on
// resolution or hover
.oe_form_field_image > .oe_form_field_image_controls {
display: block;
opacity: 0.7;
}
// Adapt chatter widget to small viewports

6
web_responsive/static/src/less/main.less

@ -32,11 +32,11 @@ main {
}
}
.o_sub_menu {
.o_sub_menu_logo {
.oe_leftbar {
.oe_logo {
display: none;
}
.o_sub_menu_footer {
.oe_footer {
display: none;
}
}

2
web_responsive/static/src/less/navbar.less

@ -101,7 +101,7 @@ header {
}
}
.o_sub_menu > .o_sub_menu_content > .oe_secondary_menu {
.oe_leftbar > .oe_secondary_menus_container > .oe_secondary_menu {
ul.dropdown-menu > li.dropdown-header {
color: @odoo-view-background-color;
text-decoration: none;

4
web_responsive/static/src/less/variables.less

@ -9,6 +9,7 @@
// Navbar
@navbar-height: 46px;
@navbar-margin-bottom: 0;
@app-drawer-navbar-height: @navbar-height / 2;
@app-drawer-navbar-padding-vertical: @navbar-padding-vertical / 2;
@app-drawer-padding-horizontal: @navbar-padding-horizontal / 2;
@ -16,3 +17,6 @@
// Drawer Toggle
@drawer-toggle-height: @navbar-height;
@drawer-toggle-width: @navbar-height;
// Backported from v10
@odoo-list-footer-bg-color: #eee;

2
web_responsive/static/tests/js/web_responsive.js

@ -23,7 +23,7 @@ odoo.define_section('web_responsive', ['web_responsive'], function(test) {
self.$clickZone = $('<a class="oe_menu_leaf">');
self.$secondaryMenu = $('<div><div class="o_sub_menu_content">');
self.$secondaryMenu = $('<div><div class="oe_secondary_menus_container">');
self.$dropdown = $('<div class="dropdown-scrollable">');

2
web_responsive/views/assets.xml

@ -40,7 +40,7 @@
</xpath>
</template>
<template id="qunit_suite" inherit_id="web.qunit_suite">
<xpath expr="//t[@t-set='head']" position="inside">
<xpath expr="//head" position="inside">
<script type="application/javascript"
src="/web_responsive/static/tests/js/web_responsive.js"
/>

6
web_responsive/views/web.xml

@ -12,7 +12,7 @@
name="App Drawer - Web Client"
>
<xpath expr="//div[@class='o_sub_menu']" position="replace" />
<xpath expr="//div[@class='oe_leftbar']" position="replace" />
<xpath expr="//t[@t-set='head']" position="inside">
<meta charset="utf-8" />
@ -77,7 +77,7 @@
data-parent="#odooMenuBarToggle"
aria-expanded="false"
>
<div class="o_sub_menu"
<div class="oe_leftbar"
groups="base.group_user,base.group_portal"
>
<t t-call="web.menu_secondary" />
@ -101,7 +101,7 @@
name="App Drawer - Secondary Menu"
>
<xpath expr="//div[@class='o_sub_menu_content']/t" position="replace">
<xpath expr="//div[@class='oe_secondary_menus_container']/t" position="replace">
<t t-foreach="menu_data['children']" t-as="menu">
<ul style="display: none"

Loading…
Cancel
Save