Merge lp:~openerp-dev/openobject-addons/trunk-forum-imp-tde into lp:openobject-addons

Proposed by Thibault Delavallée (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-forum-imp-tde
Merge into: lp:openobject-addons
Diff against target: 95 lines (+38/-2)
4 files modified
website_forum/data/forum_data.xml (+17/-0)
website_forum/models/forum.py (+2/-1)
website_forum/views/forum.xml (+4/-0)
website_forum/views/website_forum.xml (+15/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-forum-imp-tde
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+218559@code.launchpad.net

Description of the change

[IMP] website_forum: forum: added inheritance to mail.thread to enable the auto follow feature. By following a forum it is now possible to follow all its new questions, using the automatic follow feature of mail.thread.

Also added a 'my profile' link when logged to have a quick access to its data, questions, answers, ...

To post a comment you must log in.

Unmerged revisions

9420. By Thibault Delavallée (OpenERP)

[IMP] website_forum: added a 'my profile' link

9419. By Thibault Delavallée (OpenERP)

[IMP] website_forum: better placement of 'follow forum', in right toolbar

9418. By Thibault Delavallée (OpenERP)

[MERGE] Sync with upstream (trunk)

9417. By Thibault Delavallée (OpenERP)

[IMP] website_forum: forum: added inheritance to mail.thread to
enable the auto follow feature. By following a forum it is now possible to
follow all its new questions, using the automatic follow feature of mail.thread.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'website_forum/data/forum_data.xml'
2--- website_forum/data/forum_data.xml 2014-04-11 18:06:15 +0000
3+++ website_forum/data/forum_data.xml 2014-05-07 07:46:37 +0000
4@@ -56,6 +56,23 @@
5 <field name="default" eval="False"/>
6 <field name="description">Question Edited</field>
7 </record>
8+ <!-- Forum subtypes, to follow all answers or questions -->
9+ <record id="mt_forum_answer_new" model="mail.message.subtype">
10+ <field name="name">New Answer</field>
11+ <field name="res_model">forum.forum</field>
12+ <field name="default" eval="False"/>
13+ <field name="hidden" eval="False"/>
14+ <field name="parent_id" eval="ref('mt_answer_new')"/>
15+ <field name="relation_field">forum_id</field>
16+ </record>
17+ <record id="mt_forum_question_new" model="mail.message.subtype">
18+ <field name="name">New Question</field>
19+ <field name="res_model">forum.forum</field>
20+ <field name="default" eval="True"/>
21+ <field name="hidden" eval="False"/>
22+ <field name="parent_id" eval="ref('mt_question_new')"/>
23+ <field name="relation_field">forum_id</field>
24+ </record>
25
26 </data>
27 <data noupdate="1">
28
29=== modified file 'website_forum/models/forum.py'
30--- website_forum/models/forum.py 2014-04-22 14:49:33 +0000
31+++ website_forum/models/forum.py 2014-05-07 07:46:37 +0000
32@@ -12,7 +12,8 @@
33 """TDE TODO: set karma values for actions dynamic for a given forum"""
34 _name = 'forum.forum'
35 _description = 'Forums'
36- _inherit = ['website.seo.metadata']
37+ _inherit = ['mail.thread', 'website.seo.metadata']
38+
39 # karma values
40 _karma_upvote = 5 # done
41 _karma_downvote = 50 # done
42
43=== modified file 'website_forum/views/forum.xml'
44--- website_forum/views/forum.xml 2014-04-22 14:49:33 +0000
45+++ website_forum/views/forum.xml 2014-05-07 07:46:37 +0000
46@@ -27,6 +27,10 @@
47 <field name="description"/>
48 </group>
49 </sheet>
50+ <div class="oe_chatter">
51+ <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
52+ <field name="message_ids" widget="mail_thread" options='{"thread_level": 1}' placeholder="Send a message to the group"/>
53+ </div>
54 </form>
55 </field>
56 </record>
57
58=== modified file 'website_forum/views/website_forum.xml'
59--- website_forum/views/website_forum.xml 2014-05-01 15:56:33 +0000
60+++ website_forum/views/website_forum.xml 2014-05-07 07:46:37 +0000
61@@ -63,6 +63,9 @@
62 <li t-att-class="searches.get('badges') and 'active' or '' ">
63 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
64 </li>
65+ <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
66+ <a t-attf-href="/forum/#{ slug(forum) }/user/#{user.id}">My Profile</a>
67+ </li>
68 </ul>
69 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
70 <div class="form-group">
71@@ -88,12 +91,23 @@
72 </div>
73 <div class="col-sm-3" id="right-column">
74 <a t-if="not header.get('ask_hide')" class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{slug(forum)}/ask">Ask a Question</a>
75+ <div class="panel panel-default">
76+ <div class="panel-heading">
77+ <h3 class="panel-title">Keep Informed</h3>
78+ </div>
79+ <div class="panel-body">
80+ <t t-call="website_mail.follow">
81+ <t t-set="email" t-value="user.email"/>
82+ <t t-set="object" t-value="forum"/>
83+ </t>
84+ </div>
85+ </div>
86 <div class="panel panel-default" id="about_forum">
87 <div class="panel-heading">
88 <h3 class="panel-title">About This Forum</h3>
89 </div>
90 <div class="panel-body">
91- <t t-raw="forum.description"/><br/>
92+ <t t-raw="forum.description"/>
93 <a t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
94 </div>
95 </div>

Subscribers

People subscribed via source and target branches

to all changes: