diff --git a/addons/gamification/data/gamification_karma_rank_data.xml b/addons/gamification/data/gamification_karma_rank_data.xml index 25d94ca3739..b91ee3dd4dc 100644 --- a/addons/gamification/data/gamification_karma_rank_data.xml +++ b/addons/gamification/data/gamification_karma_rank_data.xml @@ -15,7 +15,7 @@ You just began the adventure! Welcome! Keep going ! 1 - + diff --git a/addons/gamification/data/gamification_karma_rank_demo.xml b/addons/gamification/data/gamification_karma_rank_demo.xml index 52b1f2c1f50..c34f93b486e 100644 --- a/addons/gamification/data/gamification_karma_rank_demo.xml +++ b/addons/gamification/data/gamification_karma_rank_demo.xml @@ -14,7 +14,7 @@ You begin to understand things ! Keep going! Keep going ! 100 - + @@ -22,7 +22,7 @@ Hey ! You're not so dumb after all ! Keep going ! 500 - + @@ -30,7 +30,7 @@ You're good ! Really Good ! Keep going ! 2000 - + @@ -38,7 +38,7 @@ Ok, RESPECT ! Keep going ! 10000 - + diff --git a/addons/gamification/static/img/rank_bachelor_badge.svg b/addons/gamification/static/img/rank_bachelor_badge.svg new file mode 100644 index 00000000000..6fd78eb62f5 --- /dev/null +++ b/addons/gamification/static/img/rank_bachelor_badge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/gamification/static/img/rank_doctor_badge.svg b/addons/gamification/static/img/rank_doctor_badge.svg new file mode 100644 index 00000000000..91964edd417 --- /dev/null +++ b/addons/gamification/static/img/rank_doctor_badge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/gamification/static/img/rank_master_badge.svg b/addons/gamification/static/img/rank_master_badge.svg new file mode 100644 index 00000000000..feb63293ce1 --- /dev/null +++ b/addons/gamification/static/img/rank_master_badge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/gamification/static/img/rank_newbie_badge.svg b/addons/gamification/static/img/rank_newbie_badge.svg new file mode 100644 index 00000000000..66720ce62df --- /dev/null +++ b/addons/gamification/static/img/rank_newbie_badge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/gamification/static/img/rank_student_badge.svg b/addons/gamification/static/img/rank_student_badge.svg new file mode 100644 index 00000000000..561ea368fc6 --- /dev/null +++ b/addons/gamification/static/img/rank_student_badge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/website_partner/data/website_partner_demo.xml b/addons/website_partner/data/website_partner_demo.xml index d0127fef0a9..a139e80be94 100644 --- a/addons/website_partner/data/website_partner_demo.xml +++ b/addons/website_partner/data/website_partner_demo.xml @@ -7,6 +7,9 @@ True + + True + True diff --git a/addons/website_profile/__init__.py b/addons/website_profile/__init__.py index 8c67f893b37..632e0b78318 100644 --- a/addons/website_profile/__init__.py +++ b/addons/website_profile/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +from . import controllers from . import models from . import controllers diff --git a/addons/website_profile/controllers/main.py b/addons/website_profile/controllers/main.py index b1a29efe708..92c69ae4c34 100644 --- a/addons/website_profile/controllers/main.py +++ b/addons/website_profile/controllers/main.py @@ -2,18 +2,34 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 +import werkzeug import werkzeug.exceptions import werkzeug.urls import werkzeug.wrappers -from odoo import http +from odoo import http, modules, tools from odoo.http import request from odoo.osv import expression +from odoo.tools import limited_image_resize class WebsiteProfile(http.Controller): + # Profile # --------------------------------------------------- + + def _check_avatar_access(self, user_id, **post): + """ Base condition to see user avatar independently form access rights + is to see published users having karma, meaning they participated to + frontend applications like forum or elearning. """ + try: + user = request.env['res.users'].sudo().browse(user_id).exists() + except: + return False + if user: + return user.website_published and user.karma > 0 + return False + def _check_user_profile_access(self, user_id): user_sudo = request.env['res.users'].sudo().browse(user_id) if user_sudo.karma == 0 or not user_sudo.website_published or \ @@ -41,6 +57,47 @@ class WebsiteProfile(http.Controller): 'edit_button_url_param': '', } + @http.route([ + '/profile/avatar/', + ], type='http', auth="public", website=True, sitemap=False) + def get_user_profile_avatar(self, user_id=0, width=0, height=0, crop=False, avoid_if_small=False, upper_limit=False, **post): + can_sudo = self._check_avatar_access(user_id, **post) + fname = post.get('field', 'image_medium') + if can_sudo: + status, headers, content = request.env['ir.http'].sudo().binary_content( + model='res.users', id=user_id, field=fname, + default_mimetype='image/png') + else: + status, headers, content = request.env['ir.http'].binary_content( + model='res.users', id=user_id, field=fname, + default_mimetype='image/png') + if status == 301: + return request.env['ir.http']._response_by_status(status, headers, content) + if status == 304: + return werkzeug.wrappers.Response(status=304) + + if not content: + img_path = modules.get_module_resource('web', 'static/src/img', 'placeholder.png') + with open(img_path, 'rb') as f: + image = f.read() + content = base64.b64encode(image) + dictheaders = dict(headers) if headers else {} + dictheaders['Content-Type'] = 'image/png' + headers = list(dictheaders.items()) + if not (width or height): + suffix = fname.split('_')[-1] + if suffix in ('small', 'medium', 'big'): + content = getattr(tools, 'image_resize_image_%s' % suffix)(content) + + content = limited_image_resize( + content, width=width, height=height, crop=crop, upper_limit=upper_limit, avoid_if_small=avoid_if_small) + + image_base64 = base64.b64decode(content) + headers.append(('Content-Length', len(image_base64))) + response = request.make_response(image_base64, headers) + response.status_code = status + return response + @http.route(['/profile/user/'], type='http', auth="public", website=True) def view_user_profile(self, user_id, **post): user = self._check_user_profile_access(user_id) diff --git a/addons/website_rating/static/src/xml/portal_chatter.xml b/addons/website_rating/static/src/xml/portal_chatter.xml index 78b1b64baae..e331c0393cc 100644 --- a/addons/website_rating/static/src/xml/portal_chatter.xml +++ b/addons/website_rating/static/src/xml/portal_chatter.xml @@ -44,8 +44,17 @@ It can alse be used to modify a message --> - - + + + + + + + + ( ratings) + + + Modify your review @@ -55,15 +64,6 @@ - - - - - - - () - - diff --git a/addons/website_rating/views/website_rating_templates.xml b/addons/website_rating/views/website_rating_templates.xml index 5031aec388c..32dc3d3c573 100644 --- a/addons/website_rating/views/website_rating_templates.xml +++ b/addons/website_rating/views/website_rating_templates.xml @@ -49,7 +49,19 @@ the message will be posted with the identity of the partner_id of the object --> - + diff --git a/addons/website_sale_slides/__init__.py b/addons/website_sale_slides/__init__.py index dc5e6b693d1..7d34c7c054a 100644 --- a/addons/website_sale_slides/__init__.py +++ b/addons/website_sale_slides/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +from . import controllers from . import models diff --git a/addons/website_sale_slides/__manifest__.py b/addons/website_sale_slides/__manifest__.py index 59d15170b4b..b44cab80345 100644 --- a/addons/website_sale_slides/__manifest__.py +++ b/addons/website_sale_slides/__manifest__.py @@ -13,5 +13,6 @@ 'data': [ 'data/website_sale_slides_demo.xml', 'views/slide_channel_views.xml', + 'views/website_slides_templates.xml', ] } diff --git a/addons/website_sale_slides/controllers/__init__.py b/addons/website_sale_slides/controllers/__init__.py new file mode 100644 index 00000000000..d4fd554ab5c --- /dev/null +++ b/addons/website_sale_slides/controllers/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import slides diff --git a/addons/website_sale_slides/controllers/slides.py b/addons/website_sale_slides/controllers/slides.py new file mode 100644 index 00000000000..7139af7ba10 --- /dev/null +++ b/addons/website_sale_slides/controllers/slides.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import http, _ +from odoo.exceptions import AccessError, UserError +from odoo.http import request +from odoo.osv import expression + +from odoo.addons.website_slides.controllers.main import WebsiteSlides + + +class WebsiteSaleSlides(WebsiteSlides): + + def _prepare_additional_channel_values(self, values, **kwargs): + values = super(WebsiteSaleSlides, self)._prepare_additional_channel_values(values, **kwargs) + channel = values['channel'] + if channel.visibility == 'payment' and channel.product_id: + pricelist = request.website.get_current_pricelist() + values['product_info'] = channel.product_id.product_tmpl_id._get_combination_info(product_id=channel.product_id.id, pricelist=pricelist) + values['product_info']['currency_id'] = request.website.currency_id + return values diff --git a/addons/website_sale_slides/data/website_sale_slides_demo.xml b/addons/website_sale_slides/data/website_sale_slides_demo.xml index 554e7500133..c7ff453e837 100644 --- a/addons/website_sale_slides/data/website_sale_slides_demo.xml +++ b/addons/website_sale_slides/data/website_sale_slides_demo.xml @@ -2,45 +2,77 @@ - Furniture creation course + High-Level DIY Furniture 100.0 100.0 service - + - - Furniture creation + + High-Level DIY Furniture most_viewed - - All you need to know about furniture creation. + training payment + + + + All you need to know about furniture creation. + + + Tools and Methods + + 10 + + + Hand on ! + + 20 - - How to find quality wood. + + Unforgettable Tools + + + presentation + + + + + 10 + Tools you will need to complete this course. + + + How to find quality wood https://www.youtube.com/watch?v=5WMqwTnZ-qs 5WMqwTnZ-qs video - + + - - - Learn of to identify quality wood in order to create solid furnitures. + + 5 + + Learn of to identify quality wood in order to create solid furnitures. - - - How to create your own piece of furniture. + + How to create your own piece of furniture https://www.youtube.com/watch?v=ptjeDDoURL8 ptjeDDoURL8 video - + + - - - From a piece of wood to a fully functional furniture, step by step. + + 0 + + From a piece of wood to a fully functional furniture, step by step. diff --git a/addons/website_sale_slides/data/demo-thumbnails/5WMqwTnZ-qs.png b/addons/website_sale_slides/static/img/5WMqwTnZ-qs.png similarity index 100% rename from addons/website_sale_slides/data/demo-thumbnails/5WMqwTnZ-qs.png rename to addons/website_sale_slides/static/img/5WMqwTnZ-qs.png diff --git a/addons/website_sale_slides/static/img/channel_demo_diy.jpg b/addons/website_sale_slides/static/img/channel_demo_diy.jpg new file mode 100644 index 00000000000..fe51b1cc6bf Binary files /dev/null and b/addons/website_sale_slides/static/img/channel_demo_diy.jpg differ diff --git a/addons/website_sale_slides/data/demo-thumbnails/product_course.png b/addons/website_sale_slides/static/img/product_course.png similarity index 100% rename from addons/website_sale_slides/data/demo-thumbnails/product_course.png rename to addons/website_sale_slides/static/img/product_course.png diff --git a/addons/website_sale_slides/data/demo-thumbnails/ptjeDDoURL8.png b/addons/website_sale_slides/static/img/ptjeDDoURL8.png similarity index 100% rename from addons/website_sale_slides/data/demo-thumbnails/ptjeDDoURL8.png rename to addons/website_sale_slides/static/img/ptjeDDoURL8.png diff --git a/addons/website_sale_slides/views/website_slides_templates.xml b/addons/website_sale_slides/views/website_slides_templates.xml new file mode 100644 index 00000000000..8ae6699ddd8 --- /dev/null +++ b/addons/website_sale_slides/views/website_slides_templates.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + Buy Course + + + + + Course Not Buyable + + + + + + + diff --git a/addons/website_slides/__manifest__.py b/addons/website_slides/__manifest__.py index aba81fcc88b..32b4f407e67 100644 --- a/addons/website_slides/__manifest__.py +++ b/addons/website_slides/__manifest__.py @@ -25,6 +25,7 @@ Share and Publish Videos, Presentations and Documents' 'data': [ 'views/assets.xml', 'views/res_config_settings_views.xml', + 'views/website_slides_templates_homepage.xml', 'views/website_slides_templates.xml', 'views/website_slides_embed_templates.xml', 'views/slide_slide_views.xml', @@ -34,7 +35,8 @@ Share and Publish Videos, Presentations and Documents' 'views/slide_channel_invite_views.xml', 'views/website_slides_menu_views.xml', 'views/website_slides_templates_profile.xml', - 'data/website_slides_ir_data.xml', + 'data/ir_data.xml', + 'data/gamification_data.xml', 'data/mail_data.xml', 'data/slide_data.xml', 'data/website_data.xml', @@ -42,7 +44,10 @@ Share and Publish Videos, Presentations and Documents' 'security/website_slides_security.xml' ], 'demo': [ - 'data/website_slides_demo.xml' + 'data/slide_channel_tag_demo.xml', + 'data/slide_channel_demo.xml', + 'data/slide_slide_demo.xml', + 'data/slide_user_demo.xml', ], 'installable': True, 'application': True, diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py index 6ab75f4d8db..4b0db549ef6 100644 --- a/addons/website_slides/controllers/main.py +++ b/addons/website_slides/controllers/main.py @@ -2,6 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 +import itertools import logging import werkzeug @@ -21,10 +22,10 @@ _logger = logging.getLogger(__name__) class WebsiteSlides(WebsiteProfile): _slides_per_page = 12 _slides_per_list = 20 - _order_by_criterion = { - 'date': 'date_published desc', + _channel_order_by_criterion = { + 'vote': 'total_votes desc', 'view': 'total_views desc', - 'vote': 'likes desc', + 'date': 'create_date desc', } def sitemap_slide(env, rule, qs): @@ -47,13 +48,6 @@ class WebsiteSlides(WebsiteProfile): slide.action_set_viewed() return True - def _prepare_user_values(self, **kwargs): - values = super(WebsiteSlides, self)._prepare_user_values(**kwargs) - channel = self._get_channels(**kwargs) - if channel: - values['channel'] = channel - return values - def _get_slide_detail(self, slide): most_viewed_slides = slide.get_most_viewed_slides(self._slides_per_list) related_slides = slide.get_related_slides(self._slides_per_list) @@ -66,57 +60,144 @@ class WebsiteSlides(WebsiteProfile): 'comments': slide.website_message_ids or [], } + def _extract_channel_tag_search(self, **post): + tags = request.env['slide.channel.tag'] + for key in (_key for _key in post if _key.startswith('channel_tag_group_id_')): + group_id, tag_id = False, False + try: + group_id = int(key.lstrip('channel_tag_group_id_')) + tag_id = int(post[key]) + except: + pass + else: + search_tag = request.env['slide.channel.tag'].search([('id', '=', tag_id), ('group_id', '=', group_id)]).exists() + if search_tag: + tags |= search_tag + return tags + + def _build_channel_domain(self, base_domain, **post): + search_term = post.get('search') + category_id = post.get('category_id') + channel_tag_id = post.get('channel_tag_id') + tags = self._extract_channel_tag_search(**post) + + domain = base_domain + if search_term: + domain = expression.AND([ + domain, + ['|', ('name', 'ilike', search_term), ('description', 'ilike', search_term)]]) + if category_id: + domain = expression.AND([domain, [('category_ids', 'in', [category_id])]]) + elif channel_tag_id: + domain = expression.AND([domain, [('tag_ids', 'in', [channel_tag_id])]]) + elif tags: + domain = expression.AND([domain, [('tag_ids', 'in', tags.ids)]]) + return domain + # -------------------------------------------------- # MAIN / SEARCH # -------------------------------------------------- @http.route('/slides', type='http', auth="public", website=True) - def slides_index(self, *args, **post): - """ Returns a list of available channels: if only one is available, - redirects directly to its slides - """ + def slides_channel_home(self, **post): + """ Home page for eLearning platform. Is mainly a container page, does not allow search / filter. """ domain = request.website.website_domain() - # search bar - search_term = post.get('search') - if search_term: - domain = expression.AND([domain, ['|', ('name', 'ilike', search_term), ('description', 'ilike', search_term)]]) + channels_all = request.env['slide.channel'].search(domain) + if not request.env.user._is_public(): + channels_my = channels_all.filtered(lambda channel: channel.completion > 0).sorted('completion', reverse=True)[:3] + else: + channels_my = request.env['slide.channel'] + channels_popular = channels_all.sorted('total_votes', reverse=True)[:3] + channels_newest = channels_all.sorted('create_date', reverse=True)[:3] - channels = request.env['slide.channel'].search(domain, order='sequence, id') - if not channels: - return request.render("website_slides.channel_not_found", {'search_term': search_term}) - elif len(channels) == 1 and not search_term: # don't auto redirect to only result when searching - return request.redirect("/slides/%s" % channels.id) - return request.render('website_slides.channels', { - 'channels': channels, + # fetch 'latests achievements' for non logged people + if request.env.user._is_public(): + achievements = request.env['gamification.badge.user'].sudo().search([], limit=5) + challenges = None + challenges_done = None + else: + achievements = None + challenges = request.env['gamification.challenge'].sudo().search([('category', '=', 'slides')], order='id asc', limit=5) + challenges_done = request.env['gamification.badge.user'].sudo().search([ + ('challenge_id', 'in', challenges.ids), + ('user_id', '=', request.env.user.id) + ]).mapped('challenge_id') + + # fetch 'heroes of the week' for non logged people + if request.env.user._is_public(): + users = request.env['res.users'].sudo().search([ + ('karma', '>', 0), + ('website_published', '=', True)], limit=5, order='create_date desc') + else: + users = None + + return request.render('website_slides.courses_home', { 'user': request.env.user, 'is_public_user': request.website.is_public_user(), - 'search_term': search_term, + 'channels_my': channels_my, + 'channels_popular': channels_popular, + 'channels_newest': channels_newest, + 'achievements': achievements, + 'users': users, + 'challenges': challenges, + 'challenges_done': challenges_done, }) + @http.route('/slides/all', type='http', auth="public", website=True) + def slides_channel_all(self, **post): + """ Home page displaying a list of courses displayed according to some + criterion and search terms. + + : param dict post: post parameters, including + * search_term: keywords entered in the search box, used to filter on slide content; + * category_id: id of a slide.category; + * channel_tag_id: id of a channel.tag; + """ + domain = request.website.website_domain() + domain = self._build_channel_domain(domain, **post) + + order = self._channel_order_by_criterion.get(post.get('sorting', 'date'), 'create_date desc') + + channels = request.env['slide.channel'].search(domain, order=order) + channels_layouted = list(itertools.zip_longest(*[iter(channels)] * 4, fillvalue=None)) + + tag_groups = request.env['slide.channel.tag.group'].search(['&', ('tag_ids', '!=', False), ('website_published', '=', True)]) + search_tags = self._extract_channel_tag_search(**post) + + return request.render('website_slides.courses_all', { + 'user': request.env.user, + 'is_public_user': request.website.is_public_user(), + 'channels_layouted': channels_layouted, + 'tag_groups': tag_groups, + 'search_term': post.get('search'), + 'search_tags': search_tags, + }) + + def _prepare_additional_channel_values(self, values, **kwargs): + return values + @http.route([ - '''/slides/''', - '''/slides//page/''', - - '''/slides//''', - '''/slides///page/''', - - '''/slides//tag/''', - '''/slides//tag//page/''', - '''/slides//category/''', - '''/slides//category//page/''', - - '''/slides//category//''', - '''/slides//category///page/'''], - type='http', auth="public", website=True, sitemap=sitemap_slide) - def channel(self, channel, category=None, tag=None, page=1, slide_type=None, sorting='creation', search=None, **kw): + '/slides/', + '/slides//page/', + '/slides//tag/', + '/slides//tag//page/', + '/slides//category/', + '/slides//category//page/' + ], type='http', auth="public", website=True, sitemap=sitemap_slide) + def channel(self, channel, category=None, tag=None, page=1, slide_type=None, sorting=None, search=None, **kw): if not channel.can_access_from_current_website(): raise werkzeug.exceptions.NotFound() - user = request.env.user - Slide = request.env['slide.slide'] domain = [('channel_id', '=', channel.id)] + if not request.env.user.has_group('website.group_website_publisher'): + domain = expression.AND([ + domain, + ['&', ('website_published', '=', True), ('channel_id.website_published', '=', True)] + ]) + pager_url = "/slides/%s" % (channel.id) pager_args = {} + slide_types = dict(request.env['slide.slide']._fields['slide_type']._description_selection(request.env)) if search: domain += [ @@ -135,35 +216,42 @@ class WebsiteSlides(WebsiteProfile): pager_url += "/tag/%s" % tag.id if slide_type: domain += [('slide_type', '=', slide_type)] - pager_url += "/%s" % slide_type + pager_url += "?slide_type=%s" % slide_type - if not sorting or sorting not in self._order_by_criterion: - sorting = 'date' - order = self._order_by_criterion[sorting] - pager_args['sorting'] = sorting + # sorting criterion + actual_sorting = sorting if sorting and sorting in request.env['slide.slide']._order_by_strategy else channel.promote_strategy + order = request.env['slide.slide']._order_by_strategy[actual_sorting] + pager_args['sorting'] = actual_sorting - pager_count = Slide.search_count(domain) + pager_count = request.env['slide.slide'].sudo().search_count(domain) pager = request.website.pager(url=pager_url, total=pager_count, page=page, step=self._slides_per_page, scope=self._slides_per_page, url_args=pager_args) - slides = Slide.search(domain, limit=self._slides_per_page, offset=pager['offset'], order=order) values = { 'channel': channel, - 'category': category, - 'slides': slides, - 'tag': tag, - 'slide_type': slide_type, - 'sorting': sorting, + # search + 'search_category': category, + 'search_tag': tag, + 'search_slide_type': slide_type, + 'slide_types': slide_types, + 'sorting': actual_sorting, 'search': search, - 'user': user, - 'pager': pager, - 'is_public_user': request.website.is_public_user(), + # chatter 'rating_avg': channel.rating_avg, 'rating_count': channel.rating_count, + # display data + 'user': request.env.user, + 'pager': pager, + 'is_public_user': request.website.is_public_user(), } if not request.env.user._is_public(): - last_message_values = request.env['mail.message'].search([('model', '=', channel._name), ('res_id', '=', channel.id), ('author_id', '=', user.partner_id.id), ('website_published', '=', True)], order='write_date DESC', limit=1).read(['body', 'rating_value']) + last_message_values = request.env['mail.message'].search([ + ('model', '=', channel._name), + ('res_id', '=', channel.id), + ('author_id', '=', request.env.user.partner_id.id), + ('website_published', '=', True) + ], order='write_date DESC', limit=1).read(['body', 'rating_value']) last_message_data = last_message_values[0] if last_message_values else {} values.update({ 'message_post_hash': channel._sign_token(request.env.user.partner_id.id), @@ -174,21 +262,32 @@ class WebsiteSlides(WebsiteProfile): }) # Display uncategorized slides - if not slide_type and not category: - category_datas = [] - for category in Slide.read_group(domain, ['category_id'], ['category_id']): + # fetch slides; done as sudo because we want to display all of them but + # unreachable ones won't be clickable (+ slide controller will crash anyway) + if not category: + category_data = [] + for category in request.env['slide.slide'].sudo().read_group(domain, ['category_id'], ['category_id']): category_id, name = category.get('category_id') or (False, _('Uncategorized')) - category_datas.append({ + category_data.append({ 'id': category_id, 'name': name, 'total_slides': category['category_id_count'], - 'slides': Slide.search(category['__domain'], limit=4, offset=0, order=order) + 'slides': request.env['slide.slide'].sudo().search(category['__domain'], limit=4, offset=0, order=order) }) - values.update({ - 'category_datas': category_datas, - }) + else: + slides_sudo = request.env['slide.slide'].sudo().search(domain, limit=self._slides_per_page, offset=pager['offset'], order=order) + category_data = [{ + 'id': category.id, + 'name': category.name, + 'total_slides': len(slides_sudo), + 'slides': slides_sudo, + }] + values['slide_promoted'] = request.env['slide.slide'].sudo().search(domain, limit=1, order=order) + values['category_data'] = category_data - return request.render('website_slides.home', values) + values = self._prepare_additional_channel_values(values, **kw) + + return request.render('website_slides.course_main', values) @http.route(['/slides/channel/add'], type='http', auth='user', methods=['POST'], website=True) def slide_channel_create(self, *args, **kw): @@ -411,8 +510,17 @@ class WebsiteSlides(WebsiteProfile): # if the slide can be embedded, and properly display the error message. return request.render('website_slides.embed_slide_forbidden', {}) - # Profile - # --------------------------------------------------- + # -------------------------------------------------- + # PROFILE + # -------------------------------------------------- + + def _prepare_user_values(self, **kwargs): + values = super(WebsiteSlides, self)._prepare_user_values(**kwargs) + channel = self._get_channels(**kwargs) + if channel: + values['channel'] = channel + return values + def _get_channels(self, **kwargs): channels = [] if kwargs.get('channel'): diff --git a/addons/website_slides/data/demo-thumbnails/8DBabYQ1nUE.jpg b/addons/website_slides/data/demo-thumbnails/8DBabYQ1nUE.jpg deleted file mode 100644 index 2a4245bf9ba..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/8DBabYQ1nUE.jpg and /dev/null differ diff --git a/addons/website_slides/data/demo-thumbnails/QtIU0p8daAo.jpg b/addons/website_slides/data/demo-thumbnails/QtIU0p8daAo.jpg deleted file mode 100644 index 7db70d6aeb4..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/QtIU0p8daAo.jpg and /dev/null differ diff --git a/addons/website_slides/data/demo-thumbnails/VMuCr5_arsY.jpg b/addons/website_slides/data/demo-thumbnails/VMuCr5_arsY.jpg deleted file mode 100644 index ca2ceb8e819..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/VMuCr5_arsY.jpg and /dev/null differ diff --git a/addons/website_slides/data/demo-thumbnails/Vp5xqQOWLzE.jpg b/addons/website_slides/data/demo-thumbnails/Vp5xqQOWLzE.jpg deleted file mode 100644 index 6f692064738..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/Vp5xqQOWLzE.jpg and /dev/null differ diff --git a/addons/website_slides/data/demo-thumbnails/fgdz8MH2YHY.jpg b/addons/website_slides/data/demo-thumbnails/fgdz8MH2YHY.jpg deleted file mode 100644 index 19be3967af2..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/fgdz8MH2YHY.jpg and /dev/null differ diff --git a/addons/website_slides/data/demo-thumbnails/sDxfUTd-gs0.jpg b/addons/website_slides/data/demo-thumbnails/sDxfUTd-gs0.jpg deleted file mode 100644 index 38a695d6910..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/sDxfUTd-gs0.jpg and /dev/null differ diff --git a/addons/website_slides/data/demo-thumbnails/tUx39vAENy0.jpg b/addons/website_slides/data/demo-thumbnails/tUx39vAENy0.jpg deleted file mode 100644 index 223b7a47e0b..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/tUx39vAENy0.jpg and /dev/null differ diff --git a/addons/website_slides/data/demo-thumbnails/v2O0YZU19ms.jpg b/addons/website_slides/data/demo-thumbnails/v2O0YZU19ms.jpg deleted file mode 100644 index 4cf84bcdd0c..00000000000 Binary files a/addons/website_slides/data/demo-thumbnails/v2O0YZU19ms.jpg and /dev/null differ diff --git a/addons/website_slides/data/gamification_data.xml b/addons/website_slides/data/gamification_data.xml new file mode 100644 index 00000000000..3a82e567393 --- /dev/null +++ b/addons/website_slides/data/gamification_data.xml @@ -0,0 +1,207 @@ + + + + + + Get started + Register to the platform + + + bronze + nobody + + + Get started + Register to the platform + count + boolean + + higher + [ + ('active', '!=', False), + ('karma', '>', 0), + ] + True + + user.id + + + Register to the platform + slides + once + personal + never + + True + [('karma', '>', 0)] + inprogress + + + + + 1 + + + + + Know yourself + Complete your profile + + + bronze + nobody + + + Know yourself + Complete your profile + count + boolean + + higher + [ + ('partner_id.country_id', '!=', False), + ('partner_id.city', '!=', False), + ('partner_id.email', '!=', False) + ] + True + + user.id + + + Complete your profile + slides + once + personal + never + + True + [('karma', '>', 0)] + inprogress + + + + + 1 + + + + + Power User + Complete a course + + + silver + nobody + + + Power User + Complete a course + count + boolean + + higher + [ + ('completed', '=', True) + ] + True + + user.partner_id.id + + + Complete a course + slides + once + personal + never + + True + [('karma', '>', 0)] + inprogress + + + + + 1 + + + + + Certified Knowledge + Get a certification + + + gold + nobody + + + Certified Knowledge + Get a certification + count + boolean + + higher + [ + ('completed', '=', True), + (0, '=', 1) + ] + True + + user.partner_id.id + + + Get a certification + slides + once + personal + never + + True + [('karma', '>', 0)] + inprogress + + + + + 1 + + + + + Community hero + Reach 2000 XP + + + gold + nobody + + + Community hero + Reach 2000 XP + count + boolean + + higher + [ + ('karma', '>=', 2000) + ] + True + + user.id + + + Read 2000 XP + slides + once + personal + never + + True + [('karma', '>', 0)] + inprogress + + + + + 1 + + diff --git a/addons/website_slides/data/website_slides_ir_data.xml b/addons/website_slides/data/ir_data.xml similarity index 100% rename from addons/website_slides/data/website_slides_ir_data.xml rename to addons/website_slides/data/ir_data.xml diff --git a/addons/website_slides/data/slide_channel_demo.xml b/addons/website_slides/data/slide_channel_demo.xml new file mode 100644 index 00000000000..e2732e4efe9 --- /dev/null +++ b/addons/website_slides/data/slide_channel_demo.xml @@ -0,0 +1,160 @@ + + + + + Basics of Gardening + training + latest + + + +Learn the basics of gardening ! + + + Requirements + + 10 + + + Tools + + 20 + + + + Taking care of Trees + training + + latest + + public + + +In this training you will learn how to take care of trees: when to plant, potted trees, ... + + + Interesting Facts + + 10 + + + Methods + + 20 + + + + Trees, Wood and Gardens + documentation + + most_viewed + + public + + +A lot of nice documentation: trees, wood, gardens. After that you will know everything. + + + Trees + + 10 + + + Wood + + 20 + + + + Choose your wood ! + training + + latest + + public + + +Knowing which kind of wood to use depending on your application is important. In this course you +will learn the basics of wood characteristics. + + + Introduction + + 10 + + + + Furniture Technical Specifications + documentation + + most_voted + + invite + + +We're also Santa Claus! Belligerent and numerous. I am the man with no name, + Zapp Brannigan! + + + Introduction + + 10 + + + + Basics of Furniture Creation + training + + training + latest + + invite + + All you need to know about furniture creation. + + + Introduction + + 10 + + + + Tag0 + + + Tag1 + + + Tag2 + + + + Tools + + + Colorfull + + + HowTo + + + diff --git a/addons/website_slides/data/slide_channel_tag_demo.xml b/addons/website_slides/data/slide_channel_tag_demo.xml new file mode 100644 index 00000000000..7b9a843fc29 --- /dev/null +++ b/addons/website_slides/data/slide_channel_tag_demo.xml @@ -0,0 +1,49 @@ + + + + Your Level + + + + Basic + + + + Intermediate + + + + Advanced + + + + + Your Role + + + + Gardener + + + + Carpenter + + + + Furniture Designer + + + + + Quiz + + + + Certification + + + + Dog Friendly + + + \ No newline at end of file diff --git a/addons/website_slides/data/slide_data.xml b/addons/website_slides/data/slide_data.xml index cb2eda5bb3d..a94bde8ce00 100644 --- a/addons/website_slides/data/slide_data.xml +++ b/addons/website_slides/data/slide_data.xml @@ -2,18 +2,11 @@ - Public Channel + Our documentation most_viewed public - Default channel for slides, all public users can access content of this channel. - - - Private Channel - - - invite - Used to publish slides in partner network privately. + Public access to presentations and documentation. diff --git a/addons/website_slides/data/slide_slide_demo.xml b/addons/website_slides/data/slide_slide_demo.xml new file mode 100644 index 00000000000..cf47aca1637 --- /dev/null +++ b/addons/website_slides/data/slide_slide_demo.xml @@ -0,0 +1,154 @@ + + + + + Know-How Summary + + + presentation + + + + + 40 + + A summary of know-how: how and what. + + + + Tree Infographic + + infographic + + + + + 5 + + Just some basics Tree Infographic. + + + Interesting Tree Facts + + infographic + + + + + 10 + + Just some basics Interesting Tree Facts. + + + Energy Efficiency Facts + + infographic + + + + + 15 + + Just some basics Energy Efficiency Facts. + + + How to plant a potted tree + https://www.youtube.com/watch?v=QYmgrw0PgLU + + QYmgrw0PgLU + video + + + + + 0 + + Jim and Todd plant a potted tree for a customer of Knecht's Nurseries and Landscaping. Narrated by Leif Knecht, owner. + + + A little chat with Harry Potted + + webpage + + + + + + + + + Catchy Headline + + + Write one or two paragraphs describing your product, services or a specific feature. To be successful your content needs to be useful to your readers. + + + About us + Contact us + + + + + + + + + + + + Section Subtitle + Write one or two paragraphs describing your product or services. To be successful your content needs to be useful to your readers. + Start with the customer – find out what they want and give it to them. + + Discover more + + + + + + + + 5 + + We had a little chat with Harry Potted, sure he had interesting things to say ! + + + 3 Main Methodologies + + + presentation + + + + + 20 + + A summary of know-how: how and what. + + + + How to find quality wood + https://www.youtube.com/watch?v=5WMqwTnZ-qs + 5WMqwTnZ-qs + video + + + + + + Learn of to identify quality wood in order to create solid furnitures. + + + How to create your own piece of furniture + https://www.youtube.com/watch?v=ptjeDDoURL8 + ptjeDDoURL8 + video + + + + + + From a piece of wood to a fully functional furniture, step by step. + + + diff --git a/addons/website_slides/data/slide_user_demo.xml b/addons/website_slides/data/slide_user_demo.xml new file mode 100644 index 00000000000..12700c81712 --- /dev/null +++ b/addons/website_slides/data/slide_user_demo.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + slide.channel + + + Very good course. + + + + + + + 4 + + + + slide.channel + + + Interesting ! + + + + + + + 4 + + + + slide.channel + + + Missing examples. + + + + + + + 3 + + + + diff --git a/addons/website_slides/data/website_slides_demo.xml b/addons/website_slides/data/website_slides_demo.xml deleted file mode 100644 index 5bc27b8198f..00000000000 --- a/addons/website_slides/data/website_slides_demo.xml +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - Featured Presentations - - 10 - - - Odoo Days - - 20 - - - - CMS - - - - Marketing - - - - Odoo Days - - - - Odoo MRP - https://www.youtube.com/watch?v=QtIU0p8daAo - QtIU0p8daAo - video - - - - - - - Discover how you can integrate MRP, PLM, Quality and Maintenance in a single application to maximize the efficiency of your manufacturing operations. - -Read more about the features at: https://www.odoo.com/page/manufacturing-features - -Discover Odoo MRP: https://www.odoo.com/page/manufacturing - - - Odoo CRM - https://www.youtube.com/watch?v=fgdz8MH2YHY - fgdz8MH2YHY - video - - - - - - - Discover the CRM sales people love https://www.odoo.com/page/crm - - - Odoo All-in-One Software Demonstration - https://www.youtube.com/watch?v=tUx39vAENy0 - tUx39vAENy0 - video - - - - - - - Discover the all-in-one business management software solution that fits any business size and use case. - -Learn more at https://odoo.com - - - Odoo Sign Demonstration - https://www.youtube.com/watch?v=8DBabYQ1nUE - 8DBabYQ1nUE - video - - - - - - - Stop doing manual printing and scanning. Move to electronic signature with Odoo Sign! - -Discover more at https://www.odoo.com/page/sign - - - Awesome Timesheet by Odoo - https://www.youtube.com/watch?v=v2O0YZU19ms - v2O0YZU19ms - video - - - - - - - Download Awesome Timesheet by Odoo and discover how easy time tracking and employee management can be! - -Chrome: http://bit.ly/2613LcY -iOS: http://bit.ly/1ZUZsZD - - - Odoo Marketing - https://www.youtube.com/watch?v=sDxfUTd-gs0 - sDxfUTd-gs0 - video - - - - - - - Discover how easy marketing your business can be with Odoo - - - Odoo Inventory - https://www.youtube.com/watch?v=Vp5xqQOWLzE - Vp5xqQOWLzE - video - - - - - - - Warehouse management software for the 21st century. - -Discover Odoo Inventory: https://www.odoo.com/page/warehouse - - - Odoo Sales - https://www.youtube.com/watch?v=VMuCr5_arsY - VMuCr5_arsY - video - - - - - - - Learn more at https://www.odoo.com/page/sales - - - - Open Days 2014 Infographic - - - infographic - - - - - 13 - 7399 - - - - Company Culture - - - presentation - - - - - 13 - 6399 - Indexed content, automatically generated. - - - - - OpenSource CMS, A performance comparison - Mantavya Gajjar - - - presentation - - - - - 10 - 4718 - 1. Open Source CMS A performance comparision Mantavya Gajjar – Managining Director, Odoo India -2. Topics 1 2 3 4 5 o Introduction – Products to Compare – Test Environment o Test Cases (home, catalogue, product pages) – Performance ● Google PageSpeed Inside ● Speed Test using Pingdom – Scalability ● Load Test using Blitz – Maintainability ● Source Code – cloc ● Community to maintain the source code – W3C Markup Validations o Conclusion -3. Introduction -4. Introduction Open Source Products, compared with Odoo -5. Odoo o Version Saas4 o Standard Data / Modules – Demo data with Odoo Website, Commerce, Forum, News, etc -6. Magento o Version 1.8.1.0 o Custom Data / Module – Home page and widgets – Added some products and their description -7. Drupal o Version 7.27 o Custom Data / Modules – CK-Editor & CK-Finder – Ubercart for e-commerce, Rules, ctools, views, entity -8. Prestashop o Version 1.6 o No Custom Data / Modules – Use default demo shop -9. Performance Google PageSpeed Insight & Pingdom -10. Google PageSpeed Insights Home page on desktop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ -11. Home Page -12. Odoo vs Drupal Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -13. Odoo vs Magento Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -14. Odoo vs Prestashop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -15. Summary : Google Page Speed Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -16. Google Page Speed Insights Home page on mobile Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ -17. Odoo Vs Drupal Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -18. Odoo Vs Magento Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -19. Odoo Vs Prestashop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -20. Summary : Google Page Speed Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -21. Google PageSpeed Insights Product Catalogue on Desktop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ -22. Odoo Vs Drupal Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -23. Odoo Vs Magento Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -24. Odoo Vs Prestashop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -25. Summary : Google Page Speed Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -26. Google PageSpeed Insights Product Catalogue on Mobile Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ -27. Odoo Vs Drupal Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -28. Odoo Vs Magento Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -29. Odoo Vs Prestashop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -30. Summary : Google Page Speed Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -31. Google PageSpeed Insights Product Page on Desktop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ -32. Odoo Vs Drupal Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -33. Odoo Vs Magento Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -34. Odoo Vs Prestashop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -35. Summary : Google Page Speed Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -36. Google PageSpeed Insights Product Page on Mobile Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ -37. Odoo Vs Drupal Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -38. Odoo Vs Magento Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -39. Odoo Vs Preshashop Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -40. Summary : Google Page Speed Computed by Google Page Speed Insight : https://developers.google.com/speed/pagespeed/insights/ Rating is out of 100 -41. Speed Test using Pingdom Resources Loads to render page -42. Resources Load to render page As browser can load only 4 fles in parallal on midsie traffc website, then latency time and number of resources to donwload impact time to load more resources Odoo load faster because concatenate several fles, minify and gzip the content, even all the modules installed -43. Resources Load to render page -44. Resources Load to render page -45. Scaleablity Using Blitz, simulate the 250 users -46. Load Test using Blitz Region – Virginia | Duration – 60 Seconds | Load – 1 To 250 Users Computed using Blitz: https://www.blitz.io -47. Software Confgurations Magento, Prestashop, Drupa o Ubuntu 14.04 latest LTS o Apache 2.2 Server o PHP 5 Framework o MySQL Server 5.0 Odoo o Ubuntu 14.04 latest LTS o Nginx 1.4 o Odoo Framework o PostgreSQL 9.1 -48. Hardware Confguration o IBM Server Series X3500 M4, 15 MB L3 Cache o 300 GB GSAS Drive 10K RPMs o Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz, 12 cores o 8 GB Physical RAM o 15 MBPS Dedicated Internet connection line Network : o 15 MBPS dedicated Internet connection -49. Odoo Region – Virginia | Duration – 60 Seconds | Load – 1 To 250 Users The max hit rate was: 88 hits per second Website and Ecommerce apps installed Confguration : -50. Odoo ● Fastest: 530 ms | Slowest: 1655 ms | Average: 829 ms ● First time out happened at 47.4 second at 198 users ● 3646 successful hits in 60 sec, avg 52,45,920 hits/day capacity. Response Time : -51. Drupal Region – Virginia | Duration – 60 Seconds | Load – 1 To 250 Users The max hit rate was : 37 hits per second Confguration : -52. Drupal ● Fastest: 1172 ms | Slowest: 4943 ms | Average: 2141 ms ● First time out happened at 30 second at 125 users ● 1,083 successful hits in 60 sec, avg 15,59,520 hits/day capacity. Response Time : -53. Magento Region – Virginia | Duration – 60 Seconds | Load – 1 To 250 Users The max hit rate was : 21 hits per second Confguration : -54. Magento ● Fastest: 1639 ms | Slowest: 16315 ms | Average: 7813 ms ● First time out happened at 35 second at 146 users ● 528 successful hits in 60 sec, avg 0.7 M hits/day capacity. Response Time : -55. Prestashop Region – Virginia | Duration – 60 Seconds | Load – 1 To 250 Users The max hit rate was : 16 hits per second Confguration : -56. Prestashop ● Fastest: 1678 ms | Slowest: 9228 ms | Average: 5598 ms ● First time out happened at 25 second at 104 users ● 663 successful hits in 60 sec, avg 0.95 M hits/day capacity. Response Time : -57. Load Test Summary -58. Summary Speed : o Odoo is 3x times faster than the Drupal o Odoo is 6x times faster than the Magento o Odoo is 2x times faster than the Prestashop Scalability : o Odoo timeout at 198 users o Drupal timeout at 125 users o Magento timeout at 148 users o Prestashop timeout at 104 users -59. W3C Markup Validation HTML Validation -60. W3C Check Odoo's main problem o Element meta is missing one or more of the following attributes: content, property. o An img element must have an alt attribute, except under certain conditions o The width attribute on the table element is obsolete. Use CSS instead. Team is working on those issues , will be fxed soon -61. Maintainability lines of code and contributors -62. Test 1 : Source Code Comparision between : o Odoo : includes all modules. I.e accounting, wms, mrp, websites, etc... o Drupal, Magento and Prestashop : only core modules Odoo is : o 1.3x times smaller then the drupal o 5.5x times smaller then the magento o 1.9x times smaller then the prestashop -63. Odoo Statistic provided by ohloh.net available at https://www.ohloh.net/p/odoo -64. Drupal Statistic provided by ohloh.net available at https://www.ohloh.net/p/drupal -65. Magento Statistic provided by ohloh.net available at https://www.ohloh.net/p/magento -66. Prestashop Statistic provided by ohloh.net available at https://www.ohloh.net/p/PrestaShop -67. Conclusion -68. Conclusion Performance : o Odoo is 3x times faster than the Drupal o Odoo is 6x times faster than the Magento o Odoo is 2x times faster than the Prestashop Scalability : o Odoo timeout at 198 users o Drupal timeout at 125 users o Magento timeout at 148 users o Prestashop timeout at 104 users Maintainability : o 1.3x times smaller then the drupal o 5.5x times smaller then the magento o 1.9x times smaller then the prestashop -69. Questions ? -70. Odoo sales@odoo.com +32 (0) 2 290 34 90 www.odoo.com R&D and services offce Chaussée de Namur 40 B-1367 Grand Rosière Sales offce Avenue Van Nieuwenhuyse 6 B-1160 Brussels Thank You - - - - custom - - - - - diff --git a/addons/website_slides/models/slide_channel.py b/addons/website_slides/models/slide_channel.py index 48b7b670ace..c94cda59b8c 100644 --- a/addons/website_slides/models/slide_channel.py +++ b/addons/website_slides/models/slide_channel.py @@ -73,19 +73,18 @@ class Channel(models.Model): string='Tags', help='Used to categorize and filter displayed channels/courses') category_ids = fields.One2many('slide.category', 'channel_id', string="Categories") image = fields.Binary("Image", attachment=True) + image_large = fields.Binary("Large image", attachment=True) image_medium = fields.Binary("Medium image", attachment=True) image_small = fields.Binary("Small image", attachment=True) # slides: promote, statistics slide_ids = fields.One2many('slide.slide', 'channel_id', string="Slides") + slide_last_update = fields.Date('Last Update', compute='_compute_slide_last_update', store=True) slide_partner_ids = fields.One2many('slide.slide.partner', 'channel_id', string="Slide User Data", groups='website.group_website_publisher') promote_strategy = fields.Selection([ - ('none', 'No Featured Presentation'), ('latest', 'Latest Published'), ('most_voted', 'Most Voted'), - ('most_viewed', 'Most Viewed'), - ('custom', 'Featured Presentation')], - string="Featuring Policy", default='most_voted', required=True) - + ('most_viewed', 'Most Viewed')], + string="Featuring Policy", default='latest', required=True) access_token = fields.Char("Security Token", copy=False, default=_default_access_token) nbr_presentations = fields.Integer('Number of Presentations', compute='_compute_slides_statistics', store=True) nbr_documents = fields.Integer('Number of Documents', compute='_compute_slides_statistics', store=True) @@ -130,6 +129,11 @@ class Channel(models.Model): can_upload = fields.Boolean('Can Upload', compute='_compute_access') can_publish = fields.Boolean('Can Publish', compute='_compute_access') + @api.depends('slide_ids.is_published') + def _compute_slide_last_update(self): + for record in self: + record.slide_last_update = fields.Date.today() + @api.depends('channel_partner_ids.channel_id') def _compute_members_count(self): read_group_res = self.env['slide.channel.partner'].sudo().read_group([('channel_id', 'in', self.ids)], [], 'channel_id') @@ -201,10 +205,6 @@ class Channel(models.Model): if channel.id: # avoid to perform a slug on a not yet saved record in case of an onchange. channel.website_url = '%s/slides/%s' % (base_url, slug(channel)) - @api.onchange('visibility') - def change_visibility(self): - pass - @api.multi def action_redirect_to_members(self): action = self.env.ref('website_slides.slide_channel_partner_action').read()[0] @@ -269,13 +269,13 @@ class Channel(models.Model): 'partner_id': self.env.user.partner_id.id })] if 'image' in vals: - tools.image_resize_images(vals) + tools.image_resize_images(vals, return_large=True) return super(Channel, self.with_context(mail_create_nosubscribe=True)).create(vals) @api.multi def write(self, vals): if 'image' in vals: - tools.image_resize_images(vals) + tools.image_resize_images(vals, return_large=True) res = super(Channel, self).write(vals) if 'active' in vals: # archiving/unarchiving a channel does it on its slides, too diff --git a/addons/website_slides/models/slide_slide.py b/addons/website_slides/models/slide_slide.py index da87d6ee9f7..5ac61bbec39 100644 --- a/addons/website_slides/models/slide_slide.py +++ b/addons/website_slides/models/slide_slide.py @@ -11,9 +11,8 @@ import uuid from werkzeug import urls -from odoo import api, fields, models, SUPERUSER_ID, _ +from odoo import api, fields, models, tools, _ from odoo.addons.http_routing.models.ir_http import slug -from odoo.tools import image from odoo.exceptions import Warning, UserError from odoo.http import request from odoo.addons.http_routing.models.ir_http import url_for @@ -97,11 +96,6 @@ class Slide(models.Model): 'latest': 'date_published desc', } - _PROMOTIONAL_FIELDS = [ - '__last_update', 'name', 'image_thumb', 'image_medium', 'slide_type', 'total_views', 'category_id', - 'channel_id', 'description', 'tag_ids', 'write_date', 'create_date', - 'website_published', 'website_url', 'website_meta_title', 'website_meta_description', 'website_meta_keywords', 'website_meta_og_img'] - _sql_constraints = [ ('exclusion_html_content_and_url', "CHECK(html_content IS NULL OR url IS NULL)", "A slide is either filled with a document url or HTML content. Not both.") ] @@ -124,10 +118,10 @@ class Slide(models.Model): access_token = fields.Char("Security Token", copy=False, default=_default_access_token) is_preview = fields.Boolean('Always visible', default=False) completion_time = fields.Float('# Hours', default=1, digits=(10, 4)) - image = fields.Binary('Image', attachment=True) - # TODO DBE : review image medium and small - using standard image calls (see web/image/.. route) - image_medium = fields.Binary('Medium', compute="_get_image", store=True, attachment=True) - image_thumb = fields.Binary('Thumbnail', compute="_get_image", store=True, attachment=True) + image = fields.Binary("Image", attachment=True) + image_large = fields.Binary("Large image", attachment=True) + image_medium = fields.Binary("Medium image", attachment=True) + image_small = fields.Binary("Small image", attachment=True) # subscribers partner_ids = fields.Many2many('res.partner', 'slide_slide_partner', 'slide_id', 'partner_id', string='Subscribers', groups='base.group_website_publisher') @@ -162,16 +156,6 @@ class Slide(models.Model): public_views = fields.Integer('# of Public Views') total_views = fields.Integer("Total # Views", default="0", compute='_compute_total', store=True) - @api.depends('image') - def _get_image(self): - for record in self: - if record.image: - record.image_medium = image.crop_image(record.image, type='top', ratio=(4, 3), size=(500, 400)) - record.image_thumb = image.crop_image(record.image, type='top', ratio=(4, 3), size=(200, 200)) - else: - record.image_medium = False - record.image_thumb = False - @api.depends('slide_views', 'public_views') def _compute_total(self): for record in self: @@ -278,6 +262,9 @@ class Slide(models.Model): for key, value in doc_data.items(): values.setdefault(key, value) + if 'image' in values: + tools.image_resize_images(values, return_large=True) + slide = super(Slide, self).create(values) if slide.website_published: @@ -294,6 +281,9 @@ class Slide(models.Model): for key, value in doc_data.items(): values.setdefault(key, value) + if 'image' in values: + tools.image_resize_images(values, return_large=True) + res = super(Slide, self).write(values) if values.get('website_published'): self.date_published = datetime.datetime.now() @@ -592,5 +582,5 @@ class Slide(models.Model): res = super(Slide, self)._default_website_meta() res['default_opengraph']['og:title'] = res['default_twitter']['twitter:title'] = self.name res['default_opengraph']['og:description'] = res['default_twitter']['twitter:description'] = self.description - res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = "/web/image/slide.slide/%s/image_thumb" % (self.id) + res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = "/web/image/slide.slide/%s/image_small" % (self.id) return res diff --git a/addons/website_slides/static/src/img/Open_Days_2014_Infographic.png b/addons/website_slides/static/src/img/Open_Days_2014_Infographic.png deleted file mode 100644 index f022583758e..00000000000 Binary files a/addons/website_slides/static/src/img/Open_Days_2014_Infographic.png and /dev/null differ diff --git a/addons/website_slides/static/src/img/banner-default.jpg b/addons/website_slides/static/src/img/banner-default.jpg new file mode 100644 index 00000000000..a594ca906e8 Binary files /dev/null and b/addons/website_slides/static/src/img/banner-default.jpg differ diff --git a/addons/website_slides/static/src/img/channel-documentation-default.jpg b/addons/website_slides/static/src/img/channel-documentation-default.jpg new file mode 100644 index 00000000000..ffa294e934e Binary files /dev/null and b/addons/website_slides/static/src/img/channel-documentation-default.jpg differ diff --git a/addons/website_slides/static/src/img/channel-training-default.jpg b/addons/website_slides/static/src/img/channel-training-default.jpg new file mode 100644 index 00000000000..5d8b9093590 Binary files /dev/null and b/addons/website_slides/static/src/img/channel-training-default.jpg differ diff --git a/addons/website_slides/static/src/img/channel_banner_moutain.jpg b/addons/website_slides/static/src/img/channel_banner_moutain.jpg new file mode 100644 index 00000000000..c27e2a47434 Binary files /dev/null and b/addons/website_slides/static/src/img/channel_banner_moutain.jpg differ diff --git a/addons/website_slides/static/src/img/channel_demo_flowers.jpg b/addons/website_slides/static/src/img/channel_demo_flowers.jpg new file mode 100644 index 00000000000..199d77858b1 Binary files /dev/null and b/addons/website_slides/static/src/img/channel_demo_flowers.jpg differ diff --git a/addons/website_slides/static/src/img/channel_demo_furniture.jpg b/addons/website_slides/static/src/img/channel_demo_furniture.jpg new file mode 100644 index 00000000000..375036f7d75 Binary files /dev/null and b/addons/website_slides/static/src/img/channel_demo_furniture.jpg differ diff --git a/addons/website_slides/static/src/img/channel_demo_furniture_2.jpg b/addons/website_slides/static/src/img/channel_demo_furniture_2.jpg new file mode 100644 index 00000000000..f16ff623a3d Binary files /dev/null and b/addons/website_slides/static/src/img/channel_demo_furniture_2.jpg differ diff --git a/addons/website_slides/static/src/img/channel_demo_furniture_3.jpeg b/addons/website_slides/static/src/img/channel_demo_furniture_3.jpeg new file mode 100644 index 00000000000..570120556da Binary files /dev/null and b/addons/website_slides/static/src/img/channel_demo_furniture_3.jpeg differ diff --git a/addons/website_slides/static/src/img/channel_demo_gardening.jpg b/addons/website_slides/static/src/img/channel_demo_gardening.jpg new file mode 100644 index 00000000000..3993e10b42b Binary files /dev/null and b/addons/website_slides/static/src/img/channel_demo_gardening.jpg differ diff --git a/addons/website_slides/static/src/img/channel_demo_gardening_2.jpg b/addons/website_slides/static/src/img/channel_demo_gardening_2.jpg new file mode 100644 index 00000000000..701af0f6588 Binary files /dev/null and b/addons/website_slides/static/src/img/channel_demo_gardening_2.jpg differ diff --git a/addons/website_slides/static/src/img/keynote.pdf b/addons/website_slides/static/src/img/keynote.pdf deleted file mode 100644 index fd1822349bc..00000000000 Binary files a/addons/website_slides/static/src/img/keynote.pdf and /dev/null differ diff --git a/addons/website_slides/static/src/img/keynote.png b/addons/website_slides/static/src/img/keynote.png deleted file mode 100644 index fa1eb12359d..00000000000 Binary files a/addons/website_slides/static/src/img/keynote.png and /dev/null differ diff --git a/addons/website_slides/static/src/img/odoo-cms-comparision.pdf b/addons/website_slides/static/src/img/odoo-cms-comparision.pdf deleted file mode 100644 index 0f98db28be3..00000000000 Binary files a/addons/website_slides/static/src/img/odoo-cms-comparision.pdf and /dev/null differ diff --git a/addons/website_slides/static/src/img/odoo-cms-comparision.png b/addons/website_slides/static/src/img/odoo-cms-comparision.png deleted file mode 100644 index 0069277b71c..00000000000 Binary files a/addons/website_slides/static/src/img/odoo-cms-comparision.png and /dev/null differ diff --git a/addons/website_slides/static/src/img/presentation.pdf b/addons/website_slides/static/src/img/presentation.pdf new file mode 100644 index 00000000000..774c2ea70c5 Binary files /dev/null and b/addons/website_slides/static/src/img/presentation.pdf differ diff --git a/addons/website_slides/static/src/img/slide_demo_thumb_5WMqwTnZ-qs.jpg b/addons/website_slides/static/src/img/slide_demo_thumb_5WMqwTnZ-qs.jpg new file mode 100644 index 00000000000..b76505fb9e9 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_thumb_5WMqwTnZ-qs.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_thumb_QYmgrw0PgLU.jpg b/addons/website_slides/static/src/img/slide_demo_thumb_QYmgrw0PgLU.jpg new file mode 100644 index 00000000000..737a0e1d729 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_thumb_QYmgrw0PgLU.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_thumb_ptjeDDoURL8.jpg b/addons/website_slides/static/src/img/slide_demo_thumb_ptjeDDoURL8.jpg new file mode 100644 index 00000000000..0bf060b54c7 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_thumb_ptjeDDoURL8.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_tree_img_1.jpg b/addons/website_slides/static/src/img/slide_demo_tree_img_1.jpg new file mode 100644 index 00000000000..693c05b6f59 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_tree_img_1.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_tree_img_2.jpg b/addons/website_slides/static/src/img/slide_demo_tree_img_2.jpg new file mode 100644 index 00000000000..91490c1b264 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_tree_img_2.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_tree_infographic_1.jpg b/addons/website_slides/static/src/img/slide_demo_tree_infographic_1.jpg new file mode 100644 index 00000000000..0037385333b Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_tree_infographic_1.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_tree_infographic_2.jpg b/addons/website_slides/static/src/img/slide_demo_tree_infographic_2.jpg new file mode 100644 index 00000000000..76071b34ea3 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_tree_infographic_2.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_tree_infographic_3.jpg b/addons/website_slides/static/src/img/slide_demo_tree_infographic_3.jpg new file mode 100644 index 00000000000..9fa0e98ab39 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_tree_infographic_3.jpg differ diff --git a/addons/website_slides/static/src/img/standard_badge_bronze.svg b/addons/website_slides/static/src/img/standard_badge_bronze.svg new file mode 100644 index 00000000000..a94491e8a55 --- /dev/null +++ b/addons/website_slides/static/src/img/standard_badge_bronze.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/website_slides/static/src/img/standard_badge_gold.svg b/addons/website_slides/static/src/img/standard_badge_gold.svg new file mode 100644 index 00000000000..423f63e6d8b --- /dev/null +++ b/addons/website_slides/static/src/img/standard_badge_gold.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/website_slides/static/src/img/standard_badge_silver.svg b/addons/website_slides/static/src/img/standard_badge_silver.svg new file mode 100644 index 00000000000..dd16d4f2bae --- /dev/null +++ b/addons/website_slides/static/src/img/standard_badge_silver.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/website_slides/static/src/scss/website_slides.scss b/addons/website_slides/static/src/scss/website_slides.scss index da91b79032c..feb6acd6ffb 100644 --- a/addons/website_slides/static/src/scss/website_slides.scss +++ b/addons/website_slides/static/src/scss/website_slides.scss @@ -15,6 +15,266 @@ $MAX-Z-INDEX : 2147483647 !default; object-position: top; } + +// Common to new slides pages +// ************************************************** + +.o_wslides_wrap { + .text_small_caps { + font-variant: small-caps; + } + .image-muted { + opacity: 0.5; + } + .cta-title { + font-size: 1.2em; + } +} + + +// New home page +// ************************************************** + +div .o_wslides_home_nav { + position: relative; + top: -50px; +} + +div .o_wslides_home_main { + .o_wslides_home_header { + } + .o_wslides_home_footer { + } + + .o_wslides_home_aside { + .fa-check { + color: #00A09D; + font-size: 1.2em; + } + } + .o_wslides_home_content_section_title, .o_wslides_home_aside_title { + h3 { + font-size: 1.4em; + } + h4 { + font-size: 1.3em; + } + } + + .o_wslides_course_card { + .card-body { + padding: 0.75em 1em; + } + .card-footer { + padding-top: 0.75em 1em; + } + } + // responsive card-deck like + .row.o_wslides_row > div[class*='col-'] { + display: flex; + flex:1 0 auto; + .card { + width:100%; + } + } + + // tools + // **************************************** + .text_small_caps { + font-variant: small-caps; + } + + .image-muted { + opacity: 0.5; + } + + .o_wslides_home_circled { + border-radius: 50%; + width: 1.2em; + height: 1.2em; + padding: 0.25em 0.5em 0.25em 0.5em; + border: 0.2em solid #666; + text-align: center; + box-sizing: initial; + } + + .progress { + overflow: visible; + margin-bottom: 0em; + height: 4px; + .progress-bar { + background-color: #00A09D; + position: relative; + border-radius: 4px; + span { + background-color: #00A09D; + position: absolute; + bottom: -20px; + font-size: 10px; + line-height: 10px; + padding: 2px 3px 2px 4px; + right: -1.4em; + border-radius: 2px; + } + span:after { + bottom: 100%; + left: 50%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: rgba(255, 255, 255, 0); + border-bottom-color: #00A09D; + border-width: 5px; + margin-left: -5px; + } + } + } +} + +// New course page +// ************************************************** + +.o_wslides_container { + margin: auto; + width: 100%; + max-width: 1140px; + padding: 32px 32px 0px 32px; +} + +.o_wslides_course_nav { + margin: auto; + background: linear-gradient(150deg, #875A7B 20%, #62495B 80%) !important; + opacity: 0.95; + + nav { + .breadcrumb-item::before { + font-weight: bold; + color: #FFFFFF; + opacity: 0.8; + } + .breadcrumb-item { + a { + font-weight: bold; + color: #FFFFFF; + opacity: 0.8; + transition: opacity linear .3s; + } + &.active { + a { + opacity: 1.0; + } + } + } + ol { + background-color: transparent; + } + } +} + +.o_wslides_course_header { + margin: auto; + background: linear-gradient(150deg, #875A7B 20%, #62495B 80%) !important; + border-bottom: 48px solid #66445e; + + .o_wslides_course_header_container { + top: 48px; + padding-top: 0px; + + .o_wslides_course_header_content { + font-size: 16px; + color: #FFFFFF; + .o_wslides_course_description { + margin-right: 36px; + } + } + + .o_wslides_course_header_aside { + img { + width: 100%; + max-width: 256px; + } + } + } +} + +.o_wslides_course_content { + margin: auto; + background-color: #f2f2f2; + + .o_wslides_content_container { + position: relative; + top: -80px; + } + + // responsive card-deck like + .row.o_wslides_row > div[class*='col-'] { + display: flex; + flex:1 0 auto; + .card { + width:100%; + } + } + + .o_wslides_course_content_nav { + .o_wslides_nav_tabs { + border-bottom: 0px; + } + .o_wslides_navlink { + color: white; + border-radius: 0px; + height: 48px; + font-weight: bold; + padding-top: 12px; + border-left: 2px solid #875A7B; + text-align: center; + width: 120px; + &:hover { + border: 0px; + border-radius: 0px; + background-color: #875A7B; + } + } + .o_wslides_navlink.active { + color: #212529; + background-color: #f2f2f2; + border: 0px; + } + } + .o_wslides_course_content_main { + h3 { + font-size: 1.4em; + } + + h4 { + font-size: 1.3em; + } + + .o_wslides_course_content_aside { + top: 1px; + width: 256px; + max-width: 256px; + margin-left: 15px; + background-color: white; + + .o_wslides_course_aside_line { + } + } + + .o_wslides_lesson_card { + .card-footer { + padding-top: 0.75em; + padding-bottom: 0.75em; + } + } + } +} + +// Old brol to clean someday +// ************************************************** + .oe_slides_panel_footer .fa, .oe_slide_js_embed_option_link{ color : theme-color('primary'); cursor: pointer; @@ -61,10 +321,6 @@ img.oe_slides_promote_image { display: block; } -.oe_slides_box_shadow { - box-shadow: 0 0 5px #CCC; -} - .oe_slides_apart_small { @include top-covered-image; height: 60px; diff --git a/addons/website_slides/views/slide_slide_views.xml b/addons/website_slides/views/slide_slide_views.xml index 33301591189..93eb04e9bb5 100644 --- a/addons/website_slides/views/slide_slide_views.xml +++ b/addons/website_slides/views/slide_slide_views.xml @@ -46,7 +46,11 @@ - + diff --git a/addons/website_slides/views/website_slides_embed_templates.xml b/addons/website_slides/views/website_slides_embed_templates.xml index 4be210cb843..e3444433a42 100644 --- a/addons/website_slides/views/website_slides_embed_templates.xml +++ b/addons/website_slides/views/website_slides_embed_templates.xml @@ -64,7 +64,7 @@ - + @@ -73,7 +73,7 @@ - + Loading ... diff --git a/addons/website_slides/views/website_slides_templates.xml b/addons/website_slides/views/website_slides_templates.xml index 661db6c0297..6bbd8d91292 100644 --- a/addons/website_slides/views/website_slides_templates.xml +++ b/addons/website_slides/views/website_slides_templates.xml @@ -5,85 +5,12 @@ - - - - + + + - - - - - - Select a Channel - Channel found for "" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -101,52 +28,40 @@ - - + + - - - - - - - - - Join - - - - - Joined - - - - / - - - - Upload - - - - - - - - - - - - - - + + + + + + Home + + + + + + + + + + + + + + + + + + + @@ -157,247 +72,308 @@ - - - - - - - - Home - - - - Presentations - - - - - Videos - - - - - Documents - - - - - Infographics - - - - - Pages - - - - - - - - Sort by: - - Newest - - | - - Most Viewed - - | - - Most Voted - - + + + + + Most Voted + Most Viewed + Newest + + + Sort by + Newest + Most Voted + Most Viewed + + + - + - - + + - + - - - - - - - - - - - - - Review your channel settings to promote your most viewed or recent published presentation - - - Channel Settings - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - Share: - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sorry, but nothing matches your search criteria . Please try again with different keywords. + + + + + + + + + + + + + + + + + - - - No presentation published yet. - - The is empty. - - Upload PDF presentations, documents, videos or infographic using the button below. + + + + + + + + + + + Home + + + Review + + + + + + + + + + + Start Course + Join Course - - - - - Upload + + + + Private Course - + + Contact website administrator. + + + + Already member + - - - - - Results for + + Last Update + - - - - - - - - - - - - - - - - - - See all - + + Members + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Share + + + + + + + Share + + + × + + + + Share on Social Networks + + + + Share Link + + + - - - + + + + + Upload + + + + + + + + Featured lesson + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + View all + + + + + + + + - - - - - + + - + - - - - - - - Unpublished - - - - - - - Views - - - - - + + + + + + + + - + + + + + + + + + + + + Free preview + + + Unpublished + + + + + + + + + + + + + + @@ -435,7 +411,7 @@ - + @@ -708,7 +684,7 @@ - + @@ -723,7 +699,9 @@ Share on Social Networks - + + + Share Link Use permanent link to share in social media diff --git a/addons/website_slides/views/website_slides_templates_homepage.xml b/addons/website_slides/views/website_slides_templates_homepage.xml new file mode 100644 index 00000000000..1366547b68b --- /dev/null +++ b/addons/website_slides/views/website_slides_templates_homepage.xml @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + All courses + + + Certifications + + + My courses + + + + + + + + + + + + + + View all + Complete latest courses + + + + + + + + + + + + + + View all + Most popular courses + + + + + + + + + + + + + View all + Newest courses + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No channel was found matching your search . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + View all + + Latest achievements + + + + + + + + + + + + No achievements currently :( + + + + + + + + + + + + + + achieved + + + + + + + + + + View all + + Heroes of the week + + + + + + + + + + + + + + No heroes currently :( + + + + + + + + + + + + + + + + + + • + + + + + + + + + + + + + Edit + + + + + + INSERT DBE TEMPLATE HERE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hr + + mins + + + + diff --git a/addons/website_slides_forum/__manifest__.py b/addons/website_slides_forum/__manifest__.py index a272af7858c..c6f8a4cf6d9 100644 --- a/addons/website_slides_forum/__manifest__.py +++ b/addons/website_slides_forum/__manifest__.py @@ -7,9 +7,14 @@ 'version': '1.0', 'summary': 'Allows to link forum on a course', 'description': """A Slide channel can be linked to forum. Also, profiles from slide and forum are regrouped together""", - 'depends': ['website_slides', 'website_forum'], + 'depends': [ + 'website_slides', + 'website_forum' + ], 'data': [ - 'views/slide_channel_views.xml' + 'views/slide_channel_views.xml', + 'views/website_slides_templates.xml', + 'data/slide_channel_demo.xml', ], 'auto_install': True, } diff --git a/addons/website_slides_forum/data/slide_channel_demo.xml b/addons/website_slides_forum/data/slide_channel_demo.xml new file mode 100644 index 00000000000..99a21cbd523 --- /dev/null +++ b/addons/website_slides_forum/data/slide_channel_demo.xml @@ -0,0 +1,12 @@ + + + + + Basics of Gardening + + + + + + + diff --git a/addons/website_slides_forum/views/website_slides_templates.xml b/addons/website_slides_forum/views/website_slides_templates.xml new file mode 100644 index 00000000000..339f4d526d7 --- /dev/null +++ b/addons/website_slides_forum/views/website_slides_templates.xml @@ -0,0 +1,14 @@ + + + + + + + + Forum + + + + +
You just began the adventure! Welcome!
Keep going !
You begin to understand things ! Keep going!
Hey ! You're not so dumb after all !
You're good ! Really Good !
Ok, RESPECT !
Write one or two paragraphs describing your product, services or a specific feature. To be successful your content needs to be useful to your readers.
Write one or two paragraphs describing your product or services. To be successful your content needs to be useful to your readers.
Start with the customer – find out what they want and give it to them.
- Review your channel settings to promote your most viewed or recent published presentation -
- - - - - - - - - - - -
- Share: - - - -
- The is empty. - - Upload PDF presentations, documents, videos or infographic using the button below. +
- - - Upload + + + + Private Course -
- - + + + + + + + + - + + + + + + + + + + + + Free preview + + + Unpublished + + + + + + + + + + + + + + @@ -435,7 +411,7 @@ - + @@ -708,7 +684,7 @@ - + @@ -723,7 +699,9 @@ Share on Social Networks - + + + Share Link Use permanent link to share in social media diff --git a/addons/website_slides/views/website_slides_templates_homepage.xml b/addons/website_slides/views/website_slides_templates_homepage.xml new file mode 100644 index 00000000000..1366547b68b --- /dev/null +++ b/addons/website_slides/views/website_slides_templates_homepage.xml @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + All courses + + + Certifications + + + My courses + + + + + + + + + + + + + + View all + Complete latest courses + + + + + + + + + + + + + + View all + Most popular courses + + + + + + + + + + + + + View all + Newest courses + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No channel was found matching your search . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + View all + + Latest achievements + + + + + + + + + + + + No achievements currently :( + + + + + + + + + + + + + + achieved + + + + + + + + + + View all + + Heroes of the week + + + + + + + + + + + + + + No heroes currently :( + + + + + + + + + + + + + + + + + + • + + + + + + + + + + + + + Edit + + + + + + INSERT DBE TEMPLATE HERE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hr + + mins + + + + diff --git a/addons/website_slides_forum/__manifest__.py b/addons/website_slides_forum/__manifest__.py index a272af7858c..c6f8a4cf6d9 100644 --- a/addons/website_slides_forum/__manifest__.py +++ b/addons/website_slides_forum/__manifest__.py @@ -7,9 +7,14 @@ 'version': '1.0', 'summary': 'Allows to link forum on a course', 'description': """A Slide channel can be linked to forum. Also, profiles from slide and forum are regrouped together""", - 'depends': ['website_slides', 'website_forum'], + 'depends': [ + 'website_slides', + 'website_forum' + ], 'data': [ - 'views/slide_channel_views.xml' + 'views/slide_channel_views.xml', + 'views/website_slides_templates.xml', + 'data/slide_channel_demo.xml', ], 'auto_install': True, } diff --git a/addons/website_slides_forum/data/slide_channel_demo.xml b/addons/website_slides_forum/data/slide_channel_demo.xml new file mode 100644 index 00000000000..99a21cbd523 --- /dev/null +++ b/addons/website_slides_forum/data/slide_channel_demo.xml @@ -0,0 +1,12 @@ + + + + + Basics of Gardening + + + + + + + diff --git a/addons/website_slides_forum/views/website_slides_templates.xml b/addons/website_slides_forum/views/website_slides_templates.xml new file mode 100644 index 00000000000..339f4d526d7 --- /dev/null +++ b/addons/website_slides_forum/views/website_slides_templates.xml @@ -0,0 +1,14 @@ + + + + + + + + Forum + + + + +
No channel was found matching your search .
No achievements currently :(
No heroes currently :(
INSERT DBE TEMPLATE HERE