2013-11-13 17:14:38 +00:00
|
|
|
(function() {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var website = openerp.website;
|
|
|
|
website.add_template_file('/website_blog/static/src/xml/website_blog.xml');
|
2013-11-14 09:33:05 +00:00
|
|
|
|
|
|
|
website.EditorBar.include({
|
|
|
|
events: _.extend({}, website.EditorBar.prototype.events, {
|
|
|
|
'click a[data-action=new_blog_post]': function (ev) {
|
|
|
|
ev.preventDefault();
|
|
|
|
website.prompt({
|
|
|
|
window_title: "Create a new blog post",
|
|
|
|
select: "Select Blog Category",
|
|
|
|
init: function (field) {
|
|
|
|
return website.session.model('blog.category')
|
|
|
|
.call('name_search', [], { context: website.get_context() });
|
|
|
|
},
|
|
|
|
}).then(function (cat_id) {
|
|
|
|
document.location = '/blog/' + cat_id + '/new';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
});
|
2013-11-13 17:14:38 +00:00
|
|
|
})();
|