From 665d0dfa67f549d42f0f275e3f6da9944dbc81c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= <tde@odoo.com> Date: Thu, 1 Aug 2019 16:10:16 +0000 Subject: [PATCH] [IMP] website_slides: add a new kanban view for contents (slide.slide) PURPOSE eLearning should have its own application in manager. Indeed this is becoming a big application and having it embedded inside Website application is not enough anymore. It should also hold updated and easy-to-use menus, navigation, actions and views in backend. SPECIFICATIONS Add a kanban view for slide.slide model * See https://drive.google.com/a/odoo.com/file/d/1WKj13-C_UCOwh4dN-FRmU9Pp6BsZ_HvT/view?usp=drivesdk LINKS Task 1978729 PR #35061 --- .../views/slide_slide_views.xml | 69 ++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/addons/website_slides/views/slide_slide_views.xml b/addons/website_slides/views/slide_slide_views.xml index 2be7ac9a8d12..20a14d92041b 100644 --- a/addons/website_slides/views/slide_slide_views.xml +++ b/addons/website_slides/views/slide_slide_views.xml @@ -141,6 +141,71 @@ </field> </record> + <record id="slide_slide_view_kanban" model="ir.ui.view"> + <field name="name">slide.slide.view.kanban</field> + <field name="model">slide.slide</field> + <field name="arch" type="xml"> + <kanban edit="false"> + <field name="id"/> + <field name="channel_id"/> + <field name="slide_type"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click o_kanban_record_has_image_fill"> + <t t-set="placeholder" t-value="'/website_slides/static/src/img/channel-training-demo.jpg'"/> + <div class="o_kanban_image_fill_left d-none d-md-block" + t-attf-style="background-image:url('#{kanban_image('slide.slide', 'image_medium', record.id.raw_value, placeholder)}')"> + <img class="o_kanban_image_inner_pic" + t-att-alt="record.channel_id.value" + t-att-src="kanban_image('slide.channel', 'image_small', record.channel_id.raw_value)"/> + </div> + <div class="o_kanban_image rounded-circle d-md-none" + t-attf-style="background-image:url('#{kanban_image('slide.slide', 'image_medium', record.id.raw_value, placeholder)}')"> + <img class="o_kanban_image_inner_pic" + t-att-alt="record.channel_id.value" + t-att-src="kanban_image('slide.channel', 'image_small', record.channel_id.raw_value)"/> + </div> + <div class="oe_kanban_details d-flex flex-column"> + <strong class="o_kanban_record_title oe_partner_heading"><field name="display_name"/></strong> + <div class="o_kanban_tags_section"> + <span class="oe_kanban_list_many2many"> + <field name="tag_ids" widget="many2many_tags"/> + </span> + </div> + <span class="text-primary"><field name="channel_id"/></span> + <span class="text-primary"><field name="user_id"/></span> + <div class=" mt-auto d-flex justify-content-between"> + <span class="badge badge-pill"> + <i class="fa fa-clock-o mr-2" aria-label="Duration" role="img" title="Duration"/><field name="completion_time" widget="float_time"/> + </span> + <span class="badge badge-pill"> + <i class="fa fa-eye mr-2" aria-label="Views" role="img" title="Views"/><field name="total_views"/> + </span> + <span class="badge badge-pill"> + <t t-if="record.slide_type.raw_value == 'infographic'"> + <i class="fa fa-file-image-o mr-2" aria-label="Infographic" role="img" title="Infographic"/> + </t> + <t t-elif="record.slide_type.raw_value == 'webpage'"> + <i class="fa fa-file-code-o mr-2" aria-label="Webpage" role="img" title="Webpage"/> + </t> + <t t-elif="record.slide_type.raw_value == 'video'"> + <i class="fa fa-file-video-o mr-2" aria-label="Video" role="img" title="Video"/> + </t> + <t t-elif="record.slide_type.raw_value == 'quiz'"> + <i class="fa fa-flag mr-2" aria-label="Quiz" role="img" title="Quiz"/> + </t> + <t t-else=""><i class="fa fa-file-pdf-o mr-2" aria-label="Document" role="img" title="Document"/></t> + <field name="slide_type"/> + </span> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + <record id="view_slide_slide_tree" model="ir.ui.view"> <field name="name">slide.slide.tree</field> <field name="model">slide.slide</field> @@ -194,8 +259,8 @@ <record id="slide_slide_action" model="ir.actions.act_window"> <field name="name">Contents</field> <field name="res_model">slide.slide</field> - <field name="view_mode">tree,form</field> - <field name="context">{'search_default_groupby_channel': 1}</field> + <field name="view_mode">kanban,tree,form</field> + <field name="context"></field> <field name="help" type="html"> <p class="o_view_nocontent_smiling_face"> Add a new lesson -- GitLab