SEO bugfixes

bzr revid: ddm@openerp.com-20130902133923-hhzfe0gv4t6usd22
This commit is contained in:
ddm
2013-09-02 15:39:23 +02:00
parent 95c133b9d5
commit e44332e5f7
4 changed files with 13 additions and 3 deletions
+3
View File
@@ -283,3 +283,6 @@
.oe_seo_configuration .oe_remove {
color: #e00101;
}
.oe_seo_configuration .oe_seo_suggestion {
cursor: pointer;
}
@@ -252,3 +252,5 @@ $remove_color: $icon_close
width: 80%
.oe_remove
color: $remove_color
.oe_seo_suggestion
cursor: pointer
+7 -2
View File
@@ -60,7 +60,9 @@
// default, primary, success, info, warning, danger
this.type = options.type || 'default';
this._addToSelection = function (keyword) {
parent.addKeyword(keyword, parent.$el, 'info');
if (_.isFunction(parent.addKeyword)) {
parent.addKeyword(keyword, parent.$el, 'info');
}
};
this._super(parent);
},
@@ -155,10 +157,13 @@
}
},
displayKeywordSuggestions: function (pageParser) {
var $modal = this.$el;
var companyName = pageParser.company().toLowerCase();
var requestURL = "http://seo.eu01.aws.af.cm/suggest/" + encodeURIComponent(companyName);
$modal.find('.js_seo_company_suggestions').append("Loading...");
var self = this;
$.getJSON(requestURL, function (list) {
$modal.find('.js_seo_company_suggestions').empty();
var nameRegex = new RegExp(companyName, "gi");
var cleanList = _.map(list, function (word) {
return word.replace(nameRegex, "").trim();
@@ -168,7 +173,7 @@
if (keyword) {
new website.seo.Suggestion(self, {
keyword: keyword
}).appendTo($('.js_seo_company_suggestions'));
}).appendTo($modal.find('.js_seo_company_suggestions'));
}
});
});
+1 -1
View File
@@ -145,7 +145,7 @@
</t>
<t t-name="website.seo_suggestion">
<li class="oe_seo_keyword">
<li class="oe_seo_suggestion">
<span t-attf-class="label label-#{ widget.type } js_seo_suggestion" t-att-data-keyword="widget.keyword">
<t t-raw="widget.keyword"/>
</span>