Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] website_slides: improve layout of courses main pages and apply various fixes #31317

Closed
Closed
Diff settings

Always

Just for now

Prev

[FIX] website_slides: fix vote widget

Fix route of vote widget. Set it to auth=public so that instead of a crash
we have correct popup asking to login. Better than a SessionException, which
will not be displayed.

Another fix is done to avoid having one widget for all displayed like / dislike
buttons. Each slide should have its own vote widget.

Commit linked to task ID 1941250 and PR #31317.
  • Loading branch information...
jem-odoo authored and tde-banana-odoo committed Feb 20, 2019
commit 36f461d1a0ff04b5702afce3884f3c275676b66d
@@ -538,7 +538,7 @@ def set_status_as_done(self, slide_id):
}

# JSONRPC
@http.route('/slides/slide/like', type='json', auth="user", website=True)
@http.route('/slides/slide/like', type='json', auth="public", website=True)
def slide_like(self, slide_id, upvote):
if request.website.is_public_user():
return {'error': 'public_user'}
@@ -86,8 +86,11 @@ sAnimations.registry.websiteSlidesLike = sAnimations.Class.extend({
* @param {Object} parent
*/
start: function () {
var self = this;
var defs = [this._super.apply(this, arguments)];
defs.push(new LikeButton(this).attachTo($('.o_wslides_like')));
$('.o_wslides_like').each(function () {
defs.push(new LikeButton(self).attachTo($(this)));
});
return $.when.apply($, defs);
},
});
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.