mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_responsive: Migration to 17.0
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates>
|
||||
|
||||
<t
|
||||
t-name="web_responsive.CustomFavoriteItem"
|
||||
t-inherit="web.CustomFavoriteItem"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<xpath expr="//AccordionItem/div[1]" position="attributes">
|
||||
<attribute name="class" add="o_add_favorite_props" separator=" " />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//AccordionItem/div[1]/input[hasclass('o_input')]"
|
||||
position="attributes"
|
||||
>
|
||||
<attribute name="class" add="o_add_favorite_name" separator=" " />
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -5,37 +5,121 @@
|
||||
Copyright 2018 Tecnativa - Jairo Llopis
|
||||
Copyright 2021 ITerra - Sergey Shebanin
|
||||
Copyright 2023 Onestein - Anjeel Haria
|
||||
Copyright 2023 Taras Shabaranskyi
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
-->
|
||||
<templates id="form_view" xml:space="preserve">
|
||||
<templates id="form_view">
|
||||
<!-- Template for buttons that display only the icon in xs -->
|
||||
<t t-name="web_responsive.icon_button_create" owl="1">
|
||||
<t t-name="web_responsive.icon_button_create">
|
||||
<i t-attf-class="fa fa-plus" title="New" />
|
||||
<span class="d-none d-sm-inline"> New</span>
|
||||
<span class="d-none d-sm-inline ms-1">New</span>
|
||||
</t>
|
||||
<t t-name="web_responsive.icon_button_save" owl="1">
|
||||
<t t-name="web_responsive.icon_button_save">
|
||||
<i t-attf-class="fa fa-check" title="Save" />
|
||||
<span class="d-none d-sm-inline"> Save</span>
|
||||
<span class="d-none d-sm-inline ms-1">Save</span>
|
||||
</t>
|
||||
<t t-name="web_responsive.icon_button_discard" owl="1">
|
||||
<i t-attf-class="fa fa-times" title="Discard" />
|
||||
<span class="d-none d-sm-inline"> Discard</span>
|
||||
<t t-name="web_responsive.icon_button_discard">
|
||||
<i t-attf-class="fa fa-undo" title="Discard" />
|
||||
<span class="d-none d-sm-inline ms-1">Discard</span>
|
||||
</t>
|
||||
<t
|
||||
t-name="web.ResponsiveFormView.Buttons"
|
||||
t-name="web_responsive.FormView.Buttons"
|
||||
t-inherit="web.FormView.Buttons"
|
||||
owl="1"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<!-- Change "Discard" button hotkey to "D" -->
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o_form_button_cancel')]"
|
||||
position="attributes"
|
||||
>
|
||||
<xpath expr="//button[hasclass('o_form_button_cancel')]" position="attributes">
|
||||
<attribute name="data-hotkey">d</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[hasclass('o_form_button_save')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary o_form_button_save"
|
||||
data-hotkey="s"
|
||||
t-on-click.stop="() => this.saveButtonClicked({closable: true})"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_save" />
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//button[hasclass('o_form_button_cancel')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary o_form_button_cancel"
|
||||
data-hotkey="j"
|
||||
t-on-click.stop="discard"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_discard" />
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//button[hasclass('o_form_button_create')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary o_form_button_create"
|
||||
data-hotkey="c"
|
||||
t-on-click.stop="create"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_create" />
|
||||
</button>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t
|
||||
t-name="web_responsive.SettingsFormView.Buttons"
|
||||
t-inherit="web.SettingsFormView.Buttons"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<xpath expr="//button[hasclass('o_form_button_save')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary o_form_button_save"
|
||||
data-hotkey="s"
|
||||
t-on-click.stop="() => this.saveButtonClicked({closable: true})"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_save" />
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//button[hasclass('o_form_button_cancel')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary o_form_button_cancel"
|
||||
data-hotkey="j"
|
||||
t-on-click.stop="discard"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_discard" />
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//button[hasclass('o_form_button_create')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary o_form_button_create"
|
||||
data-hotkey="c"
|
||||
t-on-click.stop="create"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_create" />
|
||||
</button>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t
|
||||
t-name="web_responsive.FormView"
|
||||
t-inherit="web.FormView"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o_form_button_create')]"
|
||||
expr="//button[hasclass('o_form_button_create')][hasclass('btn-outline-primary')]"
|
||||
position="replace"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary o_form_button_create"
|
||||
data-hotkey="c"
|
||||
t-on-click.stop="create"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_create" />
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[hasclass('o_form_button_create')][hasclass('btn-secondary')]"
|
||||
position="replace"
|
||||
>
|
||||
<button
|
||||
@@ -49,57 +133,24 @@
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t
|
||||
t-name="web.ResponsiveFormView"
|
||||
t-inherit="web.FormView"
|
||||
owl="1"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o_form_button_create')]"
|
||||
position="replace"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary o_form_button_create"
|
||||
data-hotkey="c"
|
||||
t-on-click.stop="create"
|
||||
t-att-disabled="state.isDisabled"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_create" />
|
||||
</button>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t
|
||||
t-name="web.ResponsiveFormStatusIndicator"
|
||||
t-inherit="web.FormStatusIndicator"
|
||||
owl="1"
|
||||
>
|
||||
<t t-name="web_responsive.FormStatusIndicator" t-inherit="web.FormStatusIndicator">
|
||||
<!-- Change "Discard" button hotkey to "D" -->
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o_form_button_cancel')]"
|
||||
position="attributes"
|
||||
>
|
||||
<xpath expr="//button[hasclass('o_form_button_cancel')]" position="attributes">
|
||||
<attribute name="data-hotkey">d</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
<t
|
||||
t-name="web.ResponsiveKanbanView.Buttons"
|
||||
t-inherit="web.KanbanView.Buttons"
|
||||
owl="1"
|
||||
t-name="web_responsive.KanbanView"
|
||||
t-inherit="web.KanbanView"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<!-- Add responsive icons to buttons -->
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o-kanban-button-new')]"
|
||||
position="replace"
|
||||
>
|
||||
<xpath expr="//button[hasclass('o-kanban-button-new')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary o-kanban-button-new"
|
||||
accesskey="c"
|
||||
t-on-click="() => this.createRecord(null)"
|
||||
t-on-click="() => this.createRecord()"
|
||||
data-bounce-button=""
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_create" />
|
||||
@@ -107,16 +158,12 @@
|
||||
</xpath>
|
||||
</t>
|
||||
<t
|
||||
t-name="web.ResponsiveListView.Buttons"
|
||||
t-inherit="web.ListView.Buttons"
|
||||
owl="1"
|
||||
t-name="web_responsive.ListView"
|
||||
t-inherit="web.ListView"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<!-- Add responsive icons to buttons -->
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o_list_button_add')]"
|
||||
position="replace"
|
||||
>
|
||||
<xpath expr="//button[hasclass('o_list_button_add')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary o_list_button_add"
|
||||
@@ -127,10 +174,14 @@
|
||||
<t t-call="web_responsive.icon_button_create" />
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o_list_button_save')]"
|
||||
position="replace"
|
||||
>
|
||||
</t>
|
||||
<t
|
||||
t-name="web_responsive.ListView.Buttons"
|
||||
t-inherit="web.ListView.Buttons"
|
||||
t-inherit-mode="extension"
|
||||
>
|
||||
<!-- Add responsive icons to buttons -->
|
||||
<xpath expr="//button[hasclass('o_list_button_save')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary o_list_button_save"
|
||||
@@ -140,15 +191,12 @@
|
||||
<t t-call="web_responsive.icon_button_save" />
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//button[contains(@class, 'o_list_button_discard')]"
|
||||
position="replace"
|
||||
>
|
||||
<xpath expr="//button[hasclass('o_list_button_discard')]" position="replace">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary o_list_button_discard"
|
||||
data-hotkey="d"
|
||||
t-on-click="onClickDiscard"
|
||||
t-on-click.stop="onClickDiscard"
|
||||
t-on-mousedown="onMouseDownDiscard"
|
||||
>
|
||||
<t t-call="web_responsive.icon_button_discard" />
|
||||
|
||||
Reference in New Issue
Block a user