summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2019-01-23 16:31:57 +0000
committerJeremy Kersten <jke@odoo.com>2019-01-23 16:35:32 +0000
commitfe62c45e70be52c823ec2d2a931b6e2979882368 (patch)
treec365555ec89bc7439ff560405cce56372ad3f814
parentc2b4ff9d4ead8e92027d9d3085e68bb1249da011 (diff)
[FIX] website_forum: use same dom for all icon
Before this commit we try to imitate the btn with the form (eg. flag button) But if you style in a theme your button and not the form (like odoo.com) you will see a difference between the 4 icons.
-rw-r--r--addons/website_forum/static/src/js/website_forum.js2
-rw-r--r--addons/website_forum/views/website_forum.xml13
2 files changed, 9 insertions, 6 deletions
diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js
index e79dd72ccea..10abaf4c24a 100644
--- a/addons/website_forum/static/src/js/website_forum.js
+++ b/addons/website_forum/static/src/js/website_forum.js
@@ -261,7 +261,7 @@ sAnimations.registry.websiteForum = sAnimations.Class.extend({
ev.preventDefault();
var $link = $(ev.currentTarget);
this._rpc({
- route: $link.data('href') || ($link.attr('href') !== '#' && $link.attr('href')) || $link.attr('action'),
+ route: $link.data('href') || ($link.attr('href') !== '#' && $link.attr('href')) || $link.closest('form').attr('action'),
}).then(function (data) {
if (data.error) {
var $warning;
diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml
index dd7de7063d6..bfd79d90749 100644
--- a/addons/website_forum/views/website_forum.xml
+++ b/addons/website_forum/views/website_forum.xml
@@ -756,11 +756,14 @@
<t t-set="icon" t-value="'fa-check'"/>
<t t-set="karma" t-value="not question.can_moderate and question.forum_id.karma_moderate or 0"/>
</t>
- <a t-if="question.active" href="#" t-attf-style="#{not question.can_flag and 'display:none;' or ''}"
- t-attf-class="flag px-3 py-2 #{not question.can_flag and 'karma_required' or ''}"
- t-attf-data-karma="#{not question.can_flag and question.forum_id.karma_flag or 0}"
- t-attf-data-href="/forum/#{slug(forum)}/post/#{slug(question)}/flag" title="Flag"
- ><i t-attf-class="fa #{not question.can_flag and 'karma_required fa-flag-o' or 'fa-flag'}"/>
+ <a t-if="question.active" href="#" t-call="website_forum.link_button">
+ <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/flag'"/>
+ <t t-set="title">Flag</t>
+ <t t-set="inDropdown" t-value="False"/>
+ <t t-set="icon" t-value="not question.can_flag and 'fa-flag-o' or 'fa-flag'"/>
+ <t t-set="karma" t-value="not question.can_flag and question.forum_id.karma_flag or 0"/>
+ <t t-set="classes" t-value="'flag'"/>
+
</a>
</div>
</div>