[IMP] website_slides_forum: add forum navigation tab in course display and add demo data
Purpose of this commit is to add the forum tab in course main new page
when the course is linked to a forum. Some demo data are added.
Some more work to better include forums and courses are ongoing [1].
This commit is linked to task ID 1936153 and PR #30770.
[1] forum and comments upgrade: task ID 1940516 - PR #30514 and #31097
This commit is contained in:
@@ -7,9 +7,14 @@
|
||||
'version': '1.0',
|
||||
'summary': 'Allows to link forum on a course',
|
||||
'description': """A Slide channel can be linked to forum. Also, profiles from slide and forum are regrouped together""",
|
||||
'depends': ['website_slides', 'website_forum'],
|
||||
'depends': [
|
||||
'website_slides',
|
||||
'website_forum'
|
||||
],
|
||||
'data': [
|
||||
'views/slide_channel_views.xml'
|
||||
'views/slide_channel_views.xml',
|
||||
'views/website_slides_templates.xml',
|
||||
'data/slide_channel_demo.xml',
|
||||
],
|
||||
'auto_install': True,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo><data noupdate="0">
|
||||
|
||||
<record id="forum_forum_demo_channel_1" model="forum.forum">
|
||||
<field name="name">Basics of Gardening</field>
|
||||
</record>
|
||||
|
||||
<record id="website_slides.slide_channel_demo_1_gard1" model="slide.channel">
|
||||
<field name="forum_id" ref="website_slides_forum.forum_forum_demo_channel_1"/>
|
||||
</record>
|
||||
|
||||
</data></odoo>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" ?>
|
||||
<odoo><data>
|
||||
|
||||
<template id='course_main' inherit_id="website_slides.course_main">
|
||||
<!-- Channel main template: add link to forum -->
|
||||
<xpath expr="//li[hasclass('o_wslides_nav_tabs_item_home')]" position="after">
|
||||
<li class="nav-item" t-if="channel.forum_id">
|
||||
<a t-att-href="'/forum/%s' % (slug(channel))"
|
||||
t-att-class="'nav-link o_wslides_navlink'">Forum</a>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data></odoo>
|
||||
Reference in New Issue
Block a user