[IMP] website_hr: begin
bzr revid: chm@openerp.com-20130731135434-am7nqltt16riikxa
This commit is contained in:
parent
81ab06dd80
commit
5950ebdd23
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
'name': 'Contact Form',
|
||||
'name': 'Website Contact Form',
|
||||
'category': 'CRM',
|
||||
'version': '1.0',
|
||||
'description': """
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import controllers
|
||||
import hr
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
'name': 'Website Team',
|
||||
'category': 'mail',
|
||||
'version': '1.0',
|
||||
'description': """
|
||||
OpenERP Blog
|
||||
============
|
||||
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['website', 'hr'],
|
||||
'data': [
|
||||
'views/website_hr.xml',
|
||||
],
|
||||
'qweb': ['static/src/xml/*.xml'],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
import main
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website import website
|
||||
|
||||
class website_hr(website):
|
||||
|
||||
@website.route(['/team'], type='http', auth="admin")
|
||||
def blog(self, cr, uid, **post):
|
||||
hr_obj = request.registry['hr.employee']
|
||||
|
||||
employee_ids = hr_obj.search(cr, uid, [(1, "=", 1)])
|
||||
values = {
|
||||
'res_company': request.registry['res.company'].browse(cr, uid, 1),
|
||||
'employee_ids': hr_obj.browse(cr, uid, employee_ids),
|
||||
}
|
||||
|
||||
html = self.render(cr, uid, "website_hr.index", values)
|
||||
return html
|
|
@ -0,0 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
|
||||
class hr(osv.osv):
|
||||
_inherit = 'hr.employee'
|
||||
_columns = {
|
||||
'website_important': fields.boolean('Publish', help="Publish also on contact form"),
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
sass:
|
||||
sass --compass --trace -t expanded hr.sass hr.css
|
|
@ -0,0 +1 @@
|
|||
@import "compass/css3"
|
|
@ -0,0 +1,3 @@
|
|||
$(document).ready(function () {
|
||||
|
||||
});
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Layout add nav and footer -->
|
||||
|
||||
<record id="footer_hr_mail" model="ir.ui.view">
|
||||
<field name="name">footer_website_hr</field>
|
||||
<field name="inherit_id" ref="website.footer"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//a[@href='/page/website.contactus']" position="after">
|
||||
<li><a href="/team">Team</a></li>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Page -->
|
||||
|
||||
<template id="index">
|
||||
<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"/>
|
||||
</t>
|
||||
<t t-set="title">Team</t>
|
||||
<div class="container mt48">
|
||||
<ul class="media-list">
|
||||
<t t-foreach="employee_ids">
|
||||
<!-- TODO: check qweb iteration -->
|
||||
<li class="media pull-left">
|
||||
<div t-att-class="'media-body %%s' %% (website_important and 'css_important' or '')">
|
||||
<a href="#" t-att-data-id="id" class="js_important pull-right" groups="group_website_mail_manager">
|
||||
<span class="label label-success">Unpublish</span>
|
||||
<span class="label label-important">Publish</span>
|
||||
</a>
|
||||
<t t-raw="image"/>
|
||||
<t t-raw="name"/>
|
||||
</div>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
'name': 'Blog',
|
||||
'name': 'Website Blog',
|
||||
'category': 'mail',
|
||||
'version': '1.0',
|
||||
'description': """
|
||||
|
|
Loading…
Reference in New Issue