136 lines
7.6 KiB
XML
136 lines
7.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data>
|
|
|
|
<!-- Mail group for the company's news -->
|
|
|
|
<record id="website_mail_blog" model="mail.group">
|
|
<field name="name">News</field>
|
|
<field name="public">public</field>
|
|
<field name="description">News displayed on your website</field>
|
|
</record>
|
|
|
|
<!-- Layout add nav and footer -->
|
|
|
|
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
|
|
<xpath expr="//body/header//ul[@id='top_menu']/li[last()]" position="before">
|
|
<li><a href="/blog/%(website_mail.website_mail_blog)d/">News</a></li>
|
|
</xpath>
|
|
<xpath expr="//body/footer//h5[@name='info_title']" position="after">
|
|
<ul class='unstyled'>
|
|
<li><a href="/blog/%(website_mail.website_mail_blog)d/">News</a></li>
|
|
</ul>
|
|
</xpath>
|
|
</template>
|
|
|
|
<!-- Page -->
|
|
|
|
<template id="index" name="Blogs">
|
|
<t t-call="website.layout">
|
|
<t t-set="head">
|
|
<script type="text/javascript" src="/website_mail/static/src/js/blog.js"></script>
|
|
<link rel='stylesheet' href='/website_mail/static/src/css/blog.css'/>
|
|
<t t-raw="head or ''"/>
|
|
</t>
|
|
<t t-set="title">Blog</t>
|
|
<div class="container mt48 js_website_mail">
|
|
<div class="row">
|
|
<div class="span4" id="left_column">
|
|
<a t-if="mail_group_id and editable" t-att-href="'/blog/%%s/new' %% mail_group_id" class="btn">Add a new Blog</a>
|
|
|
|
<div id="blog_subscribe">
|
|
<form action="./subscribe" method="POST" class="form-inline" t-if="not subscribe">
|
|
<input placeholder="Email Address" type="email" name="email" class="input-medium" t-if="is_public_user"/>
|
|
<button type="submit" class="btn btn-primary" name="subscribe">Subscribe</button>
|
|
</form>
|
|
<form action="./unsubscribe" method="POST" class="form-inline" t-if="subscribe">
|
|
<input type="hidden" name="email" t-att-value="subscribe"/>
|
|
<button type="submit" class="btn" name="unsubscribe">Unsubscribe</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="span8" t-if="blog_id">
|
|
<div class="media">
|
|
<div class="media-body well">
|
|
<t t-call="website.publish"><t t-set="object" t-value="blog_id"/></t>
|
|
<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">
|
|
<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>
|
|
<t t-raw="comment.body"/>
|
|
<small class="pull-right muted text-right">
|
|
<div t-field="comment.author_id"/>
|
|
<div t-field="comment.date"/>
|
|
</small>
|
|
</div>
|
|
</li>
|
|
<form id="post" t-att-action="'/blog/%%s/%%s/post#post' %% (blog_id.res_id, blog_id.id)" method="POST" class="form-horizontal text-center" groups="group_website_mail_reply">
|
|
<textarea rows="4" placeholder="Your comment" class="span7"> </textarea>
|
|
<button type="submit" class="btn">Post your comment</button>
|
|
</form>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="span8" t-if="not blog_id and blog_ids">
|
|
<ul class="media-list">
|
|
<li t-foreach="blog_ids" t-as="blog" class="media well">
|
|
<div t-att-class="'media-body %%s' %% (blog.website_published and 'css_published' or '')">
|
|
<t t-call="website.publish"><t t-set="object" t-value="blog"/></t>
|
|
<h4 class="media-heading" ><a t-att-href="'/blog/%%s/%%s#comment' %% (blog.res_id, blog.id)" t-field="blog.subject"></a></h4>
|
|
<div class="media">
|
|
<div t-field="blog.body"/>
|
|
<small class="pull-left muted text-right" t-if="len(blog.child_ids)">
|
|
<a t-if="len(blog.child_ids) <= 1" t-att-href="'/blog/%%s/%%s#comment' %% (blog.res_id, blog.id)"><t t-esc="len(blog.child_ids)"/> Comment</a>
|
|
<a t-if="len(blog.child_ids) > 1" t-att-href="'/blog/%%s/%%s#comment' %% (blog.res_id, blog.id)"><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>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<ul class="pager">
|
|
<li t-if="next_date" class="previous">
|
|
<a t-att-href="'?date=%%s' %% (next_date)">&larr; Older</a>
|
|
</li>
|
|
<li t-if="prev_date" class="next">
|
|
<a t-att-href="'?date=%%s' %% (prev_date)">Newer &rarr;</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</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-list">
|
|
<li class="nav-header"><a t-att-href="'/blog/%%s/' %% mail_group_id">BLOG ARCHIVE</a></li>
|
|
<!-- TODO: check qweb iteration -->
|
|
<li t-foreach="nav_list" t-as="year" class="js_nav_year">
|
|
<t t-set="year" t-value="nav_list[year]"/>
|
|
<a href="#"><t t-esc="year['name']"/> <small>(<t t-esc="year['date_count']"/>)</small></a>
|
|
<ul class="nav nav-list css_nav_month">
|
|
<t t-foreach="year['months']">
|
|
<li class="js_nav_month"><a href="#" t-att-data-domain="__domain"><t t-esc="date"/> <small>(<t t-esc="date_count"/>)</small></a>
|
|
<ul class="nav nav-list"/>
|
|
</li>
|
|
</t>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</xpath>
|
|
</template>
|
|
</data>
|
|
</openerp>
|