[REN] : 'Inline Discussion' to 'Allow comment in text'

'Allow Comments' to 'Allow blog post comment'
[IMP] :Inline discussion alone shouldn't post gloabl comments

bzr revid: aja@tinyerp.com-20140313111452-whhtar6wlozjd70z
This commit is contained in:
ajay javiya (OpenERP) 2014-03-13 16:44:52 +05:30
parent 217d0bea68
commit 9ae66300dd
4 changed files with 13 additions and 5 deletions

View File

@ -309,7 +309,7 @@ class WebsiteBlog(http.Controller):
new_blog_post_id = request.registry['blog.post'].copy(cr, uid, blog_post_id, {}, context=create_context)
return werkzeug.utils.redirect("/blogpost/%s/?enable_editor=1" % new_blog_post_id)
@http.route('/blogpost/get_discussion', type='json', auth="public", website=True)
@http.route('/blogpost/get_discussion/', type='json', auth="public", website=True)
def discussion(self, post_id=0, discussion=None, **post):
mail_obj = request.registry.get('mail.message')
values = []
@ -334,7 +334,7 @@ class WebsiteBlog(http.Controller):
@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'])
inherit_options = request.registry.get('ir.ui.view').search_read(request.cr, SUPERUSER_ID, [('name','in',['Allow comment in text','Select to Tweet'])], ['inherit_id','name'])
for options in inherit_options:
values[options.get('name')] = options.get('inherit_id')
return values

View File

@ -91,6 +91,14 @@ class BlogPost(osv.Model):
'website_published_datetime': fields.datetime(
'Publish Date'
),
'website_message_ids': fields.one2many(
'mail.message', 'res_id',
domain=lambda self: [
'&', '&', ('model', '=', self._name), ('type', '=', 'comment') , ('discussion', '=', False)
],
string='Website Messages',
help="Website communication history",
),
'history_ids': fields.one2many(
'blog.post.history', 'post_id',
'History', help='Last post modifications',

View File

@ -31,7 +31,7 @@ $(document).ready(function() {
//check custome options inline discussion and select to tweet(share) are checked.
openerp.jsonRpc("/blogpsot/get_custom_options", 'call', {}).then(function(res){
discussion = res['Inline Discussion'];
discussion = res['Allow comment in text'];
share = res['Select to Tweet'];
var content = $("#blog_content p");
if(content.length && discussion){

View File

@ -258,7 +258,7 @@
</template>
<!-- Options: Blog Post: user can reply -->
<template id="opt_blog_post_complete_comment" name="Allow Comments"
<template id="opt_blog_post_complete_comment" name="Allow blog post comment"
inherit_option_id="website_blog.blog_post_complete"
groups="website_mail.group_comment">
<xpath expr="//ul[@id='comments-list']" position="before">
@ -282,7 +282,7 @@
</template>
<!-- Options: Blog Post: user can add Inline Discussion -->
<template id="opt_blog_post_inline_discussion" name="Inline Discussion"
<template id="opt_blog_post_inline_discussion" name="Allow comment in text"
inherit_option_id="website_blog.blog_post_complete"
groups="website_mail.group_comment">
</template>