Skip to content

Commit

Permalink
[MERGE] website_slides: various fixes for frontend and first design t…
Browse files Browse the repository at this point in the history
…weaks

Purpose of this merge is to provide several fixes related to new elearning
application. Those are mainly fixes for front-end templates and first
design improvements / fixes.

See sub commits for more details.

Merge linked to task ID 1941250 and PR #31279.

closes #31306
  • Loading branch information
robodoo committed Feb 21, 2019
2 parents 3029109 + c2629d1 commit 5cec06b
Show file tree
Hide file tree
Showing 21 changed files with 369 additions and 426 deletions.
4 changes: 3 additions & 1 deletion addons/website_profile/controllers/main.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def _get_default_avatar(self, field, headers, width, height):
content = base64.b64encode(image) content = base64.b64encode(image)
dictheaders = dict(headers) if headers else {} dictheaders = dict(headers) if headers else {}
dictheaders['Content-Type'] = 'image/png' dictheaders['Content-Type'] = 'image/png'
headers = list(dictheaders.items())
if not (width or height): if not (width or height):
suffix = field.split('_')[-1] if '_' in field else 'large' suffix = field.split('_')[-1] if '_' in field else 'large'
if suffix in ('small', 'medium', 'large', 'big'): if suffix in ('small', 'medium', 'large', 'big'):
Expand All @@ -45,6 +44,9 @@ def _get_default_avatar(self, field, headers, width, height):


def _check_user_profile_access(self, user_id): def _check_user_profile_access(self, user_id):
user_sudo = request.env['res.users'].sudo().browse(user_id) user_sudo = request.env['res.users'].sudo().browse(user_id)
# User can access - no matter what - his own profile
if user_sudo.id == request.env.user.id:
return user_sudo
if user_sudo.karma == 0 or not user_sudo.website_published or \ if user_sudo.karma == 0 or not user_sudo.website_published or \
(user_sudo.id != request.session.uid and request.env.user.karma < request.website.karma_profile_min): (user_sudo.id != request.session.uid and request.env.user.karma < request.website.karma_profile_min):
return False return False
Expand Down
2 changes: 1 addition & 1 deletion addons/website_sale_slides/__manifest__.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'summary': 'Sell your courses online', 'summary': 'Sell your courses online',
'description': """Sell your courses using the e-commerce features of the website.""", 'description': """Sell your courses using the e-commerce features of the website.""",
'category': 'Hidden', 'category': 'Hidden',
'version': '0.1', 'version': '1.0',


'depends': ['website_slides', 'website_sale'], 'depends': ['website_slides', 'website_sale'],
'installable': True, 'installable': True,
Expand Down
24 changes: 13 additions & 11 deletions addons/website_slides/__manifest__.py
Original file line number Original file line Diff line number Diff line change
@@ -1,21 +1,23 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
{ {
'name': 'Slides', 'name': 'eLearning',
'version': '1.0', 'version': '2.0',
'sequence': 145, 'sequence': 145,
'summary': 'Publish videos, slides and documents', 'summary': 'Create online Courses',
'website': 'https://www.odoo.com/page/slides', 'website': 'https://www.odoo.com/page/slides',
'category': 'Website', 'category': 'Website',
'description': """ 'description': """
Share and Publish Videos, Presentations and Documents' Create Online Courses
====================================================== =====================
* Website Application Featuring
* Channel Management
* Filters and Tagging * Integrated course and lesson management
* Statistics of Presentation * Fullscreen navigation
* Channel Subscription * Support Youtube videos, Google documents, PDF, images, web pages
* Supported document types : PDF, images, YouTube videos and Google Drive documents) * Test knowledge with quizzes
* Filter and Tag
* Statistics
""", """,
'depends': [ 'depends': [
'website', 'website',
Expand Down
2 changes: 1 addition & 1 deletion addons/website_slides/data/slide_channel_demo.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ will learn the basics of wood characteristics.</field>
<field name="promote_strategy">most_voted</field> <field name="promote_strategy">most_voted</field>
<field name="website_published" eval="True"/> <field name="website_published" eval="True"/>
<field name="enroll">invite</field> <field name="enroll">invite</field>
<field name="image" type="base64" file="website_slides/static/src/img/channel_demo_furniture.jpg"/> <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_furniture_2.jpg"/>
<field name="description">We're also Santa Claus! Belligerent and numerous. I am the man with no name, Zapp Brannigan!</field> <field name="description">We're also Santa Claus! Belligerent and numerous. I am the man with no name, Zapp Brannigan!</field>
</record> </record>
<record id="slide_category_demo_4_0" model="slide.category"> <record id="slide_category_demo_4_0" model="slide.category">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
.o_wslides_fullscreen_container { .o_wslides_fullscreen_container {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
height: 100%; height: calc(100% - 50px);
position: relative; position: relative;
background-color: #313A44; background-color: #313A44;
} }
Expand Down
Loading

0 comments on commit 5cec06b

Please sign in to comment.