diff --git a/addons/website_sale_slides/views/website_slides_templates.xml b/addons/website_sale_slides/views/website_slides_templates.xml index 23fac6fe918..6d3e5bd3fe9 100644 --- a/addons/website_sale_slides/views/website_slides_templates.xml +++ b/addons/website_sale_slides/views/website_slides_templates.xml @@ -32,6 +32,20 @@ + + + + Free Preview + Preview + + + Free Preview + Preview + + + diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py index 68648b7ff9d..edad9c10419 100644 --- a/addons/website_slides/controllers/main.py +++ b/addons/website_slides/controllers/main.py @@ -406,7 +406,8 @@ class WebsiteSlides(WebsiteProfile): # sorting criterion if channel.channel_type == 'documentation': - actual_sorting = sorting if sorting and sorting in request.env['slide.slide']._order_by_strategy else channel.promote_strategy + default_sorting = 'latest' if channel.promote_strategy in ['specific', 'none', False] else channel.promote_strategy + actual_sorting = sorting if sorting and sorting in request.env['slide.slide']._order_by_strategy else default_sorting else: actual_sorting = 'sequence' order = request.env['slide.slide']._order_by_strategy[actual_sorting] @@ -489,7 +490,10 @@ class WebsiteSlides(WebsiteProfile): # of them but unreachable ones won't be clickable (+ slide controller will crash anyway) # documentation mode may display less slides than content by category but overhead of # computation is reasonable - values['slide_promoted'] = request.env['slide.slide'].sudo().search(domain, limit=1, order=order) + if channel.promote_strategy == 'specific': + values['slide_promoted'] = channel.sudo().promoted_slide_id + else: + values['slide_promoted'] = request.env['slide.slide'].sudo().search(domain, limit=1, order=order) limit_category_data = False if channel.channel_type == 'documentation': diff --git a/addons/website_slides/models/slide_channel.py b/addons/website_slides/models/slide_channel.py index b03b1a942e5..426265a2bd3 100644 --- a/addons/website_slides/models/slide_channel.py +++ b/addons/website_slides/models/slide_channel.py @@ -96,8 +96,8 @@ class Channel(models.Model): description_short = fields.Text('Short Description', translate=True, help="The description that is displayed on the course card") description_html = fields.Html('Detailed Description', translate=tools.html_translate, sanitize_attributes=False, sanitize_form=False) channel_type = fields.Selection([ - ('documentation', 'Documentation'), ('training', 'Training')], - string="Course type", default="documentation", required=True) + ('training', 'Training'), ('documentation', 'Documentation')], + string="Course type", default="training", required=True) sequence = fields.Integer(default=10, help='Display order') user_id = fields.Many2one('res.users', string='Responsible', default=lambda self: self.env.uid) color = fields.Integer('Color Index', default=0, help='Used to decorate kanban view') @@ -115,8 +115,17 @@ class Channel(models.Model): promote_strategy = fields.Selection([ ('latest', 'Latest Published'), ('most_voted', 'Most Voted'), - ('most_viewed', 'Most Viewed')], - string="Featured Content", default='latest', required=True) + ('most_viewed', 'Most Viewed'), + ('specific', 'Specific'), + ('none', 'None')], + string="Promoted Content", default='latest', required=False, + help='Depending the promote strategy, a slide will appear on the top of the course\'s page :\n' + ' * Latest Published : the slide created last.\n' + ' * Most Voted : the slide which have to most vote.\n' + ' * Most Viewed ; the slide which have been viewed the most.\n' + ' * Specific : You choose the slide to appear.\n' + ' * None : There won\'t be any slide showing.\n') + promoted_slide_id = fields.Many2one('slide.slide', string='Promoted Slide') access_token = fields.Char("Security Token", copy=False, default=_default_access_token) nbr_presentation = fields.Integer('Presentations', compute='_compute_slides_statistics', store=True) nbr_document = fields.Integer('Documents', compute='_compute_slides_statistics', store=True) @@ -131,7 +140,7 @@ class Channel(models.Model): rating_avg_stars = fields.Float("Rating Average (Stars)", compute='_compute_rating_stats', digits=(16, 1), compute_sudo=True) # configuration allow_comment = fields.Boolean( - "Allow rating on Course", default=False, + "Allow rating on Course", default=True, help="If checked it allows members to either:\n" " * like content and post comments on documentation course;\n" " * post comment and review on training course;") diff --git a/addons/website_slides/static/src/img/channel-training-default.jpg b/addons/website_slides/static/src/img/channel-training-default.jpg index 5d8b9093590..6d1bf29387a 100644 Binary files a/addons/website_slides/static/src/img/channel-training-default.jpg and b/addons/website_slides/static/src/img/channel-training-default.jpg differ diff --git a/addons/website_slides/views/slide_channel_views.xml b/addons/website_slides/views/slide_channel_views.xml index c15edb495a9..e656c5e8309 100644 --- a/addons/website_slides/views/slide_channel_views.xml +++ b/addons/website_slides/views/slide_channel_views.xml @@ -107,6 +107,10 @@ + diff --git a/addons/website_slides/views/website_slides_templates_course.xml b/addons/website_slides/views/website_slides_templates_course.xml index e6e547b9ba1..a294b9bd3cb 100644 --- a/addons/website_slides/views/website_slides_templates_course.xml +++ b/addons/website_slides/views/website_slides_templates_course.xml @@ -118,7 +118,11 @@ - + + + + @@ -128,7 +132,7 @@ - + @@ -206,7 +210,7 @@ href="#" t-att-data-channel-id="channel.id" t-att-data-channel-tag-ids="channel.tag_ids.ids"> - Add Tag + Add Tag @@ -386,12 +390,12 @@ + t-att-class="'o_wslides_slide_list_category_header position-relative d-flex justify-content-between align-items-center mt8 %s %s' % ('bg-white shadow-sm border-bottom-0' if category_id else 'border-0', 'o_wslides_js_category py-0' if channel.can_upload else 'py-2')"> - + (empty) @@ -422,7 +426,7 @@ - Add Section + + + + + + + + + Common tasks for a computer scientist + + + + + + + Asking Question + + + + 10 xp + + + + + + + Asking the right question + + + + + + Answering Questions + + + New + + + + + + + + Parts of computer science + + + + + + + Mathematics + + + + + + Science + + + + + + Logic + + + Preview + + + + + + + @@ -458,12 +535,14 @@ - Add Quiz + Add Quiz - Free preview + Preview - Free preview + + Preview + New @@ -481,7 +560,7 @@ - + @@ -490,7 +569,7 @@ - + @@ -647,7 +726,9 @@ - + + + @@ -708,13 +789,14 @@ + - Free preview + Preview Unpublished @@ -761,10 +843,4 @@ - - - o_wslides_promoted_slide - - -