[IMP] Building Block Zone, SEO Style, bootstrap style by default
bzr revid: fp@tinyerp.com-20131004163754-rwa3t1gcmfok4v0w
This commit is contained in:
parent
3c33f42ddd
commit
d7b75724cb
|
@ -425,15 +425,6 @@ $highlighted_text_color: #ffffff
|
|||
.oe_seo_keyword
|
||||
padding: .2em .4em .2em .5em
|
||||
+border-radius(.4em)
|
||||
.keyword-in-title
|
||||
background-color: $in_title_color+pointer
|
||||
color: $highlighted_text_color
|
||||
.keyword-in-description
|
||||
background-color: $in_description_color
|
||||
color: $highlighted_text_color
|
||||
.keyword-in-body
|
||||
background-color: $in_body_color
|
||||
color: $highlighted_text_color
|
||||
|
||||
/* ---- ACE EDITOR ---- */
|
||||
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
|
||||
function analyzeKeyword(htmlPage, keyword) {
|
||||
return htmlPage.isInTitle(keyword) ? {
|
||||
title: 'keyword-in-title',
|
||||
title: 'label label-primary',
|
||||
description: "This keyword is used in the page title",
|
||||
} : htmlPage.isInDescription(keyword) ? {
|
||||
title: 'keyword-in-description',
|
||||
title: 'label label-info',
|
||||
description: "This keyword is used in the page description",
|
||||
} : htmlPage.isInBody(keyword) ? {
|
||||
title: 'keyword-in-body',
|
||||
title: 'label label-info',
|
||||
description: "This keyword is used in the page content."
|
||||
} : { title: "", description: "" };
|
||||
}
|
||||
|
@ -58,7 +58,7 @@
|
|||
});
|
||||
|
||||
website.seo.SuggestionList = openerp.Widget.extend({
|
||||
template: 'website.seo_list',
|
||||
template: 'website.seo_suggestion_list',
|
||||
init: function (parent, options) {
|
||||
this.root = options.root;
|
||||
this.htmlPage = options.page;
|
||||
|
@ -155,7 +155,9 @@
|
|||
});
|
||||
} else {
|
||||
var companyName = self.htmlPage.company().toLowerCase();
|
||||
self.add(companyName);
|
||||
if (companyName != 'yourcompany') {
|
||||
self.add(companyName);
|
||||
}
|
||||
}
|
||||
},
|
||||
keywords: function () {
|
||||
|
@ -361,24 +363,19 @@
|
|||
}).appendTo(self.$('.js_seo_tips'));
|
||||
}
|
||||
var htmlPage = this.htmlPage;
|
||||
if (htmlPage.headers('h1').length === 0) {
|
||||
tips.push({
|
||||
type: 'warning',
|
||||
message: "This page seems to be missing an <h1> tag.",
|
||||
});
|
||||
}
|
||||
if (htmlPage.headers('h1').length > 1) {
|
||||
tips.push({
|
||||
type: 'warning',
|
||||
message: "The page contains more than one <h1> tag.",
|
||||
});
|
||||
}
|
||||
|
||||
// desactivated as too complex for end-users
|
||||
// if (htmlPage.headers('h1').length === 0) {
|
||||
// tips.push({
|
||||
// type: 'warning',
|
||||
// message: "This page seems to be missing a title.",
|
||||
// });
|
||||
// }
|
||||
|
||||
if (tips.length > 0) {
|
||||
_.each(tips, function (tip) {
|
||||
displayTip(tip.message, tip.type);
|
||||
});
|
||||
} else {
|
||||
displayTip("The markup on this page is appropriate for search engines.", 'success');
|
||||
}
|
||||
},
|
||||
confirmKeyword: function (e) {
|
||||
|
|
|
@ -6,16 +6,18 @@
|
|||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button title="Close" type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h3 class="modal-title js_seo_page_url"></h3>
|
||||
<h4 class="text-muted">Get this page efficiently referenced in Google to attract more visitors.</h4>
|
||||
<div class="h2">Promote This Page</div>
|
||||
<div class="text-muted">
|
||||
Get this page efficiently referenced in Google to attract more visitors.
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="js_seo_tips" />
|
||||
<section class="js_seo_keywords_list">
|
||||
<h3 class="page-header">1. Define keywords <small>describing your page content</small></h3>
|
||||
<h3 class="page-header mt16">1. Define Keywords <small>describing your page content</small></h3>
|
||||
<div class="form-horizontal" role="form">
|
||||
<div class="form-group">
|
||||
<label for="seo_page_keywords" class="col-lg-2 control-label">New keyword</label>
|
||||
<label for="seo_page_keywords" class="col-lg-2 control-label">Add keywords:</label>
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="seo_page_keywords" class="form-control" maxlength="30"/>
|
||||
|
@ -26,12 +28,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-muted">Most searched topics related your keywords, ordered by importance:</span>
|
||||
<span class="text-muted">Most searched topics related to your keywords, ordered by importance:</span>
|
||||
<!-- filled in JS -->
|
||||
</section>
|
||||
<section>
|
||||
<h3 class="page-header">2. Choose a title and description <small>containing keywords relevant to what people are searching on the web</small></h3>
|
||||
<div class="form-horizontal" role="form">
|
||||
<h3 class="page-header">2. Reference Your Page <small>using above suggestions</small></h3>
|
||||
<div class="form-horizontal mt16" role="form">
|
||||
<div class="form-group">
|
||||
<label for="seo_page_title" class="col-lg-2 control-label">Title</label>
|
||||
<div class="col-lg-8">
|
||||
|
@ -52,22 +54,27 @@
|
|||
<!-- filled in JS -->
|
||||
</div>
|
||||
</section>
|
||||
<hr/>
|
||||
<section>
|
||||
<button type="button" data-action="update" class="btn btn-primary">Apply changes</button> or <a data-action="discard" data-dismiss="modal" href="#">Discard</a>
|
||||
</section>
|
||||
</div><div class="modal-footer">
|
||||
<button data-action="discard" data-dismiss="modal" href="#" class="btn btn-default">Discard</button>
|
||||
<button type="button" data-action="update" class="btn btn-primary">Apply Changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.seo_list">
|
||||
<ul class="list-inline">
|
||||
<t t-name="website.seo_suggestion_list">
|
||||
<ul class="list-inline mb0">
|
||||
<!-- filled in JS -->
|
||||
</ul>
|
||||
</t>
|
||||
|
||||
<t t-name="website.seo_list">
|
||||
<div>
|
||||
<!-- filled in JS -->
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.seo_tip">
|
||||
<div t-attf-class="alert alert-#{ widget.type }">
|
||||
<t t-raw="widget.message"/>
|
||||
|
@ -75,7 +82,7 @@
|
|||
</t>
|
||||
|
||||
<t t-name="website.seo_keyword">
|
||||
<dl class="dl-horizontal">
|
||||
<dl class="dl-horizontal mt8 mb8">
|
||||
<dt>
|
||||
<span t-attf-title="#{ widget.tooltip() }" t-attf-class="oe_seo_keyword #{ widget.highlight() } js_seo_keyword" t-att-data-keyword="widget.keyword">
|
||||
<a href="#" class="oe_remove" data-action="remove-keyword">x</a> <t t-raw="widget.keyword"/>
|
||||
|
|
|
@ -35,12 +35,12 @@
|
|||
<span class="mt16">drop in this zone</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-muted">
|
||||
<div class="text-muted">
|
||||
<b>Tip:</b> when your cursor is in a valid zone,
|
||||
OpenERP shows you a preview of the building block
|
||||
in the page. You must release the block when the
|
||||
preview is visible.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
|
||||
|
|
Loading…
Reference in New Issue