[IMP] website_mail: author
bzr revid: chm@openerp.com-20130919141958-0qfx01nfidr4zq5i
This commit is contained in:
@@ -27,6 +27,7 @@ class website_mail(http.Controller):
|
||||
'nav_list': dict(),
|
||||
'mail_group_id': mail_group_id,
|
||||
'subscribe': post.get('subscribe'),
|
||||
'unable_editor': post.get('unable_editor')
|
||||
}
|
||||
|
||||
if not request.context['is_public_user'] and mail_group_id:
|
||||
@@ -92,7 +93,7 @@ class website_mail(http.Controller):
|
||||
type='comment',
|
||||
subtype='mt_comment',
|
||||
context=dict(request.context, mail_create_nosubscribe=True))
|
||||
return werkzeug.utils.redirect("/blog/%s/%s/" % (mail_group_id, blog_id))
|
||||
return werkzeug.utils.redirect("/blog/%s/%s/?unable_editor=1" % (mail_group_id, blog_id))
|
||||
|
||||
@website.route(['/blog/<int:mail_group_id>/subscribe', '/blog/<int:mail_group_id>/<int:blog_id>/subscribe'], type='http', auth="public")
|
||||
def subscribe(self, mail_group_id=None, blog_id=None, **post):
|
||||
|
||||
@@ -56,11 +56,10 @@
|
||||
<h3 t-field="blog_id.subject"/>
|
||||
<div t-field="blog_id.body"/>
|
||||
<small class="pull-right muted text-right">
|
||||
<div t-field="blog_id.author_id"/>
|
||||
<div t-field="blog_id.date"/>
|
||||
</small>
|
||||
</div>
|
||||
<ul class="media-list" id="comment">
|
||||
<ul class="media-list" id="comment" t-if="not unable_editor">
|
||||
<li t-foreach="blog_id.child_ids" t-as="comment" class="media">
|
||||
<div class="media-body">
|
||||
<t t-call="website.publish"><t t-set="object" t-value="comment"/></t>
|
||||
@@ -72,7 +71,7 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<form id="post" t-attf-action="/blog/#{ blog_id.res_id }/#{ blog_id.id }/post#post" method="POST" class="form-horizontal text-center" groups="group_website_mail_reply">
|
||||
<form id="post" t-if="not unable_editor" t-attf-action="/blog/#{ blog_id.res_id }/#{ blog_id.id }/post#post" method="POST" class="form-horizontal text-center" groups="group_website_mail_reply">
|
||||
<textarea rows="4" placeholder="Your comment" class="col-md-7 form-control"></textarea>
|
||||
<button type="submit" class="btn btn-default">Post your comment</button>
|
||||
</form>
|
||||
@@ -92,7 +91,6 @@
|
||||
<a t-if="len(blog.child_ids) > 1" t-attf-href="/blog/#{ blog.res_id }/#{ blog.id }#comment"><t t-esc="len(blog.child_ids)"/> Comments</a>
|
||||
</small>
|
||||
<small class="pull-right muted text-right">
|
||||
<div t-field="blog.author_id"/>
|
||||
<div t-field="blog.date"/>
|
||||
</small>
|
||||
</div>
|
||||
@@ -109,6 +107,15 @@
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="blog_author" inherit_id="website_mail.index" inherit_option_id="website_mail.index" name="Author">
|
||||
<xpath expr="//div[@t-field='blog_id.date']" position="before">
|
||||
<div t-field="blog_id.author_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@t-field='blog.date']" position="before">
|
||||
<div t-field="blog.author_id"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="blog_history" inherit_id="website_mail.index" inherit_option_id="website_mail.index" name="History">
|
||||
<xpath expr="//div[@id='left_column']" position="inside">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
|
||||
Reference in New Issue
Block a user