123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <?xml version="1.0"?>
- <odoo>
- <record id="website_pages_form_view" model="ir.ui.view">
- <field name="name">website.page.form</field>
- <field name="model">website.page</field>
- <field name="arch" type="xml">
- <form string="Website Page Settings">
- <sheet>
- <group>
- <group>
- <field name="name"/>
- <field name="url"/>
- <field name="view_id" context="{'display_website': True}" options="{'always_reload': True}"/>
- <field name="website_id" options="{'no_create': True}" groups="website.group_multi_website"/>
- <field name="track"/>
- </group>
- <group>
- <field name="website_indexed"/>
- <field name="is_published"/>
- <field name="date_publish"/>
- </group>
- </group>
- <label for="menu_ids" string="Related Menu Items"/>
- <field name="menu_ids"/>
- </sheet>
- </form>
- </field>
- </record>
- <record id="website_page_properties_view_form" model="ir.ui.view">
- <field name="name">website.page.properties.form.view</field>
- <field name="model">website.page</field>
- <field name="arch" type="xml">
- <form>
- <notebook>
- <page string="Name">
- <group class="mt-4">
- <field name="name" string="Page Name" placeholder="e.g. Home Page"/>
- <field name="website_id" invisible="1"/>
- <field name="url" string="Page URL" widget="page_url"/>
- </group>
- </page>
- <page string="Publish">
- <group class="mt-4">
- <field name="is_in_menu" string="Show in Top Menu" widget="boolean_toggle"/>
- <field name="is_homepage" string="Use as Homepage" widget="boolean_toggle"/>
- <field name="website_indexed" string="Indexed" widget="boolean_toggle" help="Hide this page from search results"/>
- <field name="is_published" string="Published" widget="boolean_toggle"/>
- <field name="date_publish" widget="datetime"/>
- <field name="visibility"/>
- <field name="visibility_password_display" attrs="{'invisible': [('visibility', '!=', 'password')], 'required': [('visibility', '=', 'password')]}" password="True" string="Password"/>
- <field name="groups_id" attrs="{'invisible': [('visibility', '!=', 'restricted_group')]}" string="Authorized Groups" widget="many2many_tags"/>
- </group>
- </page>
- </notebook>
- </form>
- </field>
- </record>
- <record id="website_pages_tree_view" model="ir.ui.view">
- <field name="name">website.page.list</field>
- <field name="model">website.page</field>
- <field name="priority">99</field>
- <field name="arch" type="xml">
- <tree js_class="website_pages_list" type="object" action="open_website_url" multi_edit="1" default_order="url asc, id asc">
- <field name="is_homepage" invisible="1"/>
- <field name="name" string="Page Title"/>
- <field name="website_url" string="Page URL"/>
- <field name="view_id" invisible="1"/>
- <field name="website_indexed"/>
- <field name="is_in_menu" string="Is In Main Menu"/>
- <field name="is_seo_optimized"/>
- <field name="is_published"/>
- <field name="create_uid" invisible="1"/>
- <field name="write_uid" widget="many2one_avatar" optional="hide"/>
- <field name="write_date" optional="hide"/>
- <field name="track" optional="hide"/>
- <!-- website_id should be shown only in multi website environment
- when the group is enabled, but we need the field to be there all the
- time for `PageRendererMixin`'s `recordFilter' to be able to filter
- correctly. -->
- <field name="website_id" invisible="1"/>
- <field name="website_id" groups="website.group_multi_website"/>
- <button name="action_page_debug_view" type="object" title="Settings" icon="fa-bug fa-lg" groups="base.group_no_one"/>
- </tree>
- </field>
- </record>
- <record id="website_pages_kanban_view" model="ir.ui.view">
- <field name="name">website.page.kanban</field>
- <field name="model">website.page</field>
- <field name="priority">99</field>
- <field name="arch" type="xml">
- <kanban js_class="website_pages_kanban" action="open_website_url" type="object" sample="1">
- <field name="name"/>
- <field name="is_homepage"/>
- <field name="website_url"/>
- <field name="website_id" invisible="1"/>
- <templates>
- <t t-name="kanban-box">
- <div class="d-flex flex-column">
- <div class="o_text_overflow fw-bold mb-auto">
- <span class="fs-3">
- <i t-if="record.is_homepage.raw_value" class="fa fa-home pe-2"
- title="Home page of the current website"/>
- <t t-esc="record.name.value"/>
- </span>
- <div class="text-muted">
- <t t-if="record.website_id.value">
- <i class="fa fa-globe me-1" title="Website"/>
- <field name="website_id" groups="website.group_multi_website"/>
- </t>
- </div>
- <span class="text-primary" t-esc="record.website_url.value"/>
- </div>
- <div><field name="is_in_menu" widget="boolean"/> In Main Menu</div>
- <div><field name="is_seo_optimized" widget="boolean"/> SEO Optimized</div>
- <div class="border-top mt-2 pt-2">
- <field name="is_published" widget="boolean_toggle"/>
- <t t-if="record.is_published.raw_value">Published</t>
- <t t-else="">Not Published</t>
- <button
- class="btn-link float-end p-0"
- name="action_page_debug_view"
- groups="base.group_no_one"
- title="Settings"
- type="object"
- icon="fa-bug"
- />
- </div>
- </div>
- </t>
- </templates>
- </kanban>
- </field>
- </record>
- <record id="website_pages_view_search" model="ir.ui.view">
- <field name="name">website.page.view.search</field>
- <field name="model">website.page</field>
- <field name="arch" type="xml">
- <search string="Website Pages" >
- <field name="url"/>
- <filter string="Published" name="published" domain="[('website_published', '=', True)]"/>
- <filter string="Not published" name="not_published" domain="[('website_published', '=', False)]"/>
- <separator/>
- <filter string="Tracked" name="tracked" domain="[('track', '=', True)]"/>
- <filter string="Not tracked" name="not_tracked" domain="[('track', '=', False)]"/>
- </search>
- </field>
- </record>
- <record id="action_website_pages_list" model="ir.actions.act_window">
- <field name="name">Website Pages</field>
- <field name="res_model">website.page</field>
- <field name="view_mode">tree,kanban</field>
- <field name="view_ids" eval="[(5, 0, 0),
- (0, 0, {'view_mode': 'tree', 'view_id': ref('website_pages_tree_view')}),
- (0, 0, {'view_mode': 'kanban', 'view_id': ref('website_pages_kanban_view')}),
- ]"/>
- </record>
- <menuitem id="menu_website_pages_list"
- parent="menu_content"
- sequence="10"
- name="Pages"
- action="action_website_pages_list"/>
- <!-- Extension of views for ir.ui.view and link with the page manager -->
- <record id="view_view_form_extend" model="ir.ui.view">
- <field name="model">ir.ui.view</field>
- <field name="inherit_id" ref="base.view_view_form"/>
- <field name="arch" type="xml">
- <field name="inherit_id" position="attributes">
- <attribute name="context">{'display_website': True}</attribute>
- <attribute name="options">{'always_reload': True}</attribute>
- </field>
- <field name="model" position="before">
- <field name="website_id" options="{'no_create': True}" groups="website.group_multi_website"/>
- <label for="key"/>
- <div class='o_row'>
- <field name="key"/>
- <button title="Show site map" attrs="{'invisible': [('type', '!=', 'qweb')]}" name="website.action_show_viewhierarchy" icon="fa-sitemap" type="action" class="btn btn-link"/>
- </div>
- <field name="page_ids" invisible="1" />
- <field name="first_page_id" attrs="{'invisible': [('page_ids', '=', [])]}" />
- <field name="visibility" attrs="{'invisible': [('type', '!=', 'qweb')]}" />
- <field name="visibility_password_display" attrs="{'invisible': [('visibility', '!=', 'password')]}" password="True" string="Visibility Password" />
- </field>
- <sheet position="before">
- <header>
- <button type="action" name="website.action_website_pages_list"
- string="Go to Page Manager" attrs="{'invisible': [('page_ids', '=', [])]}"/>
- </header>
- </sheet>
- <field name="active" position="after">
- <field name="track" attrs="{'invisible': [('type', '!=', 'qweb')]}" widget="boolean_toggle"/>
- </field>
- </field>
- </record>
- <record id="view_view_tree_inherit_website" model="ir.ui.view">
- <field name="model">ir.ui.view</field>
- <field name="inherit_id" ref="base.view_view_tree"/>
- <field name="arch" type="xml">
- <tree position="attributes">
- <attribute name="decoration-muted">not active</attribute>
- </tree>
- <field name="name" position="after">
- <field name="active" invisible="1"/>
- <field name="website_id" groups="website.group_multi_website"/>
- </field>
- <field name="xml_id" position="before">
- <field name="key" groups="website.group_multi_website"/>
- </field>
- </field>
- </record>
- </odoo>
|