Browse Source

add web_searchbar_full_width

pull/130/head
Holger Brunn 9 years ago
parent
commit
56156617f8
  1. 30
      web_searchbar_full_width/README.rst
  2. 20
      web_searchbar_full_width/__init__.py
  3. 44
      web_searchbar_full_width/__openerp__.py
  4. BIN
      web_searchbar_full_width/static/description/icon.png
  5. BIN
      web_searchbar_full_width/static/description/preview.png
  6. 20
      web_searchbar_full_width/static/src/css/web_searchbar_full_width.css
  7. 15
      web_searchbar_full_width/static/src/xml/web_searchbar_full_width.xml
  8. 10
      web_searchbar_full_width/views/templates.xml

30
web_searchbar_full_width/README.rst

@ -0,0 +1,30 @@
Show searchbar over full width
==============================
Odoo's default search bar is rather narrow, which causes it to grow vertically when applying a lot of filters. For small screens this can be a problem as it wastes a lot of space. This addon addresses this issue by growing the search bar to the whole width of the screen, moving it below the breadcrumb. A side effect of this is that the breadcrump can also use the full screen width, which makes it reasonable not to cut off titles after 7 characters.
The result looks like this:
.. image:: /web_searchbar_full_width/static/description/preview.png
:alt: Searchbar over full screen width
Credits
=======
Contributors
------------
* Holger Brunn <hbrunn@therp.nl>
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://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_searchbar_full_width/__init__.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# 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/>.
#
##############################################################################

44
web_searchbar_full_width/__openerp__.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# 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": "Full width searchbar",
"version": "1.0",
"author": "Therp BV",
"license": "AGPL-3",
"category": "Tools",
"summary": "Show search bar in full screen width",
"depends": [
],
"data": [
'views/templates.xml',
],
"qweb": [
'static/src/xml/web_searchbar_full_width.xml',
],
"test": [
],
"auto_install": False,
"installable": True,
"application": False,
"external_dependencies": {
'python': [],
},
}

BIN
web_searchbar_full_width/static/description/icon.png

After

Width: 110  |  Height: 110  |  Size: 6.8 KiB

BIN
web_searchbar_full_width/static/description/preview.png

After

Width: 1914  |  Height: 466  |  Size: 50 KiB

20
web_searchbar_full_width/static/src/css/web_searchbar_full_width.css

@ -0,0 +1,20 @@
.openerp .oe_application .oe_breadcrumb_item:not(:last-child)
{
max-width: inherit;
}
.openerp .oe_searchview
{
width: 100%;
}
.openerp .oe_view_manager_current > .oe_view_manager_header .oe_header_row_top td
{
padding-bottom: 0px;
}
.openerp .oe_view_manager_current > .oe_view_manager_header span.oe_breadcrumb_item
{
padding-top: 3px;
}
.openerp .oe_view_manager table.oe_view_manager_header h2
{
line-height: 20px;
}

15
web_searchbar_full_width/static/src/xml/web_searchbar_full_width.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-extend="ViewManagerAction">
<t t-jquery="tr.oe_header_row_top td:nth-child(1)">
jQuery(this).attr('colspan', 4);
</t>
<t t-jquery="tr.oe_header_row_top td:nth-child(2)">
var $new_row = jQuery('<tr class="oe_header_row"/>');
jQuery(this)
.parents('tr')
.after($new_row);
$new_row.append(jQuery(this).attr('colspan', 4));
</t>
</t>
</templates>

10
web_searchbar_full_width/views/templates.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template id="assets_backend" name="web_searchbar_full_width assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/web_searchbar_full_width/static/src/css/web_searchbar_full_width.css"/>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save