[REF] website_slides: rename 'webpage' to 'article'
This commit simply renames the 'webpage' slide_category into 'article'. Indeed, 'webpage' was confusing because it was leading you to believe that you would have to link external content from another website. While this slide_category instead lets you build an 'article' with content by using our website builder. The changes here are just renaming the slide_category and the labels, there should not be any functional change. Task-2510174 Part-of: odoo/odoo#71477
This commit is contained in:
@@ -14,7 +14,7 @@ Featuring
|
||||
|
||||
* Integrated course and lesson management
|
||||
* Fullscreen navigation
|
||||
* Support Youtube videos, Google documents, PDF, images, web pages
|
||||
* Support Youtube videos, Google documents, PDF, images, articles
|
||||
* Test knowledge with quizzes
|
||||
* Filter and Tag
|
||||
* Statistics
|
||||
|
||||
@@ -1175,9 +1175,9 @@ class WebsiteSlides(WebsiteProfile):
|
||||
channel._resequence_slides(slide, force_category=category)
|
||||
|
||||
redirect_url = "/slides/slide/%s" % (slide.id)
|
||||
if channel.channel_type == "training" and slide.slide_category not in ["webpage", "quiz"]:
|
||||
if channel.channel_type == "training" and slide.slide_category not in ["article", "quiz"]:
|
||||
redirect_url = "/slides/%s" % (slug(channel))
|
||||
if slide.slide_category == 'webpage':
|
||||
if slide.slide_category == 'article':
|
||||
redirect_url += "?enable_editor=1"
|
||||
return {
|
||||
'url': redirect_url,
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
<field name="name">A little chat with Harry Potted</field>
|
||||
<field name="sequence">6</field>
|
||||
<field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_1.jpg"/>
|
||||
<field name="slide_category">webpage</field>
|
||||
<field name="slide_category">article</field>
|
||||
<field name="channel_id" ref="website_slides.slide_channel_demo_1_gard1"/>
|
||||
<field name="html_content" type="html">
|
||||
<section class="s_cover parallax bg-black-50 pt16 pb16" data-scroll-background-ratio="0" style="background-image: none;" data-snippet="s_cover">
|
||||
@@ -462,7 +462,7 @@
|
||||
<field name="name">A Mighty Forest from Ages</field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_3.jpg"/>
|
||||
<field name="slide_category">webpage</field>
|
||||
<field name="slide_category">article</field>
|
||||
<field name="channel_id" ref="website_slides.slide_channel_demo_2_gard2"/>
|
||||
<field name="html_content" type="html">
|
||||
<section class="s_cover parallax bg-black-50 pt16 pb16" data-scroll-background-ratio="0" style="background-image: none;" data-snippet="s_cover">
|
||||
@@ -605,7 +605,7 @@
|
||||
<field name="name">Foreword</field>
|
||||
<field name="sequence">1</field>
|
||||
<field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_furniture_2.jpg"/>
|
||||
<field name="slide_category">webpage</field>
|
||||
<field name="slide_category">article</field>
|
||||
<field name="channel_id" ref="website_slides.slide_channel_demo_4_furn1"/>
|
||||
<field name="html_content" type="html">
|
||||
<section class="s_cover parallax bg-black-50 pt16 pb16" data-scroll-background-ratio="0" style="background-image: none;" data-snippet="s_cover">
|
||||
|
||||
@@ -186,7 +186,7 @@ class Channel(models.Model):
|
||||
nbr_document = fields.Integer('Documents', compute='_compute_slides_statistics', store=True)
|
||||
nbr_video = fields.Integer('Videos', compute='_compute_slides_statistics', store=True)
|
||||
nbr_infographic = fields.Integer('Infographics', compute='_compute_slides_statistics', store=True)
|
||||
nbr_webpage = fields.Integer("Webpages", compute='_compute_slides_statistics', store=True)
|
||||
nbr_article = fields.Integer("Articles", compute='_compute_slides_statistics', store=True)
|
||||
nbr_quiz = fields.Integer("Number of Quizs", compute='_compute_slides_statistics', store=True)
|
||||
total_slides = fields.Integer('Number of Contents', compute='_compute_slides_statistics', store=True)
|
||||
total_views = fields.Integer('Visits', compute='_compute_slides_statistics', store=True)
|
||||
|
||||
@@ -125,7 +125,7 @@ class Slide(models.Model):
|
||||
# content
|
||||
slide_category = fields.Selection([
|
||||
('infographic', 'Image'),
|
||||
('webpage', 'Web Page'),
|
||||
('article', 'Article'),
|
||||
('document', 'Document'),
|
||||
('video', 'Video'),
|
||||
('quiz', "Quiz")],
|
||||
@@ -143,7 +143,7 @@ class Slide(models.Model):
|
||||
# google
|
||||
google_drive_id = fields.Char('Google Drive ID of the external URL', compute='_compute_google_drive_id')
|
||||
# content - webpage
|
||||
html_content = fields.Html("HTML Content", help="Custom HTML content for slides of category 'Web Page'.", translate=True, sanitize_attributes=False, sanitize_form=False)
|
||||
html_content = fields.Html("HTML Content", help="Custom HTML content for slides of category 'Article'.", translate=True, sanitize_attributes=False, sanitize_form=False)
|
||||
# content - images
|
||||
image_binary_content = fields.Binary('Image Content', related='binary_content', readonly=False,
|
||||
help="Used to filter file input to images only")
|
||||
@@ -152,7 +152,7 @@ class Slide(models.Model):
|
||||
# content - documents
|
||||
slide_type = fields.Selection([
|
||||
('image', 'Image'),
|
||||
('webpage', 'Web Page'),
|
||||
('article', 'Article'),
|
||||
('quiz', 'Quiz'),
|
||||
('pdf', 'PDF'),
|
||||
('sheet', 'Sheet (Excel, Google Sheet, ...)'),
|
||||
@@ -201,7 +201,7 @@ class Slide(models.Model):
|
||||
nbr_document = fields.Integer("Number of Documents", compute='_compute_slides_statistics', store=True)
|
||||
nbr_video = fields.Integer("Number of Videos", compute='_compute_slides_statistics', store=True)
|
||||
nbr_infographic = fields.Integer("Number of Images", compute='_compute_slides_statistics', store=True)
|
||||
nbr_webpage = fields.Integer("Number of Webpages", compute='_compute_slides_statistics', store=True)
|
||||
nbr_article = fields.Integer("Number of Articles", compute='_compute_slides_statistics', store=True)
|
||||
nbr_quiz = fields.Integer("Number of Quizs", compute="_compute_slides_statistics", store=True)
|
||||
total_slides = fields.Integer(compute='_compute_slides_statistics', store=True)
|
||||
is_published = fields.Boolean(tracking=1)
|
||||
@@ -366,8 +366,8 @@ class Slide(models.Model):
|
||||
slide.slide_type = False
|
||||
elif slide.slide_category == 'infographic':
|
||||
slide.slide_type = 'image'
|
||||
elif slide.slide_category == 'webpage':
|
||||
slide.slide_type = 'webpage'
|
||||
elif slide.slide_category == 'article':
|
||||
slide.slide_type = 'article'
|
||||
elif slide.slide_category == 'quiz':
|
||||
slide.slide_type = 'quiz'
|
||||
elif slide.slide_category == 'video' and slide.video_source_type == 'youtube':
|
||||
@@ -1252,7 +1252,7 @@ class Slide(models.Model):
|
||||
def _search_render_results(self, fetch_fields, mapping, icon, limit):
|
||||
icon_per_category = {
|
||||
'infographic': 'fa-file-picture-o',
|
||||
'webpage': 'fa-file-text',
|
||||
'article': 'fa-file-text',
|
||||
'presentation': 'fa-file-pdf-o',
|
||||
'document': 'fa-file-pdf-o',
|
||||
'video': 'fa-play-circle',
|
||||
|
||||
@@ -548,7 +548,7 @@
|
||||
// Private
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* Fetches content with an rpc call for slides of category "webpage"
|
||||
* Fetches content with an rpc call for slides of category "article"
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
@@ -574,7 +574,7 @@
|
||||
*/
|
||||
_fetchSlideContent: function (){
|
||||
var slide = this.get('slide');
|
||||
if (slide.category === 'webpage' && !slide.isQuiz) {
|
||||
if (slide.category === 'article' && !slide.isQuiz) {
|
||||
return this._fetchHtmlContent();
|
||||
}
|
||||
return Promise.resolve();
|
||||
@@ -616,8 +616,8 @@
|
||||
// technical settings for the Fullscreen to work
|
||||
var autoSetDone = false;
|
||||
if (!slideData.hasQuestion) {
|
||||
if (_.contains(['infographic', 'document', 'webpage'], slideData.category)) {
|
||||
autoSetDone = true; // images, documents (local + external) and web pages are marked as completed when opened
|
||||
if (_.contains(['infographic', 'document', 'article'], slideData.category)) {
|
||||
autoSetDone = true; // images, documents (local + external) and articles are marked as completed when opened
|
||||
} else if (slideData.category === 'video' && slideData.videoSourceType === 'google_drive') {
|
||||
autoSetDone = true; // google drive videos do not benefit from the YouTube integration and are marked as completed when opened
|
||||
}
|
||||
@@ -646,7 +646,7 @@
|
||||
},
|
||||
/**
|
||||
* Render the current slide content using specific mecanism according to slide category:
|
||||
* - simply append content (for webpage)
|
||||
* - simply append content (for article)
|
||||
* - template rendering (for image, document, ....)
|
||||
* - using a sub widget (quiz and video)
|
||||
*
|
||||
@@ -676,8 +676,8 @@
|
||||
return this.videoPlayer.appendTo($content);
|
||||
} else if (slide.category === 'video' && slide.videoSourceType === 'google_drive') {
|
||||
$content.html(QWeb.render('website.slides.fullscreen.video.google_drive', {widget: this}));
|
||||
} else if (slide.category === 'webpage'){
|
||||
var $wpContainer = $('<div>').addClass('o_wslide_fs_webpage_content bg-white block w-100 overflow-auto');
|
||||
} else if (slide.category === 'article'){
|
||||
var $wpContainer = $('<div>').addClass('o_wslide_fs_article_content bg-white block w-100 overflow-auto');
|
||||
$(slide.htmlContent).appendTo($wpContainer);
|
||||
$content.append($wpContainer);
|
||||
this.trigger_up('widgets_start_request', {
|
||||
|
||||
@@ -134,7 +134,7 @@ var SlideUploadDialog = Dialog.extend({
|
||||
*/
|
||||
_formValidateGetValues: async function (forcePublished) {
|
||||
var slideCategory = 'document';
|
||||
// default slide_category (for webpage for instance)
|
||||
// default slide_category (for article for instance)
|
||||
if (_.contains(this.slide_category_data), this.get('state')) {
|
||||
slideCategory = this.get('state');
|
||||
}
|
||||
@@ -165,7 +165,7 @@ var SlideUploadDialog = Dialog.extend({
|
||||
'slide_category': 'document',
|
||||
'binary_content': this.file.data
|
||||
});
|
||||
} else if (values['slide_category'] === 'webpage') {
|
||||
} else if (values['slide_category'] === 'article') {
|
||||
_.extend(values, {
|
||||
'image_1920': this.file.type === 'image/svg+xml' ? await this._svgToPng() : this.file.data,
|
||||
});
|
||||
@@ -345,10 +345,10 @@ var SlideUploadDialog = Dialog.extend({
|
||||
label: _t('Image'),
|
||||
template: 'website.slide.upload.modal.infographic',
|
||||
},
|
||||
webpage: {
|
||||
article: {
|
||||
icon: 'fa-file-text',
|
||||
label: _t('Web Page'),
|
||||
template: 'website.slide.upload.modal.webpage',
|
||||
label: _t('Article'),
|
||||
template: 'website.slide.upload.modal.article',
|
||||
},
|
||||
video: {
|
||||
icon: 'fa-file-video-o',
|
||||
|
||||
@@ -42,7 +42,7 @@ tour.register('slides_tour', {
|
||||
width: 260,
|
||||
}, {
|
||||
trigger: 'a.btn-primary.o_wslides_js_slide_upload',
|
||||
content: Markup(_t("Your first section is created, now it's time to add lessons to your course. Click on <b>Add Content</b> to upload a document, create a web page or link a video.")),
|
||||
content: Markup(_t("Your first section is created, now it's time to add lessons to your course. Click on <b>Add Content</b> to upload a document, create an article or link a video.")),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: 'a[data-slide-category="document"]',
|
||||
|
||||
@@ -56,16 +56,16 @@ var addVideoToSection = function (sectionName, saveAsDraft) {
|
||||
return base_steps;
|
||||
};
|
||||
|
||||
var addWebPageToSection = function (sectionName, pageName) {
|
||||
var addArticleToSection = function (sectionName, pageName) {
|
||||
return [
|
||||
{
|
||||
content: 'eLearning: add content to section',
|
||||
trigger: 'div.o_wslides_slide_list_category_header:contains("' + sectionName + '") a:contains("Add Content")',
|
||||
}, {
|
||||
content: 'eLearning: click on webpage',
|
||||
trigger: 'a[data-slide-category=webpage]',
|
||||
content: 'eLearning: click on article',
|
||||
trigger: 'a[data-slide-category=article]',
|
||||
}, {
|
||||
content: 'eLearning: fill webpage title',
|
||||
content: 'eLearning: fill article title',
|
||||
trigger: 'input[name=name]',
|
||||
run: 'text ' + pageName,
|
||||
}, {
|
||||
@@ -76,7 +76,7 @@ var addWebPageToSection = function (sectionName, pageName) {
|
||||
trigger: 'div.select2-result-label:contains("Theory")',
|
||||
in_modal: false,
|
||||
}, {
|
||||
content: 'eLearning: fill webpage completion time',
|
||||
content: 'eLearning: fill article completion time',
|
||||
trigger: 'input[name=duration]',
|
||||
run: 'text 4',
|
||||
}];
|
||||
@@ -132,7 +132,7 @@ var addNewCourseTag = function (courseTagName) {
|
||||
export default {
|
||||
addSection: addSection,
|
||||
addVideoToSection: addVideoToSection,
|
||||
addWebPageToSection: addWebPageToSection,
|
||||
addArticleToSection: addArticleToSection,
|
||||
addExistingCourseTag: addExistingCourseTag,
|
||||
addNewCourseTag: addNewCourseTag,
|
||||
};
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.slide.upload.modal.webpage">
|
||||
<t t-name="website.slide.upload.modal.article">
|
||||
<div>
|
||||
<form class="clearfix">
|
||||
<div class="row">
|
||||
@@ -224,7 +224,7 @@
|
||||
<div id="o_wslides_js_slide_upload_preview_column" class="col-md-6">
|
||||
<div class="img-thumbnail h-100">
|
||||
<div class="o_slide_tutorial p-3">
|
||||
<div class="h5">How to create a Lesson as a Web Page?</div>
|
||||
<div class="h5">How to create a Lesson as an Article?</div>
|
||||
<div>First, create your lesson, then edit it with the website builder. You'll be able to drop building blocks on your page and edit them.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -271,8 +271,8 @@
|
||||
<t t-if="record.slide_category.raw_value == 'infographic'">
|
||||
<i class="fa fa-file-image-o mr-2" aria-label="Infographic" role="img" title="Infographic"/>
|
||||
</t>
|
||||
<t t-elif="record.slide_category.raw_value == 'webpage'">
|
||||
<i class="fa fa-file-code-o mr-2" aria-label="Webpage" role="img" title="Webpage"/>
|
||||
<t t-elif="record.slide_category.raw_value == 'article'">
|
||||
<i class="fa fa-file-code-o mr-2" aria-label="article" role="img" title="Article"/>
|
||||
</t>
|
||||
<t t-elif="record.slide_category.raw_value == 'video'">
|
||||
<i class="fa fa-file-video-o mr-2" aria-label="Video" role="img" title="Video"/>
|
||||
|
||||
@@ -526,7 +526,7 @@
|
||||
<i t-else="" class="check-done text-success fa fa-check-circle px-2"></i>
|
||||
</t>
|
||||
<span t-if="channel.can_publish" class="d-none d-md-flex">
|
||||
<a t-if="slide.slide_category == 'webpage'" class="px-2 o_text_link text-primary" target="_blank" t-attf-href="/slides/slide/#{slug(slide)}?enable_editor=1"><span class="fa fa-pencil"/></a>
|
||||
<a t-if="slide.slide_category == 'article'" class="px-2 o_text_link text-primary" target="_blank" t-attf-href="/slides/slide/#{slug(slide)}?enable_editor=1"><span class="fa fa-pencil"/></a>
|
||||
<a t-else="" class="px-2 o_text_link text-primary" target="_blank" t-attf-href="/web#id=#{slide.id}&action=#{slide_action}&model=slide.slide&view_type=form" title="Edit in backend"><span class="fa fa-pencil"/></a>
|
||||
<a href="#" t-att-data-slide-id="slide.id" class="o_text_link text-danger px-2 o_wslides_js_slide_archive"><span class="fa fa-trash"/></a>
|
||||
</span>
|
||||
@@ -813,7 +813,7 @@
|
||||
<i t-if="slide.slide_type == 'youtube_video'" t-att-class="'fa fa-youtube-play %s' % icon_class"></i>
|
||||
<i t-if="slide.slide_type == 'google_drive_video'" t-att-class="'fa fa-play-circle %s' % icon_class"></i>
|
||||
<i t-if="slide.slide_type == 'vimeo_video'" t-att-class="'fa fa-vimeo %s' % icon_class"></i>
|
||||
<i t-if="slide.slide_type == 'webpage'" t-att-class="'fa fa-file-text %s' % icon_class"></i>
|
||||
<i t-if="slide.slide_type == 'article'" t-att-class="'fa fa-file-text %s' % icon_class"></i>
|
||||
<i t-if="slide.slide_type == 'quiz'" t-att-class="'fa fa-question-circle %s' % icon_class"></i>
|
||||
<i t-if="not slide.slide_type" t-att-class="'fa fa-file-o %s' % icon_class"></i>
|
||||
</template>
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
t-att-href="'/slides/slide/%s' % (slug(previous_slide)) if previous_slide else '#'">
|
||||
<i class="fa fa-chevron-left mr-2"></i> <span class="d-none d-sm-inline-block">Prev</span>
|
||||
</a>
|
||||
<t t-set="allow_done_btn" t-value="slide.slide_category in ['infographic', 'document', 'webpage', 'video'] and not slide.question_ids and not channel_progress[slide.id].get('completed') and slide.channel_id.is_member"/>
|
||||
<t t-set="allow_done_btn" t-value="slide.slide_category in ['infographic', 'document', 'article', 'video'] and not slide.question_ids and not channel_progress[slide.id].get('completed') and slide.channel_id.is_member"/>
|
||||
<a t-att-class="'btn btn-primary border text-white %s' % ('disabled' if not allow_done_btn else '')"
|
||||
role="button" t-att-aria-disabled="'true' if not allow_done_btn else None"
|
||||
t-att-href="'/slides/slide/%s/set_completed?%s' % (slide.id, 'next_slide_id=%s' % (next_slide.id) if next_slide else '') if allow_done_btn else '#'">
|
||||
@@ -261,7 +261,7 @@
|
||||
<div t-if="slide.slide_category == 'video'" class="embed-responsive embed-responsive-16by9 embed-responsive-item mb8">
|
||||
<t t-out="slide.embed_code"/>
|
||||
</div>
|
||||
<div t-if="slide.slide_category == 'webpage'">
|
||||
<div t-if="slide.slide_category == 'article'">
|
||||
<div t-if="is_html_empty(slide.html_content)" class="alert alert-info">
|
||||
Click on the "Edit" button on the top-right of the screen to edit your slide content.
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user