diff options
Diffstat (limited to 'web_responsive/static/src/xml')
| -rw-r--r-- | web_responsive/static/src/xml/apps.xml | 69 | ||||
| -rw-r--r-- | web_responsive/static/src/xml/attachment_viewer.xml | 47 | ||||
| -rw-r--r-- | web_responsive/static/src/xml/control_panel.xml | 146 | ||||
| -rw-r--r-- | web_responsive/static/src/xml/discuss.xml | 16 | ||||
| -rw-r--r-- | web_responsive/static/src/xml/form_buttons.xml | 110 | ||||
| -rw-r--r-- | web_responsive/static/src/xml/menu.xml | 11 | ||||
| -rw-r--r-- | web_responsive/static/src/xml/navbar.xml | 17 | ||||
| -rw-r--r-- | web_responsive/static/src/xml/search_panel.xml | 53 |
8 files changed, 469 insertions, 0 deletions
diff --git a/web_responsive/static/src/xml/apps.xml b/web_responsive/static/src/xml/apps.xml new file mode 100644 index 0000000..d9e4098 --- /dev/null +++ b/web_responsive/static/src/xml/apps.xml @@ -0,0 +1,69 @@ +<?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 must be clickable --> + <t t-jquery=".o_app" t-operation="attributes"> + <attribute + name="t-attf-href" + t-translation="off" + >#menu_id=#{app.menuID}&action_id=#{app.actionID}</attribute> + <attribute name="draggable" t-translation="off">false</attribute> + </t> + <!-- 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 align-items-center col-12"> + <div class="search-input"> + <div class="input-group"> + <div class="input-group-prepend"> + <span class="fa fa-search" /> + </div> + <input + type="search" + autocomplete="off" + placeholder="Search menus..." + class="form-control" + /> + </div> + <div class="search-results ml-auto mr-auto rounded" /> + </div> + </div> + </t> + </t> + <!-- Separate app icon template, for easier inheritance --> + <t t-name="web_responsive.AppIcon"> + <img + class="o-app-icon" + draggable="false" + 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)" /> + <a + 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-attf-href="#menu_id=#{menu.id}&action_id=#{menu.action_id}" + t-att-data-menu-id="menu.id" + t-att-data-action-id="menu.action_id" + t-att-data-parent-id="menu.parent_id[0]" + draggable="false" + t-raw="result.string" + /> + </t> + </t> +</template> diff --git a/web_responsive/static/src/xml/attachment_viewer.xml b/web_responsive/static/src/xml/attachment_viewer.xml new file mode 100644 index 0000000..928a1e4 --- /dev/null +++ b/web_responsive/static/src/xml/attachment_viewer.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- Copyright 2019 Tecnativa - Alexandre Díaz + Copyright 2021 Sergey Shebanin + License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> +<template> + <t t-inherit="mail.Dialog" t-inherit-mode="extension" owl="1"> + <xpath expr="//div[hasclass('o_Dialog')]" position="attributes"> + <attribute + name="t-attf-class" + t-translation="off" + >o_Dialog_{{dialog.record['constructor'].name}}</attribute> + </xpath> + </t> + <t t-inherit="mail.AttachmentViewer" t-inherit-mode="extension" owl="1"> + <xpath expr="//div[hasclass('o_AttachmentViewer')]" position="attributes"> + <attribute + name="t-att-class" + t-translation="off" + >state.maximized ? 'o_AttachmentViewer_maximized' : ''</attribute> + </xpath> + <xpath + expr="//div[hasclass('o_AttachmentViewer_header')]/div[hasclass('o-autogrow')]" + position="after" + > + <div + t-if="!state.maximized" + class="o_AttachmentViewer_headerItem o_AttachmentViewer_headerItemButton o_AttachmentViewer_headerItemButtonMaximize" + t-on-click="state.maximized=true" + role="button" + title="Maximize" + aria-label="Maximize" + > + <i class="fa fa-fw fa-window-maximize" role="img" /> + </div> + <div + t-if="state.maximized" + class="o_AttachmentViewer_headerItem o_AttachmentViewer_headerItemButton o_AttachmentViewer_headerItemButtonMinimize" + t-on-click="state.maximized=false" + role="button" + title="Minimize" + aria-label="Minimize" + > + <i class="fa fa-fw fa-window-minimize" role="img" /> + </div> + </xpath> + </t> +</template> diff --git a/web_responsive/static/src/xml/control_panel.xml b/web_responsive/static/src/xml/control_panel.xml new file mode 100644 index 0000000..d7d0f9c --- /dev/null +++ b/web_responsive/static/src/xml/control_panel.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- Copyright 2021 Sergey Shebanin + License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> +<templates> + <t t-inherit="web.ControlPanel" t-inherit-mode="extension" owl="1"> + <xpath expr="//nav[hasclass('o_cp_switch_buttons')]" position="replace"> + <nav + t-if="props.views.length gt 1" + class="btn-group o_cp_switch_buttons" + role="toolbar" + aria-label="View switcher" + > + <t + t-set="collapse_switchview" + t-value="device.size_class <= device.SIZES.LG" + /> + <button + t-if="collapse_switchview" + class="btn btn-link btn-sm" + data-toggle="dropdown" + aria-expanded="false" + > + <span + t-attf-class="fa fa-lg o_switch_view o_{{ env.view.type }} {{ props.views.filter(view => view.type === env.view.type)[0].icon }}" + /> + </button> + <ul + t-if="collapse_switchview" + class="dropdown-menu dropdown-menu-right list-inline" + > + <li t-foreach="props.views" t-as="view" t-key="view.type"> + <t t-call="web.ViewSwitcherButton" /> + </li> + </ul> + <t + t-if="!collapse_switchview" + t-foreach="props.views" + t-as="view" + t-key="view.type" + > + <t t-call="web.ViewSwitcherButton" /> + </t> + </nav> + </xpath> + <xpath expr="//div[hasclass('o_searchview')]" position="replace"> + <div + t-if="props.withSearchBar" + class="o_searchview" + t-att-class="state.mobileSearchMode == 'quick' ? 'o_searchview_quick' : 'o_searchview_mobile'" + role="search" + aria-autocomplete="list" + t-on-click.self="state.mobileSearchMode = device.isMobile ? 'quick' : ''" + > + <t t-if="!device.isMobile"> + <i + class="o_searchview_icon fa fa-search" + title="Search..." + role="img" + aria-label="Search..." + /> + <SearchBar fields="fields" /> + </t> + <t t-if="device.isMobile and state.mobileSearchMode == 'quick'"> + <button + class="btn btn-link fa fa-arrow-left" + t-on-click.stop="state.mobileSearchMode = ''" + /> + <SearchBar fields="fields" /> + <button + class="btn fa fa-filter" + t-on-click.stop="state.mobileSearchMode = 'full'" + /> + </t> + <t + t-if="device.isMobile and state.mobileSearchMode == 'full'" + t-call="web_responsive.MobileSearchView" + /> + <t t-if="device.isMobile and state.mobileSearchMode == ''"> + <button + class="btn btn-link fa fa-search" + t-on-click.stop="state.mobileSearchMode = 'quick'" + /> + </t> + </div> + </xpath> + <xpath expr="//div[hasclass('o_cp_top_left')]" position="attributes"> + <attribute + name="t-att-class" + t-translation="off" + >device.isMobile and state.mobileSearchMode == 'quick' ? 'o_hidden' : ''</attribute> + </xpath> + <xpath expr="//div[hasclass('o_search_options')]" position="attributes"> + <attribute name="t-if" t-translation="off">!device.isMobile</attribute> + <attribute + name="t-att-class" + t-translation="off" + >device.size_class == device.SIZES.MD ? 'o_search_options_hide_labels' : ''</attribute> + </xpath> + </t> + <t t-name="web_responsive.MobileSearchView" owl="1"> + <div class="o_mobile_search"> + <div class="o_mobile_search_header"> + <span + class="o_mobile_search_close float-left mt16 mb16 mr8 ml16" + t-on-click.stop="state.mobileSearchMode = 'quick'" + > + <i class="fa fa-arrow-left" /> + <strong class="float-right ml8">FILTER</strong> + </span> + <span + class="float-right o_mobile_search_clear_facets mt16 mr16" + t-on-click.stop="model.dispatch('clearQuery')" + > + <t>CLEAR</t> + </span> + </div> + <SearchBar fields="fields" /> + <div class="o_mobile_search_filter o_search_options mb8 mt8 ml16 mr16"> + <FilterMenu + t-if="props.searchMenuTypes.includes('filter')" + class="o_filter_menu" + fields="fields" + /> + <GroupByMenu + t-if="props.searchMenuTypes.includes('groupBy')" + class="o_group_by_menu" + fields="fields" + /> + <ComparisonMenu + t-if="props.searchMenuTypes.includes('comparison') and model.get('filters', f => f.type === 'comparison').length" + class="o_comparison_menu" + /> + <FavoriteMenu + t-if="props.searchMenuTypes.includes('favorite')" + class="o_favorite_menu" + /> + </div> + <div + class="btn btn-primary o_mobile_search_show_result fixed-bottom" + t-on-click.stop="state.mobileSearchMode = ''" + > + <t>SEE RESULT</t> + </div> + </div> + </t> +</templates> diff --git a/web_responsive/static/src/xml/discuss.xml b/web_responsive/static/src/xml/discuss.xml new file mode 100644 index 0000000..0789dee --- /dev/null +++ b/web_responsive/static/src/xml/discuss.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- Copyright 2019 Tecnativa - Alexandre Díaz + License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> +<template> + <t t-extend="mail.discuss.ControlButtons"> + <t + t-jquery=".o_mail_discuss_button_multi_user_channel" + t-operation="attributes" + > + <attribute name="class" t-translation="off"> + btn btn-secondary o_mail_discuss_button_multi_user_channel d-md-block + d-none + </attribute> + </t> + </t> +</template> diff --git a/web_responsive/static/src/xml/form_buttons.xml b/web_responsive/static/src/xml/form_buttons.xml new file mode 100644 index 0000000..2e86096 --- /dev/null +++ b/web_responsive/static/src/xml/form_buttons.xml @@ -0,0 +1,110 @@ +<?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="CalendarView.navigation_buttons"> + <!-- Add responsive icons to buttons --> + <t t-jquery=".o_calendar_button_today" t-operation="inner"> + <t t-call="web_responsive.icon_button"> + <t t-set="icon" t-value="'calendar-check-o'" /> + <t t-set="label">Today</t> + </t> + </t> + </t> +</templates> diff --git a/web_responsive/static/src/xml/menu.xml b/web_responsive/static/src/xml/menu.xml new file mode 100644 index 0000000..075cd49 --- /dev/null +++ b/web_responsive/static/src/xml/menu.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<templates id="template" xml:space="preserve"> + <div t-extend="UserMenu.shortcuts"> + <t + t-jquery="table.o_shortcut_table > tbody > tr > td:nth-child(2) > span:first-child" + t-operation="after" + > + + <span class="o_key">Shift</span> + </t> + </div> +</templates> diff --git a/web_responsive/static/src/xml/navbar.xml b/web_responsive/static/src/xml/navbar.xml new file mode 100644 index 0000000..1d9654a --- /dev/null +++ b/web_responsive/static/src/xml/navbar.xml @@ -0,0 +1,17 @@ +<?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). --> +<templates> + <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> +</templates> diff --git a/web_responsive/static/src/xml/search_panel.xml b/web_responsive/static/src/xml/search_panel.xml new file mode 100644 index 0000000..a1cc9db --- /dev/null +++ b/web_responsive/static/src/xml/search_panel.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- Copyright 2021 Sergey Shebanin + License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> +<templates> + <t t-inherit="web.SearchPanel" t-inherit-mode="extension" owl="1"> + <xpath expr="//div[hasclass('o_search_panel')]" position="inside"> + <div + t-if="device.isMobile" + class="o_search_panel_summary" + t-on-click.stop="state.mobileSearch = true" + > + <div class="d-flex flex-wrap align-items-center"> + <i class="fa fa-fw fa-filter mr-1" /> + <t t-set="filters" t-value="getActiveSummary()" /> + <span t-foreach="filters" t-as="filter" class="mx-1"> + <i + t-if="filter.icon" + t-attf-class="fa {{ filter.icon }} mr-2" + t-att-style="filter.color and ('color: ' + filter.color)" + /> + <t + t-esc="filter.values.join(filter.type == 'category' ? ' / ' : ', ')" + /> + </span> + <t t-if="!filters.length">All</t> + </div> + </div> + <div + class="o_search_panel_content" + t-att-class="device.isMobile ? (state.mobileSearch ? 'o_mobile_search' : 'd-none'): ''" + /> + </xpath> + <xpath expr="//div[hasclass('o_search_panel_content')]" position="inside"> + <div t-if="device.isMobile" class="o_mobile_search_header"> + <span + class="o_mobile_search_close float-left mt16 mb16 mr8 ml16" + t-on-click.stop="state.mobileSearch = false" + > + <i class="fa fa-arrow-left" /> + <strong class="float-right ml8">FILTER</strong> + </span> + </div> + <xpath expr="//section" position="move" /> + <div + t-if="device.isMobile" + class="btn btn-primary o_mobile_search_show_result fixed-bottom" + t-on-click.stop="state.mobileSearch = false" + > + <t>SEE RESULT</t> + </div> + </xpath> + </t> +</templates> |
