[IMP] fixes bootstrap
bzr revid: fp@openerp.com-20130829220425-xxyub3uvrmdi13j4
This commit is contained in:
commit
1aea7145c7
File diff suppressed because one or more lines are too long
|
@ -127,7 +127,7 @@ class event_event(osv.osv):
|
|||
string='Maximum Registrations',
|
||||
help="The maximum registration level is equal to the sum of the maximum registration of event ticket." +
|
||||
"If you have too much registrations you are not able to confirm your event. (0 to ignore this rule )",
|
||||
type='integer', store=True)
|
||||
type='integer')
|
||||
}
|
||||
|
||||
def check_registration_limits(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -289,18 +289,17 @@
|
|||
}
|
||||
|
||||
/* ---- SEO TOOLS ---- */
|
||||
.oe_seo_configuration {
|
||||
min-width: 42em;
|
||||
.oe_seo_configuration.modal {
|
||||
width: 100%;
|
||||
left: 0;
|
||||
margin-left: 0;
|
||||
top: 0 !important;
|
||||
margin-top: 0 !important;
|
||||
height: 100%;
|
||||
}
|
||||
.oe_seo_configuration .modal-body {
|
||||
max-height: inherit;
|
||||
min-height: 27em;
|
||||
}
|
||||
.oe_seo_configuration input {
|
||||
width: 90%;
|
||||
}
|
||||
.oe_seo_configuration textarea {
|
||||
width: 90%;
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.oe_seo_configuration ul {
|
||||
list-style: none;
|
||||
|
@ -309,11 +308,10 @@
|
|||
color: #e00101;
|
||||
}
|
||||
|
||||
.oe_seo_keywords_list {
|
||||
width: 100%;
|
||||
.oe_seo_keywords_list.container {
|
||||
margin: 0.1em;
|
||||
}
|
||||
.oe_seo_keywords_list li {
|
||||
.oe_seo_keywords_list .oe_seo_keyword {
|
||||
float: left;
|
||||
width: 19em;
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
|
|
|
@ -259,22 +259,24 @@ $icon_close: #E00101
|
|||
|
||||
$remove_color: $icon_close
|
||||
.oe_seo_configuration
|
||||
min-width: 42em
|
||||
&.modal
|
||||
width: 100%
|
||||
left: 0
|
||||
margin-left: 0
|
||||
top: 0!important
|
||||
margin-top: 0!important
|
||||
height: 100%
|
||||
.modal-body
|
||||
max-height: inherit
|
||||
min-height: 27em
|
||||
input
|
||||
width: 90%
|
||||
textarea
|
||||
width: 90%
|
||||
max-height: 100%
|
||||
height: 100%
|
||||
ul
|
||||
list-style: none
|
||||
.oe_remove
|
||||
color: $remove_color
|
||||
|
||||
.oe_seo_keywords_list
|
||||
width: 100%
|
||||
margin: 0.1em
|
||||
li
|
||||
&.container
|
||||
margin: 0.1em
|
||||
.oe_seo_keyword
|
||||
float: left
|
||||
width: 19em
|
||||
padding-right: 0.5em
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@charset "utf-8";
|
||||
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
|
||||
*
|
||||
* css for editor buttons, openerp widget included in the website and other
|
||||
|
@ -148,60 +149,20 @@ footer {
|
|||
display: block;
|
||||
}
|
||||
|
||||
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
|
||||
header.navbar-fixed-top {
|
||||
position: static;
|
||||
}
|
||||
|
||||
#myCarousel .item {
|
||||
min-height: 300px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
|
||||
.dark {
|
||||
background: #eff8f8;
|
||||
}
|
||||
/* ----- BOOTSTRAP HACK FOR STICKY carousel-control ----- */
|
||||
.carousel-control {
|
||||
top: 40%;
|
||||
left: 15px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-top: -20px;
|
||||
font-size: 60px;
|
||||
line-height: 30px;
|
||||
background: #222222;
|
||||
border: 3px solid #ffffff;
|
||||
-webkit-border-radius: 23px;
|
||||
-moz-border-radius: 23px;
|
||||
border-radius: 23px;
|
||||
}
|
||||
/* ----- BOOTSTRAP HACK FOR STICKY header tags ----- */
|
||||
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
||||
font-weight: 900;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
.navbar-form .btn {
|
||||
margin-top: 3px;
|
||||
margin-bottom: -5px;
|
||||
}
|
||||
header {
|
||||
margin-bottom: 0px;
|
||||
margin-top: -10px;
|
||||
min-height: 40px;
|
||||
}
|
||||
header .collapse ul {
|
||||
margin-top: 5px;
|
||||
}
|
||||
header > .navbar {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
#website-top-view .navbar-nav>li>a {
|
||||
padding:10px 15px 10px;
|
||||
|
||||
/* Hacks to remove */
|
||||
div#wrap .carousel {
|
||||
top: -20px;
|
||||
}
|
||||
|
||||
/* -- Hack for nav header -- */
|
||||
.nav > li.nav-header {
|
||||
display: block;
|
||||
|
@ -212,38 +173,46 @@ header > .navbar {
|
|||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
ul.nav-stacked>li>a {
|
||||
padding: 2px 15px;
|
||||
}
|
||||
|
||||
.nav.nav-hierarchy {
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
.navbar-inverse .divider-vertical {
|
||||
height: 40px;
|
||||
margin: 0 9px;
|
||||
border-right: 1px solid #ffffff;
|
||||
border-right: 1px solid white;
|
||||
border-left: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.navbar-nav .divider-vertical {
|
||||
border-right-color: #222;
|
||||
border-right-color: #222222;
|
||||
border-left-color: #080808;
|
||||
}
|
||||
|
||||
.navbar-inverse {
|
||||
background-image: -moz-linear-gradient(top, #222, #080808);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222), to(#080808));
|
||||
background-image: -webkit-linear-gradient(top, #222, #080808);
|
||||
background-image: -o-linear-gradient(top, #222, #080808);
|
||||
background-image: linear-gradient(to bottom, #222, #080808);
|
||||
background-image: -moz-linear-gradient(top, #222222, #080808);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#080808));
|
||||
background-image: -webkit-linear-gradient(top, #222222, #080808);
|
||||
background-image: -o-linear-gradient(top, #222222, #080808);
|
||||
background-image: linear-gradient(to bottom, #222222, #080808);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.navbar-default {
|
||||
border: 1px solid #d4d4d4;
|
||||
}
|
||||
/* -- Hack for removing double scroll-bar from mobile preview -- */
|
||||
|
||||
/* -- Hack for removing double scrollbar from mobile preview -- */
|
||||
.modal {
|
||||
overflow: hidden;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
ul.nav-stacked > li > a {
|
||||
padding: 2px 15px;
|
||||
}
|
||||
|
||||
.dropdown-header {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
|
|
@ -50,17 +50,16 @@
|
|||
margin-bottom: 0px !important
|
||||
|
||||
/* Grid of unequally tall elements */
|
||||
.grid > [class*="span"]
|
||||
.grid > [class*="col-md"]
|
||||
display: inline-block
|
||||
float: none
|
||||
vertical-align: top
|
||||
margin-right: -4px
|
||||
box-sizing: border-box
|
||||
&.grid-align-top > [class*="span"]
|
||||
&.grid-align-top > [class*="col-md"]
|
||||
vertical-align: top
|
||||
&.grid-align-middle > [class*="span"]
|
||||
&.grid-align-middle > [class*="col-md"]
|
||||
vertical-align: middle
|
||||
&.grid-align-bottom > [class*="span"]
|
||||
&.grid-align-bottom > [class*="col-md"]
|
||||
vertical-align: bottom
|
||||
|
||||
/* Table with two collumns aligned on the center */
|
||||
|
@ -110,42 +109,18 @@ footer
|
|||
.nav > li a
|
||||
display: block
|
||||
|
||||
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
|
||||
|
||||
header.navbar-fixed-top
|
||||
position: static
|
||||
|
||||
#myCarousel .item
|
||||
min-height: 300px
|
||||
color: white
|
||||
|
||||
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
|
||||
|
||||
.dark
|
||||
background: rgb(239, 248, 248)
|
||||
|
||||
.carousel-control
|
||||
top: 40%
|
||||
left: 15px
|
||||
width: 40px
|
||||
height: 40px
|
||||
margin-top: -20px
|
||||
font-size: 60px
|
||||
line-height: 30px
|
||||
background: #222222
|
||||
border: 3px solid #ffffff
|
||||
-webkit-border-radius: 23px
|
||||
-moz-border-radius: 23px
|
||||
border-radius: 23px
|
||||
|
||||
header
|
||||
margin-bottom: 0px
|
||||
min-height: 40px
|
||||
.collapse ul
|
||||
margin-top: 5px
|
||||
> .navbar
|
||||
margin-bottom: 0px
|
||||
|
||||
.navbar-nav >li >a
|
||||
padding:10px 15px 10px
|
||||
/* Hacks to remove */
|
||||
div#wrap
|
||||
.carousel
|
||||
top: -20px
|
||||
|
||||
/* -- Hack for nav header -- */
|
||||
.nav > li.nav-header
|
||||
|
@ -157,9 +132,6 @@ header
|
|||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5)
|
||||
text-transform: uppercase
|
||||
|
||||
ul.nav-stacked>li>a
|
||||
padding: 2px 15px
|
||||
|
||||
.nav.nav-hierarchy
|
||||
padding-left: 16px
|
||||
|
||||
|
@ -188,7 +160,9 @@ ul.nav-stacked>li>a
|
|||
.modal
|
||||
overflow: hidden
|
||||
overflow-y: hidden
|
||||
ul.nav-stacked>li>a
|
||||
|
||||
ul.nav-stacked > li > a
|
||||
padding: 2px 15px
|
||||
|
||||
.dropdown-header
|
||||
text-transform: uppercase
|
||||
text-transform: uppercase
|
||||
|
|
|
@ -3,7 +3,53 @@
|
|||
|
||||
var website = openerp.website;
|
||||
|
||||
website.templates.push('/website/static/src/xml/website.editor.xml');
|
||||
website.dom_ready.done(function () {
|
||||
// $.fn.data automatically parses value, '0'|'1' -> 0|1
|
||||
website.is_editable = $(document.documentElement).data('editable');
|
||||
var is_smartphone = $(document.body)[0].clientWidth < 767;
|
||||
|
||||
if (website.is_editable && !is_smartphone) {
|
||||
website.ready().then(website.init_editor);
|
||||
}
|
||||
});
|
||||
|
||||
function link_dialog(editor) {
|
||||
return new website.editor.LinkDialog(editor).appendTo(document.body);
|
||||
}
|
||||
|
||||
website.init_editor = function () {
|
||||
CKEDITOR.plugins.add('customdialogs', {
|
||||
requires: 'link,image',
|
||||
init: function (editor) {
|
||||
editor.on('doubleclick', function (evt) {
|
||||
if (evt.data.dialog === 'link' || evt.data.dialog === 'image') {
|
||||
delete evt.data.dialog;
|
||||
link_dialog(editor);
|
||||
}
|
||||
// priority should be smaller than dialog (999) but bigger
|
||||
// than link or image (default=10)
|
||||
}, null, null, 500);
|
||||
|
||||
editor.addCommand('link', {
|
||||
exec: function (editor, data) {
|
||||
link_dialog(editor);
|
||||
return true;
|
||||
},
|
||||
canUndo: false,
|
||||
editorFocus: true,
|
||||
});
|
||||
editor.addCommand('image', {
|
||||
exec: function (editor, data) {
|
||||
console.log('image', editor, data);
|
||||
return true;
|
||||
},
|
||||
canUndo: false,
|
||||
editorFocus: true,
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
var editor = new website.EditorBar();
|
||||
var $body = $(document.body);
|
||||
editor.prependTo($body);
|
||||
|
@ -215,7 +261,7 @@
|
|||
autoParagraph: false,
|
||||
filebrowserImageUploadUrl: "/website/attach",
|
||||
// Support for sharedSpaces in 4.x
|
||||
extraPlugins: 'sharedspace',
|
||||
extraPlugins: 'sharedspace,customdialogs',
|
||||
// Place toolbar in controlled location
|
||||
sharedSpaces: { top: 'oe_rte_toolbar' },
|
||||
toolbar: [
|
||||
|
@ -251,6 +297,158 @@
|
|||
},
|
||||
});
|
||||
|
||||
website.editor = { };
|
||||
website.editor.Dialog = openerp.Widget.extend({
|
||||
events: {
|
||||
'hidden': 'destroy',
|
||||
},
|
||||
init: function (editor) {
|
||||
this._super();
|
||||
this.editor = editor;
|
||||
},
|
||||
start: function () {
|
||||
var sup = this._super();
|
||||
this.$el.modal();
|
||||
return sup;
|
||||
},
|
||||
});
|
||||
|
||||
website.editor.LinkDialog = website.editor.Dialog.extend({
|
||||
template: 'website.editor.dialog.link',
|
||||
events: _.extend({}, website.editor.Dialog.prototype.events, {
|
||||
'click button.btn-primary': 'save',
|
||||
'change .url-source': function (e) { this.changed($(e.target)); },
|
||||
}),
|
||||
init: function (editor) {
|
||||
this._super(editor);
|
||||
this.pages = Object.create(null);
|
||||
},
|
||||
start: function () {
|
||||
var element;
|
||||
if ((element = this.get_selected_link()) && element.hasAttribute('href')) {
|
||||
this.editor.getSelection().selectElement(element);
|
||||
}
|
||||
this.element = element;
|
||||
|
||||
return $.when(
|
||||
this.fetch_pages().done(this.proxy('fill_pages')),
|
||||
this._super()
|
||||
).done(this.proxy('bind_data'));
|
||||
},
|
||||
/**
|
||||
* Greatly simplified version of CKEDITOR's
|
||||
* plugins.link.dialogs.link.onOk.
|
||||
*
|
||||
* @param {String} url
|
||||
* @param {Boolean} [new_window=false]
|
||||
* @param {String} [label=null]
|
||||
*/
|
||||
make_link: function (url, new_window, label) {
|
||||
var attributes = {href: url, 'data-cke-saved-href': url};
|
||||
var to_remove = [];
|
||||
if (new_window) {
|
||||
attributes['target'] = '_blank';
|
||||
} else {
|
||||
to_remove.push('target');
|
||||
}
|
||||
|
||||
if (this.element) {
|
||||
this.element.setAttributes(attributes);
|
||||
this.element.removeAttributes(to_remove);
|
||||
} else {
|
||||
var selection = this.editor.getSelection();
|
||||
var range = selection.getRanges(true)[0];
|
||||
|
||||
if (range.collapsed) {
|
||||
var text = new CKEDITOR.dom.text(label || url);
|
||||
range.insertNode(text);
|
||||
range.selectNodeContents(text);
|
||||
}
|
||||
|
||||
new CKEDITOR.style({
|
||||
type: CKEDITOR.STYLE_INLINE,
|
||||
element: 'a',
|
||||
attributes: attributes,
|
||||
}).applyToRange(range);
|
||||
// blows up the call stack, not sure why as original version
|
||||
// seems to work OK
|
||||
// range.select();
|
||||
}
|
||||
},
|
||||
save: function () {
|
||||
var $e = this.$('.url-source').filter(function () { return !!this.value; });
|
||||
|
||||
var val = $e.val();
|
||||
if ($e.hasClass('email-address')) {
|
||||
this.make_link('mailto:' + val, false, val);
|
||||
} else if ($e.hasClass('pages')) {
|
||||
this.make_link(val, false, $e.find('option:selected').text());
|
||||
} else {
|
||||
this.make_link(val, this.$('input.window-new').prop('checked'));
|
||||
}
|
||||
this.$el.modal('hide');
|
||||
},
|
||||
bind_data: function () {
|
||||
var href = this.element && (this.element.data( 'cke-saved-href')
|
||||
|| this.element.getAttribute('href'));
|
||||
if (!href) { return; }
|
||||
|
||||
var match, $control;
|
||||
if (match = /(mailto):(.+)/.exec(href)) {
|
||||
$control = this.$('input.email-address').val(match[2]);
|
||||
} else if(href in this.pages) {
|
||||
$control = this.$('select.pages').val(href);
|
||||
}
|
||||
if (!$control) {
|
||||
$control = this.$('input.url').val(href);
|
||||
}
|
||||
|
||||
this.changed($control);
|
||||
|
||||
this.$('input.window-new').prop(
|
||||
'checked', this.element.getAttribute('target') === '_blank');
|
||||
},
|
||||
changed: function ($e) {
|
||||
$e.closest('li.list-group-item').addClass('active')
|
||||
.siblings().removeClass('active');
|
||||
this.$('.url-source').not($e).val('');
|
||||
},
|
||||
/**
|
||||
* CKEDITOR.plugins.link.getSelectedLink ignores the editor's root,
|
||||
* if the editor is set directly on a link it will thus not work.
|
||||
*/
|
||||
get_selected_link: function () {
|
||||
var sel = this.editor.getSelection(),
|
||||
el = sel.getSelectedElement();
|
||||
if (el && el.is('a')) { return el; }
|
||||
|
||||
var range = sel.getRanges(true)[0];
|
||||
if (!range) { return null; }
|
||||
|
||||
range.shrink(CKEDITOR.SHRINK_TEXT);
|
||||
return this.editor.elementPath(range.getCommonAncestor())
|
||||
.contains('a');
|
||||
|
||||
},
|
||||
fetch_pages: function () {
|
||||
return openerp.jsonRpc('/web/dataset/call_kw', 'call', {
|
||||
model: 'website',
|
||||
method: 'list_pages',
|
||||
args: [],
|
||||
kwargs: {}
|
||||
});
|
||||
},
|
||||
fill_pages: function (results) {
|
||||
var self = this;
|
||||
var $select = this.$('select');
|
||||
$select.append(new Option());
|
||||
_(results).each(function (result) {
|
||||
self.pages[result.url] = true;
|
||||
$select.append(new Option(result.name, result.url));
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
var Observer = window.MutationObserver || window.WebkitMutationObserver || window.JsMutationObserver;
|
||||
var observer = new Observer(function (mutations) {
|
||||
|
@ -279,14 +477,4 @@
|
|||
.uniq()
|
||||
.each(function (node) { $(node).trigger('content_changed'); })
|
||||
});
|
||||
|
||||
website.dom_ready.done(function () {
|
||||
// $.fn.data automatically parses value, '0'|'1' -> 0|1
|
||||
website.is_editable = $(document.documentElement).data('editable');
|
||||
var is_smartphone = $(document.body)[0].clientWidth < 767;
|
||||
|
||||
if (website.is_editable && !is_smartphone) {
|
||||
website.ready().then(website.init_editor);
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// The following line can be removed in 2017
|
||||
openerp.website = website;
|
||||
|
||||
var templates = [
|
||||
var templates = website.templates = [
|
||||
'/website/static/src/xml/website.xml'
|
||||
];
|
||||
|
||||
|
|
|
@ -11,7 +11,25 @@
|
|||
},
|
||||
});
|
||||
|
||||
function cleanupKeyword (word) {
|
||||
return word ? word.replace(/[,;.:]+/g, " ").replace(/ +/g, " ").trim() : "";
|
||||
}
|
||||
|
||||
website.seo = {};
|
||||
|
||||
website.seo.Tip = openerp.Widget.extend({
|
||||
template: 'website.seo_tip',
|
||||
events: {
|
||||
'click button[data-action=close]': 'destroy',
|
||||
},
|
||||
init: function (parent, options) {
|
||||
this._super(parent);
|
||||
this.message = options.message;
|
||||
// info, error or success
|
||||
this.type = options.type;
|
||||
},
|
||||
});
|
||||
|
||||
website.seo.Keyword = openerp.Widget.extend({
|
||||
template: 'website.seo_keyword',
|
||||
events: {
|
||||
|
@ -29,9 +47,7 @@
|
|||
this._super();
|
||||
},
|
||||
});
|
||||
website.seo.cleanupKeyword = function (word) {
|
||||
return word ? word.replace(/[,;.:]+/g, " ").replace(/ +/g, " ").trim() : "";
|
||||
};
|
||||
|
||||
website.seo.PageParser = openerp.Class.extend({
|
||||
init: function () {
|
||||
this._url = this._currentURL();
|
||||
|
@ -62,7 +78,7 @@
|
|||
keywordSuggestions: function () {
|
||||
var headers = this.headers();
|
||||
return _.map(_.uniq(headers.h1.concat(headers.h2)),
|
||||
website.seo.cleanupKeyword);
|
||||
cleanupKeyword);
|
||||
},
|
||||
});
|
||||
website.seo.Configurator = openerp.Widget.extend({
|
||||
|
@ -85,17 +101,26 @@
|
|||
this.$el.find('.js_seo_page_url').text(pageParser.url());
|
||||
this.$el.find('input[name=seo_page_title]').val(pageParser.title());
|
||||
this.$el.find('input[name=seo_page_keywords]').typeahead({
|
||||
items: 4,
|
||||
source: function () {
|
||||
var suggestions = pageParser.keywordSuggestions();
|
||||
var alreadyChosen = currentKeywords();
|
||||
return _.difference(suggestions, alreadyChosen);
|
||||
},
|
||||
items: 4
|
||||
});
|
||||
|
||||
this.checkBestPractices(pageParser);
|
||||
$(document.body).addClass('oe_stop_scrolling');
|
||||
this.$el.modal();
|
||||
},
|
||||
checkBestPractices: function (parser) {
|
||||
var pageParser = parser || new website.seo.PageParser();
|
||||
if (pageParser.headers()['h1'].length > 1) {
|
||||
new website.seo.Tip(this, {
|
||||
message: "You have more than one <h1> tag on the page.",
|
||||
type: 'error'
|
||||
}).appendTo(this.$el.find('.js_seo_tips'));
|
||||
}
|
||||
},
|
||||
currentPage: function () {
|
||||
var url = window.location.href;
|
||||
var hashIndex = url.indexOf('#');
|
||||
|
@ -104,7 +129,7 @@
|
|||
keywords: function () {
|
||||
return _.uniq($('.js_seo_keyword').map(function () {
|
||||
return $(this).text();
|
||||
}).get());
|
||||
}));
|
||||
},
|
||||
isExistingKeyword: function (word) {
|
||||
return _.contains(this.keywords(), word);
|
||||
|
@ -122,7 +147,7 @@
|
|||
var $modal = this.$el;
|
||||
function enableNewKeywords () {
|
||||
$modal.find('input[name=seo_page_keywords]')
|
||||
.removeAttr('readonly').attr('placeholder', "New keyword");
|
||||
.removeAttr('readonly').attr('placeholder', "");
|
||||
$modal.find('button[data-action=add]')
|
||||
.prop('disabled', false).removeClass('disabled');
|
||||
}
|
||||
|
@ -134,7 +159,7 @@
|
|||
.prop('disabled', true).addClass('disabled');
|
||||
}
|
||||
var candidate = this.$el.find('input[name=seo_page_keywords]').val();
|
||||
var word = website.seo.cleanupKeyword(candidate);
|
||||
var word = cleanupKeyword(candidate);
|
||||
if (word && !this.isKeywordListFull() && !this.isExistingKeyword(word)) {
|
||||
new website.seo.Keyword(this, {
|
||||
keyword: word,
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="website.editorbar">
|
||||
<t t-jquery="#website-top-view" t-operation="after">
|
||||
<div class="navbar-inner" id="website-top-edit">
|
||||
<form class="navbar-form pull-left">
|
||||
<button data-action="save" class="btn btn-primary">Save</button>
|
||||
<button data-action="cancel" class="btn">Cancel</button>
|
||||
</form>
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li class="navbar-form"><button data-action="snippet" class="btn btn-primary">Building Blocks</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="website.editor.dialog.link">
|
||||
<div class="modal hide" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Link to:</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item active">
|
||||
<h3 class="list-group-item-heading">Page on Your Website</h3>
|
||||
<select class="form-control pages url-source"/>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h3 class="list-group-item-heading pull-left">Website URL</h3>
|
||||
<div class="pull-right">
|
||||
<label>
|
||||
<input type="checkbox" class="window-new"/>
|
||||
Open in new window
|
||||
</label>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control url url-source"
|
||||
placeholder="http://openerp.com"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h3 class="list-group-item-heading">Email Address</h3>
|
||||
<input type="email" class="form-control email-address url-source"
|
||||
placeholder="you@yourwebsite.com"/>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
|
@ -2,36 +2,38 @@
|
|||
<!-- vim:fdl=1:
|
||||
-->
|
||||
<templates id="template" xml:space="preserve">
|
||||
|
||||
<t t-name="website.editorbar">
|
||||
<div class="navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div id="website-top-view">
|
||||
<form class="navbar-form navbar-left">
|
||||
<button data-action="edit" class="btn btn-primary">Edit</button>
|
||||
</form>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a data-action="show-mobile-preview" href="#"><span title="Mobile preview" class="icon-mobile-phone"/></a></li>
|
||||
<li class="divider-vertical"></li>
|
||||
<li><a data-action="promote-current-page" href="#"><span title="Promote page on the web">Promote</span></a></li>
|
||||
<li><a href="#">Translate</a></li>
|
||||
<li class="dropdown">
|
||||
<a id="customize-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">Customize <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1" id="customize-menu">
|
||||
<!-- filled in JS -->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin#action=website.action_module_website">Apps</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="website-top-edit">
|
||||
<form class="navbar-form navbar-left">
|
||||
<button data-action="save" class="btn btn-primary">Save</button>
|
||||
<button data-action="cancel" class="btn">Cancel</button>
|
||||
</form>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><button data-action="snippet" class="btn btn-primary">Building Blocks</button></li>
|
||||
</ul>
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-edit-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<form class="navbar-form navbar-left">
|
||||
<button data-action="edit" class="btn btn-primary">Edit</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse navbar-edit-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a data-action="show-mobile-preview" href="#"><span title="Mobile preview" class="icon-mobile-phone"/></a></li>
|
||||
<li class="divider-vertical"></li>
|
||||
<li><a data-action="promote-current-page" href="#"><span title="Promote page on the web">Promote</span></a></li>
|
||||
<li><a href="#">Translate</a></li>
|
||||
<li class="dropdown">
|
||||
<a id="customize-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">Customize <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu" id="customize-menu">
|
||||
<!-- filled in JS -->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin#action=website.action_module_website">Apps</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
@ -54,44 +56,56 @@
|
|||
<div class="modal hide fade oe_seo_configuration" tabindex="-1" role="dialog" aria-labelledby="js_seo_page_url" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button title="Close" type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Promote your page on the Web</h3>
|
||||
<br/>
|
||||
<span class="js_seo_page_url"></span>
|
||||
<h2>Promote <small class="js_seo_page_url"></small></h2>
|
||||
<h4>Get your page efficiently referenced in Google to attract more visitors with relevant content.</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="control-group">
|
||||
<div class="js_seo_tips" />
|
||||
|
||||
<h3 class="page-header">1. Define keywords <small>describing your page content</small></h3>
|
||||
<div class="control-group form-horizontal oe_seo_keywords_area">
|
||||
<label class="control-label" for="seo_page_keywords">Keyword</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="text" name="seo_page_keywords" data-provide="typeahead" autocomplete="off" maxlength="20" size="24" placeholder=""/>
|
||||
<button data-action="add" class="btn" type="button">Add</button>
|
||||
</div>
|
||||
<div class="container oe_seo_keywords_list js_seo_keywords_list">
|
||||
|
||||
<!-- filled in JS -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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="control-group form-horizontal">
|
||||
<label class="control-label" for="seo_page_title">Title</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="seo_page_title" maxlength="70" size="70"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-group form-horizontal">
|
||||
<label class="control-label" for="seo_page_description">Description</label>
|
||||
<div class="controls">
|
||||
<textarea name="seo_page_description" rows="3" cols="70" size="160"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group oe_seo_keywords_area">
|
||||
<label class="control-label" for="seo_page_keywords">Keywords</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="text" name="seo_page_keywords" data-provide="typeahead" autocomplete="off" maxlength="20" size="24" placeholder="New keyword"/>
|
||||
<button data-action="add" class="btn" type="button">Add</button>
|
||||
</div>
|
||||
<ul class="oe_seo_keywords_list js_seo_keywords_list">
|
||||
<!-- filled in JS -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<hr/>
|
||||
<a data-action="update" href="#" class="btn btn-primary">Update page</a>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.seo_tip">
|
||||
<div t-attf-class="alert alert-#{widget.type}">
|
||||
<button title="Dismiss" type="button" class="close" data-action="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<t t-raw="widget.message"/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.seo_keyword">
|
||||
<li><a href="#" class="oe_remove" data-action="remove-keyword"><i class="icon-trash"/></a> <span class="label js_seo_keyword"><t t-raw="widget.keyword"/></span></li>
|
||||
<div class="oe_seo_keyword"><a href="#" class="oe_remove" data-action="remove-keyword"><i class="icon-trash"/></a> <span class="label js_seo_keyword"><t t-raw="widget.keyword"/></span></div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.carousel">
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<template id="layout">
|
||||
<!DOCTYPE html>
|
||||
<html t-att-data-view-xmlid="__stack__[0]" t-att-data-editable="'1' if editable else '0'">
|
||||
<html t-att-data-editable="'1' if editable else '0'" t-att-data-view-xmlid="str(__stack__[0])">
|
||||
<head>
|
||||
<title><t t-esc="title or res_company.name"/></title>
|
||||
<script type="text/javascript" src="/web/static/lib/underscore/underscore.js"></script>
|
||||
|
@ -56,14 +56,20 @@
|
|||
<div class="navbar navbar-default navbar-static-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-top-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/page/website.homepage"><em>Open</em><b>ERP</b></a>
|
||||
</div>
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav nav-pills navbar-nav navbar-right" id="top_menu">
|
||||
<div class="collapse navbar-collapse navbar-top-collapse">
|
||||
<ul class="nav navbar-nav navbar-right" id="top_menu">
|
||||
<li><a href="/page/website.contactus">Contact us</a></li>
|
||||
<li><a href="/admin">Sign in</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
@ -76,13 +82,13 @@
|
|||
<div class="container" id="footer_container">
|
||||
<div class="row">
|
||||
<div class="col-md-3" name="product">
|
||||
<h5>Our products</h5>
|
||||
<h4>Our products</h4>
|
||||
<ul class="list-unstyled" name="products">
|
||||
<li><a href="/">Home</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-3" name="info">
|
||||
<h5 name="info_title">Connect with us</h5>
|
||||
<h4 name="info_title">Connect with us</h4>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="/page/website.aboutus">About us</a></li>
|
||||
<li><a href="/page/website.contactus">Contact us</a></li>
|
||||
|
@ -93,7 +99,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="col-md-5 col-lg-offset-1" name="about_us">
|
||||
<h5 t-field="res_company.name">About us</h5>
|
||||
<h4 t-field="res_company.name">About us</h4>
|
||||
<p>
|
||||
We are a team of passionated people whose goal is to improve everyone's
|
||||
life through disruptive products. We build great products to solve your
|
||||
|
@ -141,9 +147,8 @@
|
|||
</div>
|
||||
<!-- Carousel items -->
|
||||
<div class="carousel-inner">
|
||||
<div class="item active" style="background-image: url(/website/static/src/img/greenfields.jpg); background-size: cover;">
|
||||
<div class="item active" style="background-image: url(/website/static/src/img/greenfields.jpg); background-size: cover; padding-top: 90px; padding-bottom:45px;">
|
||||
<div class="container">
|
||||
<div class="mt64"></div>
|
||||
<h1>Create Awesome Websites</h1>
|
||||
<h3>Super easy, fully flexible</h3>
|
||||
<a href="/page/website.contactus" class="btn btn-success btn-large mt16">Contact us</a>
|
||||
|
@ -151,8 +156,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- Carousel nav -->
|
||||
<a class="carousel-control left" href="#myCarousel" data-slide="prev" t-ignore="1">&lsaquo;</a>
|
||||
<a class="carousel-control right" href="#myCarousel" data-slide="next" t-ignore="1">&rsaquo;</a>
|
||||
<a class="carousel-control left" href="#myCarousel" data-slide="prev"></a>
|
||||
<a class="carousel-control right" href="#myCarousel" data-slide="next"></a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
@ -160,8 +165,8 @@
|
|||
<section class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<h1 class="mt64">Welcome To Your New Homepage,</h1>
|
||||
<h2 class="mt32 subheader">where <b><em>everything</em></b> can be customized </h2>
|
||||
<h1>Welcome To Your New Homepage,</h1>
|
||||
<h2>where <b>everything</b> can be <em>customized</em></h2>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -310,11 +315,13 @@
|
|||
<t t-raw="res_company.name"></t>
|
||||
</t>
|
||||
<div class="container">
|
||||
<h2>Contact us</h2>
|
||||
<h1>Contact us</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<p>Contact us about anything related to our company or services.</p>
|
||||
<p>We'll do our best to get back to you as soon as possible.</p>
|
||||
<div>
|
||||
<p>Contact us about anything related to our company or services.</p>
|
||||
<p>We'll do our best to get back to you as soon as possible.</p>
|
||||
</div>
|
||||
<div class="text-center mt64" name="mail_button">
|
||||
<a t-att-href="'mailto:'+res_company.email" class="btn btn-primary">Send us an email</a>
|
||||
</div>
|
||||
|
@ -359,7 +366,9 @@
|
|||
|
||||
<template id="pager">
|
||||
<ul t-if="pager['page_count'] > 1" t-attf-class="#{ classname or '' } pagination">
|
||||
<li t-att-class=" 'disabled' if pager['page']['num'] == 1 else '' "> <a t-att-href=" pager['page_start']['url'] if pager['page']['num'] != 1 else '' ">Prev</a></li>
|
||||
<li t-att-class=" 'disabled' if pager['page']['num'] == 1 else '' ">
|
||||
<a t-att-href=" pager['page_start']['url'] if pager['page']['num'] != 1 else '' ">Prev</a>
|
||||
</li>
|
||||
<t t-foreach="pager['pages']" t-as="page">
|
||||
<li t-att-class=" 'active' if page['num'] == pager['page']['num'] else '' "> <a t-att-href="page['url']" t-raw="page['num']"></a></li>
|
||||
</t>
|
||||
|
@ -465,17 +474,17 @@
|
|||
|
||||
|
||||
<template id="kanban">
|
||||
<t t-set="step"><t t-esc="step or 0"></t></t>
|
||||
<t t-set="scope"><t t-esc="scope or 0"></t></t>
|
||||
<t t-set="orderby"><t t-esc="orderby or 'name'"></t></t>
|
||||
<t t-raw="snipped['kanban'](model, domain, column, template, step=step, scope=scope, orderby=orderby)"></t>
|
||||
<t t-set="step"><t t-esc="step or 0"/></t>
|
||||
<t t-set="scope"><t t-esc="scope or 0"/></t>
|
||||
<t t-set="orderby"><t t-esc="orderby or 'name'"/></t>
|
||||
<t t-raw="snipped['kanban'](model, domain, column, template, step=step, scope=scope, orderby=orderby)"/>
|
||||
</template>
|
||||
|
||||
<template id="kanban_contain">
|
||||
<table class="table js_kanban">
|
||||
<thead>
|
||||
<tr>
|
||||
<t t-set="width" t-value="str(round(100.0 / len(objects), 2)) + '%'"></t>
|
||||
<t t-set="width" t-value="str(round(100.0 / len(objects), 2)) + '%'"/>
|
||||
<t t-foreach="objects">
|
||||
<th t-att-width="width">
|
||||
<div t-field="column_id.name" class="text-center"></div>
|
||||
|
|
|
@ -27,14 +27,14 @@
|
|||
<template id="index" name="References">
|
||||
<t t-call="website_contract.layout">
|
||||
<t t-set="ref_content">
|
||||
<h1 class="col-md-12 text-center">Trusted by millions worldwide</h1>
|
||||
<h2 class="col-md-12 text-center">Our public references</h2>
|
||||
<h1 class="col-md-12 text-center">Customer References</h1>
|
||||
<h2 class="col-md-12 text-center">Trusted by millions worldwide</h2>
|
||||
<div class="col-md-12" id="ref_content">
|
||||
<div class="navbar navbar-inverse">
|
||||
<div class="navbar-collapse">
|
||||
<t t-call="website.pager">
|
||||
<t t-set="classname">pull-left</t>
|
||||
</t>
|
||||
<div class="navbar navbar-inverse">
|
||||
<div class="navbar-collapse">
|
||||
<t t-call="website.pager">
|
||||
<t t-set="classname">pull-left</t>
|
||||
</t>
|
||||
<form action="/references/" method="get" class="navbar-search pull-right pagination">
|
||||
<div class="col-md-10">
|
||||
<div class="col-md-5">
|
||||
|
@ -52,9 +52,9 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div t-foreach="partner_ids" t-as="partner" class="media thumbnail">
|
||||
<a class="pull-left" t-attf-href="/references/#{ partner.id }/">
|
||||
|
@ -62,7 +62,7 @@
|
|||
</a>
|
||||
<div class="media-body">
|
||||
<t t-call="website.publish"><t t-set="object" t-value="partner"/></t>
|
||||
<a class="media-heading" t-attf-href="/references/#{ partner.id }/"><small t-field="partner.parent_id"/> <small t-field="partner.name"/></a>
|
||||
<a class="media-heading" t-attf-href="/references/#{ partner.id }/"><span t-field="partner.parent_id"/> <span t-field="partner.name"/></a>
|
||||
<div t-field="partner.website_short_description"/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,41 +4,40 @@
|
|||
|
||||
<template id="contactus_form" name="Contact Form" inherit_id="website.contactus" inherit_option_id="website.contactus">
|
||||
<xpath expr="//div[@name='mail_button']" position="replace">
|
||||
<form action="/crm/contactus" method="post" class="form-horizontal" >
|
||||
<form action="/crm/contactus" method="post" class="form-horizontal mt32" >
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label" for="contact_name">Name</label>
|
||||
<div class="col-lg-4">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="contact_name">Your Name</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<input type="text" class="form-control" name="contact_name" required="True" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label" for="phone">Phone number</label>
|
||||
<div class="col-lg-4">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="phone">Phone Number</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<input type="text" class="form-control" name="phone" required="True" placeholder="e.g. (+32).81.81.37.00"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label" for="email_from">Email</label>
|
||||
<div class="col-lg-4">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="email_from">Email</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<input type="email" class="form-control" name="email_from" required="True" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label" for="name">Subject</label>
|
||||
<div class="col-lg-4">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="name">Subject</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<input type="text" class="form-control" name="name" required="True"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label" for="description">Your Question</label>
|
||||
<div class="col-lg-4">
|
||||
<textarea class="form-control" name="description"/>
|
||||
<label class="col-md-3 col-sm-4 control-label" for="description">Your Question</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<textarea class="form-control" name="description" style="min-height: 120px"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-default">Send</button>
|
||||
<div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
|
||||
<button class="btn btn-primary btn-lg">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -49,7 +48,7 @@
|
|||
<t t-call="website.layout">
|
||||
<t t-set="title">Message Sent</t>
|
||||
<div class="container">
|
||||
<div class="alert alert-warning">
|
||||
<div class="alert alert-success">
|
||||
Your message has been sent successfully.
|
||||
<button type="button" class="close" data-dismiss="alert">&times;</button>
|
||||
</div>
|
||||
|
|
|
@ -51,7 +51,8 @@ class website_crm_partner_assign(http.Controller):
|
|||
|
||||
step = 20
|
||||
pager = website.pager(url="/partners/", total=len(partner_ids), page=page, step=step, scope=7, url_args=post)
|
||||
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [('id', 'in', partner_ids)], limit=step, offset=pager['offset'])
|
||||
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [('id', 'in', partner_ids)],
|
||||
limit=step, offset=pager['offset'], order="grade_id ASC,partner_weight DESC")
|
||||
|
||||
|
||||
values = website.get_rendering_context({
|
||||
|
|
|
@ -27,14 +27,13 @@
|
|||
<template id="index" name="Partners">
|
||||
<t t-call="website_crm_partner_assign.layout">
|
||||
<t t-set="ref_content">
|
||||
<h1 class="span12 text-center">Want services on OpenERP?</h1>
|
||||
<h2 class="span12 text-center">Contact a local partner</h2>
|
||||
<h1 class="span12 text-center">
|
||||
Want services on OpenERP?<br/>
|
||||
<small>Contact a local partner</small>
|
||||
</h1>
|
||||
<div class="span12" id="ref_content">
|
||||
<div class='navbar navbar-inverse'>
|
||||
<div class='navbar'>
|
||||
<div class='navbar-inner'>
|
||||
<t t-call="website.pager" >
|
||||
<t t-set="classname">pull-left</t>
|
||||
</t>
|
||||
<form action="/partners/" method="get" class="navbar-search pull-right pagination">
|
||||
<input type="text" name="search" class="search-query span2 mt4" placeholder="Search" t-att-value="searches.get('search') or '' or ''"/>
|
||||
<select class="search-query span2 mt4" name="country" t-if="len(countries) > 1" onchange="submit()">
|
||||
|
@ -59,16 +58,22 @@
|
|||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div t-foreach="partner_ids" t-as="partner" class="media thumbnail">
|
||||
<a class="pull-left" t-attf-href="/partners/#{ partner.id }/">
|
||||
<img class="media-object" t-att-src="partner.img('image_small')"/>
|
||||
</a>
|
||||
<div class="media-body">
|
||||
<t t-call="website.publish"><t t-set="object" t-value="partner"/></t>
|
||||
<a class="media-heading" t-attf-href="/partners/#{ partner.id }/"><small t-field="partner.parent_id"/> <small t-field="partner.name"/></a>
|
||||
<div t-field="partner.website_short_description"/>
|
||||
<t t-foreach="partner_ids" t-as="partner">
|
||||
<t t-if="grade_id != partner.grade_id.id">
|
||||
<t t-set="grade_id" t-value="partner.grade_id.id"/>
|
||||
<h3 class="text-center well"><span t-field="partner.grade_id"/> Partners</h3>
|
||||
</t>
|
||||
<div class="media thumbnail">
|
||||
<a class="pull-left" t-attf-href="/partners/#{ partner.id }/">
|
||||
<img class="media-object" t-att-src="partner.img('image_small')"/>
|
||||
</a>
|
||||
<div class="media-body">
|
||||
<t t-call="website.publish"><t t-set="object" t-value="partner"/></t>
|
||||
<a class="media-heading" t-attf-href="/partners/#{ partner.id }/"><span t-field="partner.parent_id"/> <span t-field="partner.name"/></a> - <span t-field="partner.grade_id"/>
|
||||
<div t-field="partner.website_short_description"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
|
|
@ -11,3 +11,10 @@ class res_partner(osv.osv):
|
|||
|
||||
def img(self, cr, uid, ids, field='image_small', context=None):
|
||||
return "/website/image?model=%s&field=%s&id=%s" % (self._name, field, ids[0])
|
||||
|
||||
|
||||
class res_partner_grade(osv.osv):
|
||||
_inherit = 'res.partner.grade'
|
||||
_columns = {
|
||||
'website_description': fields.html('Description for the website'),
|
||||
}
|
|
@ -17,5 +17,6 @@ OpenERP Blog
|
|||
'security/website_event.xml',
|
||||
],
|
||||
'qweb': ['static/src/xml/*.xml'],
|
||||
'demo': ['event_demo.xml'],
|
||||
'installable': True,
|
||||
}
|
||||
|
|
|
@ -11,6 +11,16 @@ class product(osv.osv):
|
|||
}
|
||||
|
||||
|
||||
class event(osv.osv):
|
||||
_inherit = 'event.event'
|
||||
_columns = {
|
||||
'website_published': fields.boolean('Available in the website'),
|
||||
'description_website': fields.html('Description for the website'),
|
||||
}
|
||||
_defaults = {
|
||||
'website_published': True
|
||||
}
|
||||
|
||||
class event_event(osv.osv):
|
||||
_inherit = "event.event"
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-8 navbar navbar-inverse">
|
||||
<div class="col-md-8 navbar navbar-default">
|
||||
<div class='navbar-inner'>
|
||||
<t t-call="website.pager" >
|
||||
<t t-set="classname">pull-left</t>
|
||||
|
@ -67,8 +67,8 @@
|
|||
<t t-call="website.publish"><t t-set="object" t-value="event"/></t>
|
||||
<div>
|
||||
<span t-field="event.type">: </span>
|
||||
<t t-if="event.user_id">
|
||||
Organized by: <span t-field="event.user_id"> </span>
|
||||
<t t-if="event.organizer_id">
|
||||
Organized by: <span t-field="event.organizer_id"> </span>
|
||||
</t>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -132,7 +132,7 @@
|
|||
<pre t-field="event_id.address_id"/>
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_begin"> </span><br/>
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_end"> </span>
|
||||
<t t-if="event_id.user_id">
|
||||
<t t-if="event_id.organizer_id">
|
||||
<h6>Organized by:</h6>
|
||||
<pre><t t-field="event_id.organizer_id"/><br/><span>&#x2706;</span> <span t-field="event_id.phone"></span><br/><i class="icon-envelope"></i> <span t-field="event_id.email"></span></pre>
|
||||
</t>
|
||||
|
@ -165,7 +165,7 @@ t-attf-class="label label-default pull-right label-#{ event_id.register_avail &l
|
|||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ticket type</th>
|
||||
<th>Ticket</th>
|
||||
<th>Sales End</th>
|
||||
<th>Price</th>
|
||||
<th>Seats</th>
|
||||
|
@ -174,7 +174,7 @@ t-attf-class="label label-default pull-right label-#{ event_id.register_avail &l
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="event_id.event_ticket_ids" t-as="ticket">
|
||||
<td t-field="ticket.product_id"/>
|
||||
<td t-field="ticket.name"/>
|
||||
<td t-field="ticket.deadline"/>
|
||||
<td t-field="ticket.price"/>
|
||||
<td><span t-if="ticket.register_max"><t t-esc="ticket.register_current"/>/<t t-field="ticket.register_max"/></span></td>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<t t-set="title">Shop - <t t-raw="title">Categories</t></t>
|
||||
<div class="container mt48 oe_website_sale">
|
||||
<div class="container oe_website_sale">
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="shop_content">
|
||||
<t t-raw="shop_content" />
|
||||
|
@ -97,22 +97,19 @@
|
|||
<t t-call="website_sale.layout">
|
||||
<t t-set="title">Product</t>
|
||||
<t t-set="shop_content">
|
||||
<div class='navbar navbar-inverse' role='navigation'>
|
||||
<div class="navbar-collapse">
|
||||
<t t-call="website.pager" >
|
||||
<t t-set="classname">pull-left</t>
|
||||
</t>
|
||||
<form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="navbar-search pull-right pagination">
|
||||
<input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search" t-att-value="search or '' or ''"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<t t-call="website.pager">
|
||||
<t t-set="classname">pull-left</t>
|
||||
</t>
|
||||
<form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right pagination">
|
||||
<input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search" t-att-value="search or '' or ''"/>
|
||||
</form>
|
||||
<div class="clearfix"/>
|
||||
<div class='row grid grid-align-top'>
|
||||
<t t-foreach="products" t-as="product">
|
||||
<div t-attf-class="col-md-2 mb16 thumbnail text-center #{not product.website_published and 'alert alert-warning' or ''}" style="width: 170px; margin-left: 16px;">
|
||||
<a t-attf-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&category_id=%s' % category_id) or ''}">
|
||||
<h5 t-field="product.name"> </h5>
|
||||
<img class="img-rounded" t-att-src="product.img('image_small')" />
|
||||
<img class="img-rounded" t-att-src="product.img('image_small')"/>
|
||||
</a>
|
||||
<div>
|
||||
<div t-field="product.description_sale"></div>
|
||||
|
@ -142,24 +139,22 @@
|
|||
<t t-call="website_sale.layout">
|
||||
<t t-set="title">Product</t>
|
||||
<t t-set="shop_content">
|
||||
<nav class='navbar navbar-inverse' role='navigation'>
|
||||
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
||||
<form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="navbar-search pull-right pagination">
|
||||
<input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search" t-att-value="search or '' or ''"/>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right">
|
||||
<input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search..." t-att-value="search or '' or ''"/>
|
||||
</form>
|
||||
<div class="clearfix"/>
|
||||
<div id="product_detail">
|
||||
<t t-call="website.publish"><t t-set="object" t-value="product"/></t>
|
||||
<h2 t-field="product.name"></h2>
|
||||
<h1 t-field="product.name"></h1>
|
||||
<a t-if="not product.product_variant_ids" t-attf-href="./add_cart/#{ product.id }/" class="btn btn-default btn-sm btn-success pull-right">Add to cart</a>
|
||||
<form t-if="len(product.product_variant_ids) > 1" action="./add_cart/" class="pull-right">
|
||||
<label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
|
||||
<input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None" />
|
||||
<input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
|
||||
<t t-esc="product.variants or ''">Standard</t>
|
||||
<span class="badge" t-if="product.price_extra"><t t-esc="product.price_extra > 0 and '+' or ''"/><t t-esc="product.price_extra"/> €</span>
|
||||
</label><br/>
|
||||
<button class="btn btn-default btn-sm btn-success">Add to cart</button>
|
||||
<button class="btn btn-sm btn-success">Add to cart</button>
|
||||
</form>
|
||||
<img class="media-object img-responsive" t-att-src="product.img('image_medium')"/>
|
||||
<div t-field="product.website_description"></div>
|
||||
|
@ -178,16 +173,16 @@
|
|||
<div class="well mt32" t-if="product.recommended_products()">
|
||||
<h4>Customers who have bought this item also bought</h4>
|
||||
<div class='row mt16' style="margin-left: 15px !important;">
|
||||
<t t-foreach="product.recommended_products()" t-as="product">
|
||||
<div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
|
||||
<a t-attf-href="/shop/product/#{ product.id }/">
|
||||
<div class='mt16 text-center'>
|
||||
<img t-att-src="product.img('image_small')"/>
|
||||
<h5 t-field='product.name'></h5>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</t>
|
||||
<t t-foreach="product.recommended_products()" t-as="product">
|
||||
<div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
|
||||
<a t-attf-href="/shop/product/#{ product.id }/">
|
||||
<div class='mt16 text-center'>
|
||||
<img t-att-src="product.img('image_small')"/>
|
||||
<h5 t-field='product.name'></h5>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
|
@ -200,7 +195,7 @@
|
|||
<t t-set="title">My cart</t>
|
||||
<t t-set="shop_content">
|
||||
<div class="col-md-12 oe_mycart">
|
||||
<h2>My Shopping Cart</h2>
|
||||
<h1>My Shopping Cart</h1>
|
||||
<table class='table' id="mycart_products">
|
||||
<colgroup>
|
||||
<col width="80"/>
|
||||
|
@ -233,7 +228,7 @@
|
|||
<span t-field="line.price_unit"></span> €
|
||||
</td>
|
||||
<td>
|
||||
<div class="mb8 mt8 pull-right">
|
||||
<div class="pull-right">
|
||||
<input type="text" class="js_quantity input-sm col-md-5" t-att-data-id="line.product_id.id" t-att-value="line.product_uom_qty"/>
|
||||
<a t-attf-href="./remove_cart/#{ line.product_id.id }/" class="btn btn-default mb8 btn-sm btn-inverse">-</a>
|
||||
<a t-attf-href="./add_cart/#{ line.product_id.id }/" class="btn btn-default mb8 btn-sm btn-success">+</a>
|
||||
|
@ -256,7 +251,7 @@
|
|||
<tr> <th colspan="3"><h4>Total</h4></th> <th><h4><t t-esc="order and order.amount_total or 0"/> €</h4></th></tr>
|
||||
</thead>
|
||||
</table>
|
||||
<a t-if="order and order.order_line" href="/shop/checkout/" class="btn btn-default btn-success">Proceed To Payment</a>
|
||||
<a t-if="order and order.order_line" href="/shop/checkout/" class="btn btn-success">Proceed To Payment</a>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
@ -286,7 +281,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<div class="pull-right">
|
||||
<a t-attf-href="./add_cart/#{ product.id }/" class="btn btn-default btn-sm btn-success">+</a>
|
||||
<a t-attf-href="./add_cart/#{ product.id }/" class="btn btn-sm btn-success">+</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -333,7 +328,7 @@
|
|||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<t t-set="title">Shop - Checkout</t>
|
||||
<div class="container mt48 oe_website_sale">
|
||||
<div class="container oe_website_sale">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<table class="table table-condensed">
|
||||
|
@ -362,13 +357,12 @@
|
|||
</div>
|
||||
<form class="col-md-8 form-horizontal" action="/shop/confirm_order/" method="post">
|
||||
<div class=" row">
|
||||
<a t-if="not partner" t-attf-href="/admin#action=redirect&url=#{ host_url }/shop/checkout/" class="btn btn-default btn-primary">Log me, I have an account</a><br/>
|
||||
<a t-if="not partner" t-attf-href="/admin#action=redirect&url=#{ host_url }/shop/checkout/" class="btn btn-primary">Log me, I have an account</a>
|
||||
<h3 class="col-md-10">Billing Information</h3>
|
||||
<div t-attf-class="form-group #{error.get('name', '')}">
|
||||
<label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
|
||||
<div class="col-lg-4">
|
||||
<input type="text" name="name" class="form-control" t-att-value="checkout.get('name', '')"
|
||||
/>
|
||||
<input type="text" name="name" class="form-control" t-att-value="checkout.get('name', '')"/>
|
||||
</div>
|
||||
</div>
|
||||
<div t-attf-class="form-group #{error.get('phone', '')}">
|
||||
|
@ -444,7 +438,7 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div><br/>
|
||||
</div>
|
||||
<div class="js_shipping row" t-att-style="not shipping and 'display:none' or ''">
|
||||
<h3 class="col-md-12 oe_shipping">Shipping Information</h3>
|
||||
<div t-attf-class="form-group #{error.get('shipping_name', '')}">
|
||||
|
@ -520,7 +514,7 @@
|
|||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<t t-set="title">Shop - Payment</t>
|
||||
<div class="container mt48 oe_website_sale">
|
||||
<div class="container oe_website_sale">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<table class="table table-condensed" t-if="order">
|
||||
|
|
Loading…
Reference in New Issue