[IMP] Improved API key warning.

bzr revid: vja@tinyerp.com-20120621134458-2vq2xsalq5hn7w8q
This commit is contained in:
Vishmita 2012-06-21 19:14:58 +05:30
parent dd0a2cc66f
commit b0826bf555
3 changed files with 19 additions and 5 deletions

View File

@ -6,7 +6,9 @@
background-color: rgb(255, 255, 255);
border: 1px solid rgb(153, 153, 153);
}
#apikey{
background-color: #D2D2FF
}
.li-ldn-dropdown {
margin: 0px;
display: block;

View File

@ -159,7 +159,7 @@ openerp.web_linkedin = function(instance) {
},
APIKeyWarning: function(e) {
var self = this;
instance.web.dialog($(QWeb.render("Register.Linkedin")), {
this.dialog = instance.web.dialog($(QWeb.render("Register.Linkedin")), {
title: _t("Configure your Linkedin Key API"),
modal: true,
width : 840,
@ -168,13 +168,25 @@ openerp.web_linkedin = function(instance) {
{
text: _t("Ok"),
click: function() { $(this).dialog("close"); }
}]
}],
});
this.dialog.parent().find('.ui-dialog-titlebar').append('<button class="close">No Thanks</button>').click(function(){
self.dialog.remove();
})
$('.close').css({ 'margin': '10px 0 0 19px'})
$("#register").click(function() {
var key = $("#apikey").val();
var user = new instance.web.DataSet(self, "res.users");
user.call("set_linkedin_api_key", [key]);
});
if(key.length){
self.dialog.remove(),
user.__parentedParent.view.reload();
}
else {
$("#apikey").css({'background-color':'#F66 '})
}
})
},
setTemplate: function( URL, AccountName ) {
if(AccountName){

View File

@ -49,7 +49,7 @@
</div>
<div>
<p>Copy the API Key:
<input type="text" id="apikey" /><button id="register" class="oe_form_button_save_dirty" onclick="">Apply</button>
<input type="text" id="apikey"/><button id="register" class="oe_form_button_save_dirty" onclick="">Apply</button>
</p>
</div>
<div>