diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/pad_project/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/pad_project/views')
| -rw-r--r-- | addons/pad_project/views/project_portal_assets.xml | 8 | ||||
| -rw-r--r-- | addons/pad_project/views/project_portal_templates.xml | 34 | ||||
| -rw-r--r-- | addons/pad_project/views/project_views.xml | 54 | ||||
| -rw-r--r-- | addons/pad_project/views/res_config_settings_views.xml | 22 |
4 files changed, 118 insertions, 0 deletions
diff --git a/addons/pad_project/views/project_portal_assets.xml b/addons/pad_project/views/project_portal_assets.xml new file mode 100644 index 00000000..ef773412 --- /dev/null +++ b/addons/pad_project/views/project_portal_assets.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <template id="project_portal_assets_frontend" name="project portal assets" inherit_id="web.assets_frontend"> + <xpath expr="." position="inside"> + <link rel="stylesheet" href="/pad_project/static/src/css/pad_project.css"/> + </xpath> + </template> +</odoo> diff --git a/addons/pad_project/views/project_portal_templates.xml b/addons/pad_project/views/project_portal_templates.xml new file mode 100644 index 00000000..6981aaf1 --- /dev/null +++ b/addons/pad_project/views/project_portal_templates.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <template id="portal_my_task" inherit_id="project.portal_my_task" priority="40"> + + <!-- add a button to the right of the 'description' title according to the mode (edit/read) --> + <xpath expr="//div[@t-if='task.description']//div[hasclass('d-flex')]" position="inside"> + <t t-if="task._use_portal_pad()"> + <t t-if="request.params.get('edit')"> + <a role="button" class="btn btn-primary btn-sm ml-auto" t-attf-href="/my/task/#{task.id}">Save</a> + </t> + <t t-else=""> + <a role="button" class="btn btn-primary btn-sm ml-auto" t-attf-href="/my/task/#{task.id}?edit=1">Edit</a> + </t> + </t> + </xpath> + + <!-- show the description (read mode) or a pad (edit mode) --> + <xpath expr="//div[@t-field='task.description']" position="replace"> + <t t-if="task._use_portal_pad()"> + <t t-if="request.params.get('edit')"> + <div class="o_pad_project_container"> + <iframe width="100%" height="100%" frameborder="0" t-att-src="task.description_pad + '?showChat=false&userName=' + request.env.user.name"/> + </div> + </t> + <t t-else=""> + <div class="py-1 px-2 bg-100 small" t-raw="task._get_pad_content()"/> + </t> + </t> + <t t-else=""> + <t>$0</t> + </t> + </xpath> + </template> +</odoo> diff --git a/addons/pad_project/views/project_views.xml b/addons/pad_project/views/project_views.xml new file mode 100644 index 00000000..3539d850 --- /dev/null +++ b/addons/pad_project/views/project_views.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="view_task_form2_inherit_pad_project" model="ir.ui.view"> + <field name="name">project.task.form.inherit</field> + <field name="model">project.task</field> + <field name="inherit_id" ref="project.view_task_form2"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='description']" position="attributes"> + <attribute name="attrs">{'invisible': [('use_pad', '=', True)], 'readonly': [('use_pad', '=', True)]}</attribute> + </xpath> + <field name="description" position="after"> + <field name="use_pad" invisible="1"/> + <field name="description_pad" widget="pad" attrs="{'invisible': [('use_pad', '=', False)], 'readonly': [('use_pad', '=', False)]}"/> + </field> + </field> + </record> + + <record id="project_project_view_form" model="ir.ui.view"> + <field name="name">project.project.view.form</field> + <field name="model">project.project</field> + <field name="inherit_id" ref="project.edit_project"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='description']" position="attributes"> + <attribute name="attrs">{'invisible': [('use_pads', '=', True)], 'readonly': [('use_pads', '=', True)]}</attribute> + </xpath> + <field name="description" position="after"> + <field name="use_pads" invisible="1"/> + <field name="description_pad" widget="pad" nolabel="1" + attrs="{'invisible': [('use_pads', '=', False)], 'readonly': [('use_pads', '=', False)]}"/> + </field> + <xpath expr="//div[@id='rating_settings']" position="after"> + <div class="col-lg-6 o_setting_box" id="pad_settings"> + <div class="o_setting_left_pane"> + <field name="use_pads"/> + </div> + <div class="o_setting_right_pane"> + <label for="use_pads" string="Collaborative Pads"/> + <div class="text-muted"> + Edit tasks' description collaboratively in real time.<br/> + See each author's text in a distinct color. + </div> + <div class="content-group" attrs="{'invisible': ['|', ('use_pads', '=', False), ('privacy_visibility', '!=', 'portal')]}"> + <div class="mt16 row"> + <label for="pad_availability" string="Available to:" class="col-3 col-lg-3 o_light_label"/> + <field name="pad_availability" widget="radio"/> + </div> + </div> + </div> + </div> + </xpath> + </field> + </record> + +</odoo> diff --git a/addons/pad_project/views/res_config_settings_views.xml b/addons/pad_project/views/res_config_settings_views.xml new file mode 100644 index 00000000..755d1c4d --- /dev/null +++ b/addons/pad_project/views/res_config_settings_views.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="res_config_settings_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.form.inherit.pad.project</field> + <field name="model">res.config.settings</field> + <field name="inherit_id" ref="project.res_config_settings_view_form"/> + <field name="arch" type="xml"> + <div name="pad_project_right_pane" position="inside"> + <div class="content-group" attrs="{'invisible': [('module_pad', '=', False)]}"> + <div class="row mt16"> + <label for="pad_server" class="col-lg-3 o_light_label"/> + <field name="pad_server" attrs="{'required': [('module_pad', '!=', False)]}"/> + </div> + <div class="row"> + <label for="pad_key" class="col-lg-3 o_light_label"/> + <field name="pad_key" attrs="{'required': [('module_pad', '!=', False)]}"/> + </div> + </div> + </div> + </field> + </record> +</odoo>
\ No newline at end of file |
