add modules elearning
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 241 KiB |
|
After Width: | Height: | Size: 341 KiB |
|
After Width: | Height: | Size: 222 KiB |
|
After Width: | Height: | Size: 562 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 315 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 414 KiB |
|
After Width: | Height: | Size: 320 KiB |
|
After Width: | Height: | Size: 506 KiB |
@@ -0,0 +1,211 @@
|
||||
<div class="row"
|
||||
style="margin: 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4;text-align: center; margin: auto; display: flex;justify-content: center;">
|
||||
<a href="https://www.manprax.com/" target="_blank"><img src="images/manprax.png"
|
||||
style=" width: 293px; padding: 1rem 0rem; margin: auto" alt="manprax-logo"></a>
|
||||
</div>
|
||||
<div class="row"
|
||||
style="margin:75px 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4; padding-bottom: 30px;">
|
||||
<div class="col-md-7 col-sm-12 col-xs-12" style="padding: 0px">
|
||||
<div
|
||||
style=" margin: 0 0 0px;padding: 20px 0 10;font-size: 23px;line-height: 35px;font-weight: 400;color: #000;border-top: 1px solid rgba(255,255,255,0.1);border-bottom: 1px solid rgba(255,255,255,0.11);text-align: left;">
|
||||
<h1 style="font-size: 39px;font-weight: 600;margin: 0px !important;">Elearning Plus </h1>
|
||||
</h3>
|
||||
</div>
|
||||
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key Highlights</h2>
|
||||
<ul style=" padding: 0 1px; list-style: none; ">
|
||||
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
|
||||
style="width:40px; color:#00438b"></i>
|
||||
Collapse/Expand Feature in course content list.
|
||||
</li>
|
||||
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
|
||||
style="width:40px; color:#00438b"></i>
|
||||
Fix Bug of Publish/Unpublish Button on course Fullscreen.
|
||||
</li>
|
||||
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
|
||||
style="width:40px; color:#00438b"></i>
|
||||
Publish slides directly from backend.
|
||||
</li>
|
||||
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
|
||||
style="width:40px; color:#00438b"></i>
|
||||
Add Description with HTML editor.
|
||||
</li>
|
||||
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
|
||||
style="width:40px; color:#00438b"></i>
|
||||
Short Introduction video for course.
|
||||
</li>
|
||||
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
|
||||
style="width:40px; color:#00438b"></i>
|
||||
Like/Dislike option for content in fullscreen.
|
||||
</li>
|
||||
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
|
||||
style="width:40px; color:#00438b"></i>
|
||||
Comment option for content in fullscreen.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-center">Screenshots</h2>
|
||||
<section class="oe_container">
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
|
||||
<h3 class="alert"
|
||||
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
|
||||
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
|
||||
Collapse/Expand Feature in course content list.
|
||||
</h3>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px; width: 80%;"
|
||||
src="images/screen1.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="min-height: 0px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
|
||||
<h3 class="alert"
|
||||
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
|
||||
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
|
||||
Fix Bug of Publish/Unpublish Button on course Fullscreen.
|
||||
<br>
|
||||
</h3>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen2.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="min-height: 0px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
|
||||
<h3 class="alert"
|
||||
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
|
||||
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
|
||||
Publish slides directly from backend.
|
||||
<br>
|
||||
</h3>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen3.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="min-height: 0px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
|
||||
<h3 class="alert"
|
||||
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
|
||||
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
|
||||
Add Description for course in HTML Editor.
|
||||
<br>
|
||||
</h3>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen4.png"></div>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen5.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="min-height: 0px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
|
||||
<h3 class="alert"
|
||||
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
|
||||
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
|
||||
Add Youtube Video URL or Google Drive Video URL.
|
||||
<br>
|
||||
</h3>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen6.png"></div>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen7.png"></div>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen8.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="min-height: 0px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
|
||||
<h3 class="alert"
|
||||
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
|
||||
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
|
||||
Like/Dislike option for content in fullscreen.
|
||||
<br>
|
||||
</h3>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen9.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="min-height: 0px;">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
|
||||
<h3 class="alert"
|
||||
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
|
||||
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
|
||||
Comment option for content in fullscreen.
|
||||
<br>
|
||||
</h3>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen10.png"></div>
|
||||
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
|
||||
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
|
||||
src="images/screen11.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div>
|
||||
<div style="max-width:1540px; margin: 0 auto; ">
|
||||
<div class="col-lg-12 mb-4">
|
||||
<h4 class="text-center">Need Help?</h4>
|
||||
<hr style="border-width: 4px; border-color:#875A7B; width: 80px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contact Cards -->
|
||||
<div class="row d-flex justify-content-center align-items-center" style="max-width:1540px; margin: 0 auto;">
|
||||
<div class="col-lg-3 shadow mt-2"
|
||||
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
|
||||
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Visit us</h5>
|
||||
<a href="https://manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
|
||||
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">ManpraX Software LLP</a>
|
||||
</div>
|
||||
<div class="col-lg-3 shadow mt-2"
|
||||
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
|
||||
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Bite Sized Conversation</h5>
|
||||
<a href="https://wa.me/+918448440100" target="_blank" class="btn btn-block mb-2 deep_hover"
|
||||
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">WhatsApp</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5">
|
||||
<div style="max-width:1540px; margin: 0 auto; ">
|
||||
<div class="col-lg-12 mb-4">
|
||||
<h4 class="text-center">Enquires</h4>
|
||||
<hr style="border-width: 4px; border-color:#875A7B; width: 80px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contact Cards -->
|
||||
<div class="row d-flex justify-content-center align-items-center" style="max-width:1540px; margin: 0 auto;">
|
||||
<div class="col-lg-3 shadow mt-2"
|
||||
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
|
||||
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Business Enquiry</h5>
|
||||
<a href="mailto:sales@manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
|
||||
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">Click Here</a>
|
||||
</div>
|
||||
<div class="col-lg-3 shadow mt-2"
|
||||
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
|
||||
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">General Enquiry</h5>
|
||||
<a href="mailto:info@manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
|
||||
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">Click Here</a>
|
||||
</div>
|
||||
<div class="col-lg-3 shadow mt-2"
|
||||
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
|
||||
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Join the MX Team</h5>
|
||||
<a href="mailto:apply@manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
|
||||
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">Click Here</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,144 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import publicWidget from '@web/legacy/js/public/public_widget';
|
||||
import portalComposer from "@portal/js/portal_composer";
|
||||
import { renderToElement } from "@web/core/utils/render";
|
||||
import { session } from "@web/session";
|
||||
|
||||
const PortalComposer = portalComposer.PortalComposer;
|
||||
|
||||
|
||||
PortalComposer.include({
|
||||
/**
|
||||
* @private
|
||||
* @param {Event} ev
|
||||
*/
|
||||
async _onSubmitButtonClick(ev) {
|
||||
await this._super(...arguments).then((result) => {
|
||||
const $modal = this.$el.closest('#commentpopupcomposer');
|
||||
$modal.on('hidden.bs.modal', () => {
|
||||
this.trigger_up('reload_comment_popup_composer', result);
|
||||
});
|
||||
$modal.modal('hide');
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Prepare message data for submission.
|
||||
*
|
||||
* @private
|
||||
* @returns {Object} The data object to be sent to the backend.
|
||||
*/
|
||||
_prepareMessageData() {
|
||||
const messageBody = this.$('textarea[name="message"]').val();
|
||||
const attachmentIds = this.attachments.map((a) => a.id);
|
||||
const attachmentTokens = this.attachments.map((a) => a.access_token);
|
||||
|
||||
if (this.options.is_comment_fullscreen) {
|
||||
const resId = $('.o_wslides_fs_sidebar_list_item.active').data('id');
|
||||
return {
|
||||
thread_model: this.options.res_model,
|
||||
thread_id: resId,
|
||||
post_data: {
|
||||
body: messageBody,
|
||||
attachment_ids: attachmentIds,
|
||||
message_type: "comment",
|
||||
subtype_xmlid: "mail.mt_comment",
|
||||
},
|
||||
attachment_tokens: attachmentTokens,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
thread_model: this.options.res_model,
|
||||
thread_id: this.options.res_id,
|
||||
post_data: {
|
||||
body: messageBody,
|
||||
attachment_ids: attachmentIds,
|
||||
message_type: "comment",
|
||||
subtype_xmlid: "mail.mt_comment",
|
||||
},
|
||||
attachment_tokens: attachmentTokens,
|
||||
message_id: this.options.default_message_id,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
/**
|
||||
* CommentPopupComposer
|
||||
*
|
||||
* Open a popup with the portal composer when clicking on it.
|
||||
**/
|
||||
const CommentPopupComposer = publicWidget.Widget.extend({
|
||||
selector: '.o_comment_popup_composer',
|
||||
custom_events: {
|
||||
reload_comment_popup_composer: '_onReloadCommentPopupComposer',
|
||||
},
|
||||
|
||||
willStart: function (parent) {
|
||||
const def = this._super.apply(this, arguments);
|
||||
const options = this.$el.data();
|
||||
this.options = Object.assign({
|
||||
'token': false,
|
||||
'res_model': false,
|
||||
'res_id': false,
|
||||
'pid': 0,
|
||||
'csrf_token': odoo.csrf_token,
|
||||
'user_id': session.user_id,
|
||||
}, options, {});
|
||||
return def;
|
||||
},
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
start: function () {
|
||||
return Promise.all([
|
||||
this._super.apply(this, arguments),
|
||||
this._reloadCommentPopupComposer(),
|
||||
]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy existing commentPopup and insert new commentPopup widget
|
||||
*
|
||||
* @private
|
||||
* @param {Object} data
|
||||
*/
|
||||
_reloadCommentPopupComposer: function () {
|
||||
// Append the modal
|
||||
const modal = renderToElement(
|
||||
'mx_elearning_plus.PopupCommentComposer', {
|
||||
inline_mode: true,
|
||||
widget: this,
|
||||
});
|
||||
this.$('.o_comment_popup_composer_modal').html(modal);
|
||||
|
||||
if (this._composer) {
|
||||
this._composer.destroy();
|
||||
}
|
||||
|
||||
// Instantiate the "Portal Composer" widget and insert it into the modal
|
||||
this._composer = new PortalComposer(this, this.options);
|
||||
return this._composer.appendTo(this.$('.o_comment_popup_composer_modal .o_portal_chatter_composer'))
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Handlers
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {OdooEvent} event
|
||||
*/
|
||||
_onReloadCommentPopupComposer: function (event) {
|
||||
const data = event.data;
|
||||
this.options = Object.assign(this.options, data);
|
||||
|
||||
this._reloadCommentPopupComposer();
|
||||
}
|
||||
});
|
||||
|
||||
publicWidget.registry.CommentPopupComposer = CommentPopupComposer;
|
||||
|
||||
export default CommentPopupComposer;
|
||||
@@ -0,0 +1,101 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import Fullscreen from "@website_slides/js/slides_course_fullscreen_player";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { rpc } from "@web/core/network/rpc";
|
||||
|
||||
Fullscreen.include({
|
||||
events: Object.assign({}, Fullscreen.prototype.events, {
|
||||
'click .o_btn_comment_unable': '_onClickCommentUnable',
|
||||
'click .o_btn_comment_public': '_onClickCommentPublic',
|
||||
'click .o_btn_no_comment_karma': '_onClickNoCommentKarma',
|
||||
'click .o_btn_comment_karma': '_onClickCommentKarma',
|
||||
}),
|
||||
|
||||
_onClickCommentUnable: function () {
|
||||
var message = ('Commenting is not enabled on this course.');
|
||||
this.displayNotification({
|
||||
type: 'warning',
|
||||
message: message,
|
||||
sticky: true
|
||||
});
|
||||
},
|
||||
|
||||
_onClickCommentPublic: function () {
|
||||
var message = ('There are no comments for now. Join Course to be the first to leave a comment.');
|
||||
this.displayNotification({
|
||||
type: 'warning',
|
||||
message: message,
|
||||
sticky: true
|
||||
});
|
||||
},
|
||||
|
||||
_onClickNoCommentKarma: function () {
|
||||
var message = ('There are no comments for now. Earn more Karma to be the first to leave a comment.');
|
||||
this.displayNotification({
|
||||
type: 'warning',
|
||||
message: message,
|
||||
sticky: true
|
||||
});
|
||||
},
|
||||
|
||||
_onClickCommentKarma: function () {
|
||||
var message = ('Earn more Karma to leave a comment.');
|
||||
this.displayNotification({
|
||||
type: 'warning',
|
||||
message: message,
|
||||
sticky: true
|
||||
});
|
||||
},
|
||||
|
||||
_renderSlide: function () {
|
||||
this._super.apply(this, arguments);
|
||||
const slide = this._slideValue;
|
||||
rpc('/slides/slide/mx/like', {
|
||||
slide_id: slide.id,
|
||||
}).then(function (data) {
|
||||
if (! data.error) {
|
||||
const $likesBtn = self.$('span.o_wslides_js_slide_like_up_mx');
|
||||
const $likesIcon = $likesBtn.find('i.fa');
|
||||
const $dislikesBtn = self.$('span.o_wslides_js_slide_like_down_mx');
|
||||
const $dislikesIcon = $dislikesBtn.find('i.fa');
|
||||
|
||||
// update 'thumbs-up' button with latest state
|
||||
$likesBtn.data('user-vote', data.user_vote);
|
||||
$likesBtn.find('span').text(data.likes);
|
||||
$likesIcon.toggleClass("fa-thumbs-up", data.user_vote === 1);
|
||||
$likesIcon.toggleClass("fa-thumbs-o-up", data.user_vote !== 1);
|
||||
// update 'thumbs-down' button with latest state
|
||||
$dislikesBtn.data('user-vote', data.user_vote);
|
||||
$dislikesBtn.find('span').text(data.dislikes);
|
||||
$dislikesIcon.toggleClass("fa-thumbs-down", data.user_vote === -1);
|
||||
$dislikesIcon.toggleClass("fa-thumbs-o-down", data.user_vote !== -1);
|
||||
$('.o_wslides_js_slide_like_up_mx').data('slide-id', slide.id);
|
||||
$('.o_wslides_js_slide_like_down_mx').data('slide-id', slide.id);
|
||||
$('.o_wslides_js_slide_like_up_mx span').text(data.likes);
|
||||
$('.o_wslides_js_slide_like_down_mx span').text(data.dislikes);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_onChangeSlideRequest: function (ev){
|
||||
this._super.apply(this, arguments);
|
||||
var slideData = ev.data;
|
||||
var $data = this.$el.prevObject.find('.js_publish_btn:visible').parents(".js_publish_management:first");
|
||||
rpc('/website/publish/slide', {
|
||||
id: slideData.id,
|
||||
}).then(function (result) {
|
||||
if (result){
|
||||
$data.removeClass("css_unpublished");
|
||||
$data.addClass("css_published");
|
||||
$data.find('input').prop("checked", result);
|
||||
$data.parents("[data-publish]").attr("data-publish", +result ? 'on' : 'off');
|
||||
}else{
|
||||
$data.removeClass("css_published");
|
||||
$data.addClass("css_unpublished");
|
||||
$data.find('input').prop("checked", result);
|
||||
$data.parents("[data-publish]").attr("data-publish", +result ? 'on' : 'off');
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import publicWidget from '@web/legacy/js/public/public_widget';
|
||||
|
||||
|
||||
publicWidget.registry.websiteCourseExtended = publicWidget.Widget.extend({
|
||||
selector: '.o_course_extended',
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
start: function () {
|
||||
$('.o_course_extended').on('click','#collapse_div',function() {
|
||||
var id = this.dataset.target.split('-')[1]
|
||||
if($('#slide-'+id).is(":visible")) {
|
||||
$('#slide-'+id).hide()
|
||||
$(this).children().first().children().removeClass('fa-minus');
|
||||
$(this).children().first().children().addClass('fa-plus');
|
||||
}else {
|
||||
$('#slide-'+id).show()
|
||||
$(this).children().first().children().removeClass('fa-plus');
|
||||
$(this).children().first().children().addClass('fa-minus');
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,118 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import publicWidget from '@web/legacy/js/public/public_widget';
|
||||
import { rpc } from "@web/core/network/rpc";
|
||||
import { sprintf } from '@web/core/utils/strings';
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import '@website_slides/js/slides';
|
||||
|
||||
var FullscreenSlideLikeWidget = publicWidget.Widget.extend({
|
||||
events: {
|
||||
'click .o_wslides_js_slide_like_up_mx': '_onClickUpMx',
|
||||
'click .o_wslides_js_slide_like_down_mx': '_onClickDownMx',
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Private
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Object} $el
|
||||
* @param {String} message
|
||||
*/
|
||||
_popoverAlert: function ($el, message) {
|
||||
$el.popover({
|
||||
trigger: 'focus',
|
||||
delay: {'hide': 300},
|
||||
placement: 'bottom',
|
||||
container: 'body',
|
||||
html: true,
|
||||
content: function () {
|
||||
return message;
|
||||
}
|
||||
}).popover('show');
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Handlers
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_onClickMx: function (slideId, voteType) {
|
||||
var self = this;
|
||||
rpc('/slides/slide/like', {
|
||||
slide_id: slideId,
|
||||
upvote: voteType === 'like',
|
||||
}).then(function (data) {
|
||||
if (! data.error) {
|
||||
const $likesBtn = self.$('span.o_wslides_js_slide_like_up_mx');
|
||||
const $likesIcon = $likesBtn.find('i.fa');
|
||||
const $dislikesBtn = self.$('span.o_wslides_js_slide_like_down_mx');
|
||||
const $dislikesIcon = $dislikesBtn.find('i.fa');
|
||||
|
||||
// update 'thumbs-up' button with latest state
|
||||
$likesBtn.data('user-vote', data.user_vote);
|
||||
$likesBtn.find('span').text(data.likes);
|
||||
$likesIcon.toggleClass("fa-thumbs-up", data.user_vote === 1);
|
||||
$likesIcon.toggleClass("fa-thumbs-o-up", data.user_vote !== 1);
|
||||
// update 'thumbs-down' button with latest state
|
||||
$dislikesBtn.data('user-vote', data.user_vote);
|
||||
$dislikesBtn.find('span').text(data.dislikes);
|
||||
$dislikesIcon.toggleClass("fa-thumbs-down", data.user_vote === -1);
|
||||
$dislikesIcon.toggleClass("fa-thumbs-o-down", data.user_vote !== -1);
|
||||
} else {
|
||||
if (data.error === 'public_user') {
|
||||
const message = data.error_signup_allowed ?
|
||||
_t('Please <a href="/web/login?redirect=%s">login</a> or <a href="/web/signup?redirect=%s">create an account</a> to vote for this lesson') :
|
||||
_t('Please <a href="/web/login?redirect=%s">login</a> to vote for this lesson');
|
||||
self._popoverAlert(self.$el, sprintf(message, document.URL, document.URL));
|
||||
} else if (data.error === 'slide_access') {
|
||||
self._popoverAlert(self.$el, _t('You don\'t have access to this lesson'));
|
||||
} else if (data.error === 'channel_membership_required') {
|
||||
self._popoverAlert(self.$el, _t('You must be member of this course to vote'));
|
||||
} else if (data.error === 'channel_comment_disabled') {
|
||||
self._popoverAlert(self.$el, _t('Votes and comments are disabled for this course'));
|
||||
} else if (data.error === 'channel_karma_required') {
|
||||
self._popoverAlert(self.$el, _t('You don\'t have enough karma to vote'));
|
||||
} else {
|
||||
self._popoverAlert(self.$el, _t('Unknown error'));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_onClickUpMx: function (ev) {
|
||||
var slideId = $(ev.currentTarget).data('slide-id');
|
||||
return this._onClickMx(slideId, 'like');
|
||||
},
|
||||
|
||||
_onClickDownMx: function (ev) {
|
||||
var slideId = $(ev.currentTarget).data('slide-id');
|
||||
return this._onClickMx(slideId, 'dislike');
|
||||
},
|
||||
});
|
||||
|
||||
publicWidget.registry.FullscreenWebsiteSlidesSlideLike = publicWidget.Widget.extend({
|
||||
selector: '#wrapwrap',
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @param {Object} parent
|
||||
*/
|
||||
start: function () {
|
||||
var self = this;
|
||||
var defs = [this._super.apply(this, arguments)];
|
||||
$('.o_wslides_js_slide_like_mx').each(function () {
|
||||
defs.push(new FullscreenSlideLikeWidget(self).attachTo($(this)));
|
||||
});
|
||||
return Promise.all(defs);
|
||||
},
|
||||
});
|
||||
|
||||
export default {
|
||||
FullscreenSlideLikeWidget: FullscreenSlideLikeWidget,
|
||||
FullscreenWebsiteSlidesSlideLike: publicWidget.registry.FullscreenWebsiteSlidesSlideLike
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="mx_elearning_plus.portalComposer" t-inherit="portal.Composer" t-inherit-mode="primary">
|
||||
<xpath expr="//button[hasclass('o_portal_chatter_composer_btn')]" position="replace">
|
||||
<t t-if="widget.options['is_comment_fullscreen']">
|
||||
<button t-attf-data-action="/mail/slide/comment" class="o_portal_chatter_composer_btn btn btn-primary" type="submit">Send</button>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<button t-attf-data-action="/mail/message/post" class="o_portal_chatter_composer_btn btn btn-primary" type="submit">Send</button>
|
||||
</t>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<!--
|
||||
Popup Comment Composer Widget
|
||||
-->
|
||||
<t t-name="mx_elearning_plus.PopupCommentComposer">
|
||||
<div t-if="widget.options['display_composer']" class="modal fade" id="commentpopupcomposer" tabindex="-1" role="dialog" aria-labelledby="commentpopupcomposerlabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title o_comment_popup_composer_label" style="color: black;" id="commentpopupcomposerlabel">
|
||||
Add your comment
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="o_portal_chatter_composer"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||