File: slide_slide_views.xml

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (401 lines) | stat: -rw-r--r-- 24,744 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <!-- SLIDE.TAG -->
        <record id="view_slide_tag_form" model="ir.ui.view">
            <field name="name">slide.tag.form</field>
            <field name="model">slide.tag</field>
            <field name="arch" type="xml">
                <form string="Tag">
                    <sheet>
                        <group>
                            <field name="name"/>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="view_slide_tag_tree" model="ir.ui.view">
            <field name="name">slide.tag.list</field>
            <field name="model">slide.tag</field>
            <field name="arch" type="xml">
                <list string="Tags" editable="bottom">
                    <field name="name" placeholder="e.g 'HowTo'"/>
                </list>
            </field>
        </record>

        <record id="action_slide_tag" model="ir.actions.act_window">
            <field name="name">Content Tags</field>
            <field name="res_model">slide.tag</field>
            <field name="view_mode">list,form</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    Create a Content Tag
                </p>
                <p>
                    Use Content Tags to classify your Content.
                </p>
            </field>
        </record>

        <!-- SLIDE.SLIDE -->
        <record id="view_slide_slide_form" model="ir.ui.view">
            <field name="name">slide.slide.form</field>
            <field name="model">slide.slide</field>
            <field name="arch" type="xml">
                <form string="Lesson">
                    <sheet>
                        <field name="channel_type" invisible="1" readonly="1"/>
                        <field name="channel_allow_comment" invisible="1" readonly="1"/>
                        <div class="oe_button_box" name="button_box">
                            <button name="%(slide_slide_partner_action_from_slide)d"
                                    class="oe_stat_button" type="action" icon="fa-graduation-cap"
                                    invisible="slide_views == 0">
                                <field name="slide_views" widget="statinfo" string="Attendees"/>
                            </button>
                            <button disabled="1" icon="fa-thumbs-up" class="oe_stat_button"
                                invisible="channel_type == 'training' or likes == 0">
                                <field class="ms-1" name="likes" widget="statinfo" string="Likes"/>
                             </button>
                             <button disabled="1" icon="fa-thumbs-down" class="oe_stat_button"
                                invisible="channel_type == 'training' or dislikes == 0">
                                <field class="ms-1" name="dislikes" widget="statinfo" string="Dislikes"/>
                             </button>
                             <button disabled="1" icon="fa-comments" class="oe_stat_button"
                                 invisible="not channel_allow_comment or comments_count == 0">
                                <field class="ms-1" name="comments_count" widget="statinfo" string="Comments"/>
                            </button>
                            <button name="action_view_embeds" class="oe_stat_button" type="object" icon="fa-share-alt"
                                invisible="embed_count == 0">
                                <div class="o_stat_info">
                                    <span class="o_stat_value"><field name="embed_count"/></span>
                                    <span class="o_stat_text">Embed Views</span>
                                </div>
                            </button>
                            <field name="is_published" widget="website_redirect_button"
                                   invisible="is_category or not channel_id"/>
                        </div>
                        <widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
                        <field name="image_1920" widget="image" class="oe_avatar" options='{"preview_image": "image_256"}'
                            invisible="is_category"/>
                        <div class="oe_title pe-xl-0">
                            <div>
                                <label for="name" string="Content Title"/>
                            </div>
                            <h1>
                                <field name="name" default_focus="1" placeholder="e.g. Setting up your computer" class="me-0"/>
                                <field name="is_category" invisible="1"/>
                            </h1>
                            <field name="tag_ids" invisible="is_category" widget="many2many_tags" placeholder="Tags..."/>
                        </div>
                        <notebook invisible="is_category">
                            <page name="document" string="Document">
                                <group>
                                    <group name="lesson_details">
                                        <field name="active" invisible="1"/>
                                        <field name="channel_id"/>
                                        <field name="slide_category" string="Content Type"/>
                                        <field name="slide_type" invisible="1"/>
                                        <div class="text-muted" colspan="2" invisible="slide_category != 'quiz'">
                                            You can add questions to this quiz in the 'Quiz' tab.
                                        </div>
                                        <label for="source_type" string="" invisible="slide_category not in ['infographic', 'document']"/>
                                        <field name="source_type" widget="radio" nolabel="1" invisible="slide_category not in ['infographic', 'document']" />
                                        <field name="video_url" invisible="slide_category != 'video'" readonly="slide_category != 'video'" required="slide_category == 'video'"
                                            placeholder='e.g "www.youtube.com/watch?v=ebBez6bcSEc"'
                                            widget="url"/>
                                        <field name="document_google_url" invisible="source_type != 'external' or slide_category != 'document'" readonly="source_type != 'external' or slide_category != 'document'"
                                            placeholder='e.g "https://drive.google.com/file/..."'
                                            widget="url"/>
                                        <field name="image_google_url" invisible="source_type != 'external' or slide_category != 'infographic'" readonly="source_type != 'external' or slide_category != 'infographic'"
                                            placeholder='e.g "https://drive.google.com/file/..."'
                                            widget="url"/>
                                        <field name="document_binary_content" string="" options="{'accepted_file_extensions': '.pdf'}"
                                            invisible="source_type == 'external' or slide_category != 'document'"
                                            readonly="source_type == 'external' or slide_category != 'document'"/>
                                        <field name="image_binary_content" string="" options="{'accepted_file_extensions': 'image/*'}"
                                            invisible="source_type == 'external' or slide_category != 'infographic'"
                                            readonly="source_type == 'external' or slide_category != 'infographic'"/>
                                    </group>
                                    <group name="related_details">
                                        <field name="user_id" string="Responsible" domain="[('share', '=', False)]" widget="many2one_avatar"/>
                                        <label for="completion_time"/>
                                        <div>
                                            <field name="completion_time" widget="float_time" class="oe_inline"/>
                                            <span> hours</span>
                                        </div>
                                        <field name="slide_resource_downloadable" invisible="slide_category != 'document' or source_type != 'local_file'"/>
                                        <field name="date_published" string="Published Date" invisible="not date_published" groups="base.group_no_one"/>
                                        <field name="is_preview"/>
                                        <field name="public_views"/>
                                        <field name="total_views"/>
                                    </group>
                                </group>
                            </page>
                            <page name="description" string="Description">
                                <field name="description" placeholder="e.g. In this video, we'll give you the keys on how Odoo can help you to grow your business. At the end, we'll propose you a quiz to test your knowledge."/>
                            </page>
                            <page string="Additional Resources" name="external_links" >
                                <group>
                                    <field name="slide_resource_ids" widget="one2many" nolabel="1">
                                        <list editable="top">
                                            <field name="sequence" widget="handle"/>
                                            <field name="resource_type"/>
                                            <field name="name" required="1"/>
                                            <field name="file_name" column_invisible="True"/>
                                            <field name="data" readonly="resource_type == 'url'" filename="file_name"/>
                                            <field name="link" string="Link"
                                                readonly="resource_type == 'file'"
                                                required="resource_type == 'url'"/>
                                        </list>
                                    </field>
                                </group>
                            </page>
                            <page name="quiz" string="Quiz">
                                <group name="quiz_details">
                                    <group name="quiz_rewards" string="Points Rewards">
                                        <group>
                                            <field string="First Try" name="quiz_first_attempt_reward"/>
                                            <field string="Second Try" name="quiz_second_attempt_reward"/>
                                            <field string="Third Try" name="quiz_third_attempt_reward"/>
                                            <field string="Fourth Try &amp; More" name="quiz_fourth_attempt_reward"/>
                                        </group>
                                    </group>
                                    <group name="questions" string="Questions">
                                        <field name="question_ids" nolabel="1">
                                            <list>
                                                <field name="sequence" widget="handle"/>
                                                <field name="question" string="Question"/>
                                                <field name="answer_ids" string="Answers" widget="many2many_tags"/>
                                            </list>
                                        </field>
                                    </group>
                                </group>
                            </page>
                        </notebook>
                    </sheet>
                    <chatter/>
                </form>
            </field>
        </record>

        <record id="view_slide_slide_form_wo_channel_id" model="ir.ui.view">
            <field name="name">slide.slide.form.wo.channel_id</field>
            <field name="model">slide.slide</field>
            <field name="inherit_id" ref="view_slide_slide_form"/>
            <field name="priority" eval="50"/>
            <field name="mode">primary</field>
            <field name="arch" type="xml">
                <field name="channel_id" position="attributes">
                    <attribute name="invisible">1</attribute>
                    <attribute name="required">0</attribute>
                </field>
            </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" group_create="0"
                    records_draggable="0"
                    class="o_slide_kanban"
                    sample="1">
                    <templates>
                        <t t-name="card" class="flex-row">
                            <aside class="o_kanban_aside_full">
                                <t t-if="record.image_128.raw_value">
                                    <div class="o_kanban_image_fill position-relative w-100">
                                        <field name="image_128" class="h-100" widget="image" options="{'img_class': 'object-fit-cover'}"/>
                                        <field name="channel_id" class="o_website_slides_inner_image position-absolute bottom-0 end-0 bg-light" widget="image" options="{'preview_image': 'image_128', 'img_class': 'object-fit-contain'}"/>
                                    </div>
                                </t>
                                <t t-else="">
                                    <img src="/website_slides/static/src/img/channel-training-default.jpg" class="w-100" options="{'img_class': 'object-fit-cover'}" alt="Default training image"/>
                                </t>
                            </aside>
                            <main>
                                <field name="name" class="fw-bolder fs-5"/>
                                <field name="channel_id" class="text-mutex"/>
                                <field name="tag_ids" widget="many2many_tags" class="mb-2"/>
                                <footer class="mt-auto d-flex justify-content-between align-items-end pt-0">
                                    <span>
                                        <t t-if="record.slide_category.raw_value == 'infographic'">
                                            <i class="fa fa-file-image-o me-2" aria-label="Infographic" role="img" title="Infographic"/>
                                        </t>
                                        <t t-elif="record.slide_category.raw_value == 'article'">
                                            <i class="fa fa-file-code-o me-2" aria-label="article" role="img" title="Article"/>
                                        </t>
                                        <t t-elif="record.slide_category.raw_value == 'video'">
                                            <i class="fa fa-file-video-o me-2" aria-label="Video" role="img" title="Video"/>
                                        </t>
                                        <t t-elif="record.slide_category.raw_value == 'quiz'">
                                            <i class="fa fa-flag me-2" aria-label="Quiz" role="img" title="Quiz"/>
                                        </t>
                                        <t t-else=""><i class="fa fa-file-pdf-o me-2" aria-label="Document" role="img" title="Document"/></t>
                                        <field name="slide_category"/>
                                    </span>
                                    <span class="d-flex align-items-center">
                                        <i class="fa fa-clock-o me-2" aria-label="Duration" role="img" title="Duration"/><field name="completion_time" widget="float_time"/>
                                    </span>
                                    <span>
                                        <i class="fa fa-question me-2" aria-label="Number of Questions" role="img" title="Number of Questions"/><field name="questions_count"/>
                                    </span>
                                    <span>
                                        <i class="fa fa-eye me-2" aria-label="Views" role="img" title="Views"/><field name="total_views"/>
                                    </span>
                                    <field name="user_id" widget="many2one_avatar_user"/>
                                </footer>
                            </main>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record id="view_slide_slide_tree" model="ir.ui.view">
            <field name="name">slide.slide.list</field>
            <field name="model">slide.slide</field>
            <field name="arch" type="xml">
                <list string="Contents" sample="1" multi_edit="1">
                    <field name="name" readonly="1"/>
                    <field name="channel_id" readonly="1"/>
                    <field name="category_id" readonly="1" optional="hide"/>
                    <field name="user_id" widget="many2one_avatar_user"/>
                    <field name="is_published"/>
                    <field name="date_published" readonly="1"/>
                    <field name="completion_time" sum="Total" readonly="1" widget="float_time"/>
                </list>
            </field>
        </record>

        <record id="slide_slide_view_tree_report" model="ir.ui.view">
            <field name="name">slide.slide.view.list.report</field>
            <field name="model">slide.slide</field>
            <field name="priority" eval="20"/>
            <field name="arch" type="xml">
                <list string="Contents" sample="1">
                    <field name="name"/>
                    <field name="user_id" widget="many2one_avatar_user"/>
                    <field name="channel_id"/>
                    <field name="category_id" optional="hide"/>
                    <field name="date_published"/>
                    <field name="total_views" string="# Views" sum="Total Views"/>
                    <field name="questions_count" string="# Questions" sum="Total Questions"/>
                    <field name="completion_time" sum="Total Duration" widget="float_time"/>
                </list>
            </field>
        </record>

        <record id="view_slide_slide_search" model="ir.ui.view">
            <field name="name">slide.slide.filter</field>
            <field name="model">slide.slide</field>
            <field name="arch" type="xml">
                <search string="Search Contents">
                    <field name="name"/>
                    <field name="channel_id"/>
                    <field name="user_id"/>
                    <field name="tag_ids"/>
                    <filter name="filter_user_id_uid" string="My Content" domain="[('user_id', '=', uid)]"/>
                    <separator/>
                    <filter name="published" string="Published" domain="[('is_published', '=', True)]"/>
                    <filter name="not_published" string="Waiting for validation" domain="[('is_published', '=', False)]"/>
                    <separator/>
                    <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
                    <group expand="0" string="Group By">
                        <filter string="Course" name="groupby_channel" domain="[]" context="{'group_by': 'channel_id'}"/>
                        <filter string="Category" name="groupby_category" domain="[]" context="{'group_by': 'category_id'}"/>
                        <filter string="Type" name="groupby_type" domain="[]" context="{'group_by': 'slide_category'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="slide_slide_view_graph" model="ir.ui.view">
            <field name="name">slide.slide.view.graph</field>
            <field name="model">slide.slide</field>
            <field name="arch" type="xml">
                <graph string="Graph of Contents" stacked="0" sample="1">
                    <field name="channel_id"/>
                    <field name="slide_category"/>
                    <field name="total_views" type="measure"/>
                    <field name="quiz_first_attempt_reward" invisible="1"/>
                    <field name="quiz_second_attempt_reward" invisible="1"/>
                    <field name="quiz_third_attempt_reward" invisible="1"/>
                    <field name="quiz_fourth_attempt_reward" invisible="1"/>
                    <field name="sequence" invisible="1"/>
                </graph>
            </field>
        </record>

        <record id="slide_slide_view_pivot" model="ir.ui.view">
            <field name="name">slide.slide.view.pivot</field>
            <field name="model">slide.slide</field>
            <field name="arch" type="xml">
                <pivot sample="1">
                    <field name="channel_id" type="row"/>
                    <field name="total_views" type="measure"/>
                </pivot>
            </field>
        </record>

        <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">kanban,list,form</field>
            <field name="context">{'search_default_own_publications':True}</field>
            <field name="domain">[('is_category', '=', False)]</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    Add Content
                </p>
                <p>
                    Content are the lessons that compose a course
                    <br/>and can be of different types (presentations, documents, videos, ...).
                </p>
            </field>
        </record>

        <record id="slide_slide_action_report" model="ir.actions.act_window">
            <field name="name">Contents</field>
            <field name="res_model">slide.slide</field>
            <field name="view_mode">graph,list,form,pivot</field>
            <field name="context">{"search_default_published": 1}</field>
            <field name="domain">[('is_category', '=', False)]</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    No data yet!
                </p><p>
                    Create new content for your eLearning
                </p>
            </field>
        </record>

        <record id="slide_slide_action_report_view_graph" model="ir.actions.act_window.view">
            <field name="sequence" eval="0"/>
            <field name="view_mode">graph</field>
            <field name="view_id" ref="slide_slide_view_graph"/>
            <field name="act_window_id" ref="slide_slide_action_report"/>
        </record>
        <record id="slide_slide_action_report_view_tree" model="ir.actions.act_window.view">
            <field name="sequence" eval="1"/>
            <field name="view_mode">list</field>
            <field name="view_id" ref="slide_slide_view_tree_report"/>
            <field name="act_window_id" ref="slide_slide_action_report"/>
        </record>
        <record id="slide_slide_action_report_view_form" model="ir.actions.act_window.view">
            <field name="sequence" eval="2"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="view_slide_slide_form"/>
            <field name="act_window_id" ref="slide_slide_action_report"/>
        </record>
        <record id="slide_slide_action_report_view_pivot" model="ir.actions.act_window.view">
            <field name="sequence" eval="3"/>
            <field name="view_mode">pivot</field>
            <field name="view_id" ref="slide_slide_view_pivot"/>
            <field name="act_window_id" ref="slide_slide_action_report"/>
        </record>
    </data>
</odoo>