[IMP] web_linkedin: url with linkedin image on bottom of website

bzr revid: chm@openerp.com-20130205105915-zikvtunnjv8ao4s2
This commit is contained in:
Christophe Matthieu 2013-02-05 11:59:15 +01:00
commit e3c9860e48
6 changed files with 24 additions and 26 deletions

View File

@ -360,7 +360,7 @@ Andrew</field>
<field name="type_id" ref="type_lead5"/>
<field name="categ_ids" eval="[(6, 0, [categ_oppor5])]"/>
<field name="priority">2</field>
<field eval="time.strftime('%Y-%m-30')" name="date_deadline"/>
<field eval="time.strftime('%Y-%m-28')" name="date_deadline"/>
<field eval="time.strftime('%Y-%m-1')" name="date_action"/>
<field name="title_action">Convert to quote</field>
<field name="section_id" ref="crm_case_section_1"/>

View File

@ -1,18 +1,12 @@
.openerp .oe_linkedin_form_img {
.openerp .oe_linkedin_img {
float: right;
width: 1.5em;
margin-top: -1px;
cursor: pointer;
}
.openerp .oe_linkedin_img {
width: 1em;
margin-top: -2px;
cursor: pointer;
}
.openerp .oe_linkedin_input {
margin-right:1.5em;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -148,24 +148,13 @@ openerp.web_linkedin = function(instance) {
this.display_dm = new instance.web.DropMisordered(true);
},
initialize_content: function() {
var $ht = $(QWeb.render("FieldChar.linkedin.form"));
var $ht = $(QWeb.render("FieldChar.linkedin"));
var $in = this.$("input");
$in.replaceWith($ht);
this.$(".oe_linkedin_input").append($in);
this.$(".oe_linkedin_form_img").click(_.bind(this.search_linkedin, this));
var $ht = $(QWeb.render("FieldChar.linkedin"));
var $span = this.$("span");
$span.replaceWith($ht);
this.$(".oe_linkedin_span").replaceWith($span);
this._super();
},
render_value: function() {
var result = this._super();
this.$(".oe_linkedin_url").attr("href", this.field_manager.datarecord.linkedin_url || "#").toggle(!!this.field_manager.datarecord.linkedin_url);
return result;
},
search_linkedin: function() {
var self = this;
this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).done(function() {
@ -342,9 +331,21 @@ openerp.web_linkedin = function(instance) {
});
},
});
instance.web.form.widgets.add('linkedin', 'instance.web_linkedin.Linkedin');
instance.web_linkedin.Linkedin_url = instance.web.form.FieldChar.extend({
initialize_content: function() {
this.$("input,span").replaceWith($(QWeb.render("FieldChar.linkedin_url")));
this._super();
},
render_value: function() {
this._super();
this.$(".oe_linkedin_url").attr("href", this.field_manager.datarecord.linkedin_url || "#").toggle(!!this.field_manager.datarecord.linkedin_url);
},
});
instance.web.form.widgets.add('linkedin_url', 'instance.web_linkedin.Linkedin_url');
var commonPeopleFields = ["id", "picture-url", "public-profile-url", "first-name", "last-name",
"formatted-name", "location", "phone-numbers", "im-accounts",
"main-address", "headline", "positions", "summary", "specialties"];

View File

@ -2,13 +2,12 @@
<!-- vim:fdl=1:
-->
<templates xml:space="preserve">
<t t-name="FieldChar.linkedin.form">
<img class="oe_linkedin_form_img" t-att-src='_s + "/web_linkedin/static/src/img/Linkedin_blue.png"'/>
<t t-name="FieldChar.linkedin">
<img class="oe_linkedin_img" t-att-src='_s + "/web_linkedin/static/src/img/Linkedin_blue.png"'/>
<div class="oe_linkedin_input"/>
</t>
<t t-name="FieldChar.linkedin">
<div class="oe_linkedin_span"/>
<a class="oe_linkedin_url" href="#" target="_blank"><img class="oe_linkedin_img" t-att-src='_s + "/web_linkedin/static/src/img/Linkedin_blue.png"'/></a>
<t t-name="FieldChar.linkedin_url">
<a class="oe_linkedin_url" href="#" target="_blank"><img t-att-src='_s + "/web_linkedin/static/src/img/linkedin-profile.jpeg"'/></a>
</t>
<t t-name="Linkedin.popup">
<div>

View File

@ -11,6 +11,10 @@
<field name="linkedin_url" invisible="1"/>
<field name="name" default_focus="1" nolabel="1" widget="linkedin" />
</field>
<field name="website" position="after">
<field name="linkedin_id" invisible="1"/>
<field name="linkedin_url" nolabel="1" widget="linkedin_url"/>
</field>
</field>
</record>