values = {'content_image' : image}
ids = post_obj.write(request.cr, SUPERUSER_ID, [int(post_id)], values)
return []
+
+ @http.route('/blogpsot/get_custom_options', type='json', auth="public", website=True)
+ def get_custom_options(self, post_id=0,image=None, **post):
+ values = {}
+ inherit_options = request.registry.get('ir.ui.view').search_read(request.cr, SUPERUSER_ID, [('name','in',['Inline Discussion','Select to Tweet'])], ['inherit_id','name'])
+ for options in inherit_options:
+ values[options.get('name')] = options.get('inherit_id')
+ return values
$(document).ready(function() {
+<<<<<<< TREE
+ var discussion = false;
+ var share = false;
+
+ var def = $.Deferred();
+ openerp.jsonRpc("/blogpsot/get_custom_options", 'call', {
+ }).then(function(res){
+ discussion = res['Inline Discussion']
+ share = res['Select to Tweet']
+ return def.resolve()
+ })
+ def.done( function(){
+ var content = $("#blog_content p");
+ if(content.length && discussion)
+ new openerp.website.blog_discussion({'document_user': $('#is_document_user').length, 'content' : content});
+ if (share) $("p").share();
+ })
+=======
var content = $("#blog_content p");
if(content.length)
new openerp.website.blog_discussion({'content' : content});
+>>>>>>> MERGE-SOURCE
$('.cover_footer').on('click',page_transist);
$('a[href^="#blog_content"]').on('click', animate);
- $("p").share();
+
function page_transist(event) {
event.preventDefault();
var translationValue = $('.cover_footer').get(0).getBoundingClientRect().top;
//bind again it takes control from now on, until page relaod.
$(document).find('.cover_footer').on('click',page_transist);
$(document).find('a[href^="#blog_content"]').on('click', animate);
- var content = $(document).find("#blog_content p");
- if (content)
- new openerp.website.blog_discussion({'content' : content});
- $("p").share();
+ def.done( function(){
+ var content = $(document).find("#blog_content p");
+ if (content && discussion)
+ new openerp.website.blog_discussion({'content' : content});
+ if (share) $("p").share();
+ });
});
if (newLocation != window.location) {
history.pushState(null, null, newLocation);
</xpath>
</template>
+<!-- Options: Blog Post: user can select text for tweet -->
+<template id="opt_blog_post_select_to_tweet" name="Select to Tweet"
+ inherit_option_id="website_blog.blog_post_complete">
+</template>
+
+<!-- Options: Blog Post: user can add Inline Discussion -->
+<template id="opt_blog_post_inline_discussion" name="Inline Discussion"
+ inherit_option_id="website_blog.blog_post_complete"
+ groups="website_mail.group_comment">
+</template>
+
<!-- Page -->
<template id="index" name="Blog Navigation">
<t t-call="website.layout">