Skip to content

Commit

Permalink
Merge pull request #55 from wizelineacademy/dev-about-course-section
Browse files Browse the repository at this point in the history
Dev about course section
  • Loading branch information
CDavidSV authored Sep 30, 2024
2 parents a8bd527 + da36137 commit fbbf2e6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions eLearning_upgraded/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'views/course_skills_view.xml',
'views/menu_import_view.xml',
'views/student_skills_view.xml',
'views/course_audience_view.xml',
'views/course_main_lecturers_tab.xml',
'views/website_slides_templates_homepage.xml',
'data/skills_data.xml'
Expand Down
2 changes: 1 addition & 1 deletion eLearning_upgraded/models/slide_channel_extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
class SlideChannelExtended(models.Model):
_inherit = 'slide.channel'


who_should_take = fields.Html(string='Who should take this course?', help='This field is used to describe the target audience for this course.', required=False)
lecturers = fields.Many2many('res.partner', string='Lecturers', help='Contacts affiliated as lecturers for this course.', domain=[('is_lecturer', '=', True)], required=False)
39 changes: 39 additions & 0 deletions eLearning_upgraded/views/course_audience_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xmd version="1.0" encoding="utf-8"?>
<odoo><data>
<template id="course_main_audience" name="Course Audience" inherit_id="website_slides.course_main">
<xpath expr="//ul[@id='profile_extra_info_tablist']" position="inside">
<li class="nav-item" role="presentation" t-if="not is_html_empty(channel.who_should_take)">
<a t-att-class="'nav-link %s' % ('active' if active_tab == 'audience' else '')" id="audience-tab" data-bs-toggle="pill" href="#audience" role="tab" aria-controls="audience" t-att-aria-selected="'true' if active_tab == 'audience' else 'false'">
Audience
</a>
</li>
</xpath>

<xpath expr="//div[@id='courseMainTabContent']" position="inside">
<!-- Who Should Take This Course Section -->
<div t-att-class="'tab-pane fade %s' % ('show active' if active_tab == 'audience' else '')" id="audience" role="tabpanel" aria-labelledby="audience-tab">
<div id="audience_section">
<div class="mb-2">
<div class="col mx-n2">
<h2 style="font-weight:bold;">Who Should Take This Course?</h2>
<div class="oe_no_empty" t-field="channel.who_should_take" t-options="{'widget': 'html'}"/>
</div>
</div>
</div>
</div>
</xpath>
</template>

<record id="who_should_take_course_edit" model="ir.ui.view">
<field name="name">slide.channel.view.form.who.should.take.course.edit</field>
<field name="model">slide.channel</field>
<field name="inherit_id" ref="website_slides.view_slide_channel_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='description']" position="after">
<page name="who_should_take_course" string="Audience">
<field name="who_should_take" widget="html" nolabel="1" />
</page>
</xpath>
</field>
</record>
</data></odoo>

0 comments on commit fbbf2e6

Please sign in to comment.