summaryrefslogtreecommitdiff
path: root/addons/share/static
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-07-02 16:46:54 +0200
committerThibault Delavallée <tde@openerp.com>2012-07-02 16:46:54 +0200
commit8fea9baa91c118fe07a7be235134c0faec3e7cd2 (patch)
treedca48dcb4a48dd31da1b5ed5934045e67e0f3a9a /addons/share/static
parentc8da73626e2340f7f4215b36c7e2b9ff11bb1948 (diff)
parent0c86af17ab90c580106aec65d195a91b8710e75e (diff)
[MERGE] Merged branch some fixes and clean for chatter/share.Mail
- subject is not required anymore, leading to a better-looking Wall/Chatter - defined a name_get because subject could be void Mail group - cleaned form view Mail compose message - cleaned the current form view Share - moved links to the More menu - cleaned various views of the wizard - fixed link send in the email for direct login Invite - cleaned style - better integration with Portal option Fetchmail - fixed a bug due to a wrongly named variable (logger) CRM - lead view: chatter in a footer Chatter - use expander plugin for read more/read less. bzr revid: tde@openerp.com-20120702144654-y9zt3vsh9dwje1rn
Diffstat (limited to 'addons/share/static')
-rw-r--r--addons/share/static/src/css/share.css7
-rw-r--r--addons/share/static/src/js/share.js58
-rw-r--r--addons/share/static/src/xml/share.xml13
3 files changed, 35 insertions, 43 deletions
diff --git a/addons/share/static/src/css/share.css b/addons/share/static/src/css/share.css
index 997c070fe54..dbbb8bea943 100644
--- a/addons/share/static/src/css/share.css
+++ b/addons/share/static/src/css/share.css
@@ -1,7 +1,4 @@
-button.oe_share_mail {
- display: none;
-}
-
-a.oe_share_link, a.oe_share {
+/* Added invite button, hidden by default */
+button.oe_share_invite {
display: none;
}
diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js
index e88616546a3..33aa3d1aab9 100644
--- a/addons/share/static/src/js/share.js
+++ b/addons/share/static/src/js/share.js
@@ -50,29 +50,46 @@ openerp.share = function(session) {
session.connection.share_flag.done(yes).fail(no);
}
+ /* Extend the Sidebar to add Share and Embed links in the 'More' menu */
session.web.Sidebar = session.web.Sidebar.extend({
- add_default_sections: function() {
- this._super();
+
+ start: function() {
var self = this;
+ this._super(this);
has_share(function() {
- self.add_items('other', [{
- label: 'Share',
- callback: self.on_sidebar_click_share,
- classname: 'oe_share',
- }]);
+ self.add_items('other', [
+ { label: 'Share',
+ callback: self.on_click_share,
+ classname: 'oe_share' },
+ { label: 'Embed',
+ callback: self.on_click_share_link,
+ classname: 'oe_share' },
+ ]);
});
},
- on_sidebar_click_share: function(item) {
+
+ on_click_share: function(item) {
+ var view = this.getParent()
+ launch_wizard(this, view, 'emails', false);
+ },
+
+ on_click_share_link: function(item) {
var view = this.getParent()
- launch_wizard(this, view);
+ launch_wizard(this, view, 'embedded', false);
},
});
+ /**
+ * Extends mail (Chatter widget)
+ * - show the 'invite' button' only we came on the form view through
+ * an action. We do this because 'invite' is based on the share
+ * mechanism, and it tries to share an action.
+ */
session.mail.RecordThread.include( {
start: function() {
start_res = this._super.apply(this, arguments);
if (has_action_id) {
- this.$element.find('button.oe_share_mail').show();
+ this.$element.find('button.oe_share_invite').show();
}
return start_res;
}
@@ -83,12 +100,7 @@ openerp.share = function(session) {
var self = this;
this.check_if_action_is_defined();
has_share(function() {
- self.$element.find('a.oe_share_link').click(self.on_click_share_link);
- self.$element.find('a.oe_share').click(self.on_click_share);
- self.$element.delegate('button.oe_share_mail', 'click', self.on_click_share_mail);
- }, function() {
- self.$element.find('a.oe_share_link').remove();
- self.$element.find('a.oe_share').remove();
+ self.$element.delegate('button.oe_share_invite', 'click', self.on_click_share_invite);
});
return this._super.apply(this, arguments);
},
@@ -96,23 +108,13 @@ openerp.share = function(session) {
check_if_action_is_defined: function() {
if (this.action && this.action.id) {
has_action_id = true;
- this.$element.find('a.oe_share_link').show();
- this.$element.find('a.oe_share').show();
}
else {
has_action_id = false;
}
},
-
- on_click_share_link: function(e) {
- e.preventDefault();
- launch_wizard(this, this.views[this.active_view].controller, 'embedded', false);
- },
- on_click_share: function(e) {
- e.preventDefault();
- launch_wizard(this, this.views[this.active_view].controller, 'emails', false);
- },
- on_click_share_mail: function(e) {
+
+ on_click_share_invite: function(e) {
e.preventDefault();
launch_wizard(this, this.views[this.active_view].controller, 'emails', true);
},
diff --git a/addons/share/static/src/xml/share.xml b/addons/share/static/src/xml/share.xml
index e51dc135c0b..1d9bc987afc 100644
--- a/addons/share/static/src/xml/share.xml
+++ b/addons/share/static/src/xml/share.xml
@@ -3,18 +3,11 @@
-->
<templates id="template" xml:space="preserve">
- <t t-extend="ViewManagerAction">
- <t t-jquery=".oe_shortcuts_toggle" t-operation="after">
- <a class="oe_share_link" href="#share_link" title="Link or embed..."><img t-att-src='_s + "/share/static/src/img/share.png"'/></a>
- <a class="oe_share" href="#share" title="Share with..."><img t-att-src='_s + "/share/static/src/img/share.png"'/></a>
- </t>
- </t>
-
- <t t-extend="RecordThread">
+ <!-- Extends Chatter widget in form view to add the invite button -->
+ <t t-extend="mail.RecordThread">
<t t-jquery="button.oe_mail_button_unfollow" t-operation="after">
- <button type="button" class="oe_share_mail oe_mail_button_mouseout">Invite</button>
+ <button type="button" class="oe_share_invite">Invite</button>
</t>
</t>
-
</templates>