[WIP] EVENT: new features required for community days/big events
Manage tracks/talks Allow a dedicated menu per event Allow a blog per event, to announce stuff A "Call for Proposal" page bzr revid: fp@tinyerp.com-20131124185434-hwyluq90e2g4g7tj
This commit is contained in:
parent
056177feea
commit
fb0abe39bc
|
@ -217,6 +217,9 @@ class event_event(osv.osv):
|
|||
'is_subscribed' : fields.function(_subscribe_fnc, type="boolean", string='Subscribed'),
|
||||
'visibility': fields.selection(_visibility_selection, 'Privacy / Visibility',
|
||||
select=True, required=True),
|
||||
'organizer_id': fields.many2one('res.partner', "Organizer"),
|
||||
'phone': fields.related('organizer_id', 'phone', type='char', string='Phone'),
|
||||
'email': fields.related('organizer_id', 'email', type='char', string='Email'),
|
||||
}
|
||||
_defaults = {
|
||||
'state': 'draft',
|
||||
|
|
|
@ -58,11 +58,11 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Events" version="7.0">
|
||||
<header>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
|
||||
<button string="Confirm Event" name="button_confirm" states="draft" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button string="Finish Event" name="button_done" states="confirm" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button string="Set To Draft" name="button_draft" states="cancel,done" type="object" groups="base.group_user"/>
|
||||
<button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object" groups="base.group_user"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_right oe_button_box" groups="base.group_user">
|
||||
|
@ -72,9 +72,10 @@
|
|||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name"/></h1>
|
||||
</div>
|
||||
<group>
|
||||
<group name="main_field_group">
|
||||
<group>
|
||||
<field name="address_id" on_change="on_change_address_id(address_id)" context="{'show_address': 1}" options='{"always_reload": True}'/>
|
||||
<field name="organizer_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group>
|
||||
|
|
|
@ -118,9 +118,6 @@ class event_event(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'event_ticket_ids': fields.one2many('event.event.ticket', "event_id", "Event Ticket"),
|
||||
'organizer_id': fields.many2one('res.partner', "Organizer"),
|
||||
'phone': fields.related('organizer_id', 'phone', type='char', string='Phone'),
|
||||
'email': fields.related('organizer_id', 'email', type='char', string='Email'),
|
||||
'register_max': fields.function(_get_register_max,
|
||||
string='Maximum Registrations',
|
||||
help="The maximum registration level is equal to the sum of the maximum registration of event ticket." +
|
||||
|
|
|
@ -57,9 +57,6 @@
|
|||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
<field name="address_id" position="after">
|
||||
<field name="organizer_id"/>
|
||||
</field>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -306,8 +306,6 @@ class project_issue(osv.Model):
|
|||
}
|
||||
|
||||
def set_priority(self, cr, uid, ids, priority, *args):
|
||||
"""Set lead priority
|
||||
"""
|
||||
return self.write(cr, uid, ids, {'priority' : priority})
|
||||
|
||||
def set_high_priority(self, cr, uid, ids, *args):
|
||||
|
|
|
@ -36,7 +36,7 @@ from openerp import tools
|
|||
import urllib
|
||||
|
||||
class website_event(http.Controller):
|
||||
@website.route(['/event/', '/event/page/<int:page>/'], type='http', auth="public", multilang=True)
|
||||
@website.route(['/event/', '/event/page/<int:page>'], type='http', auth="public", multilang=True)
|
||||
def events(self, page=1, **searches):
|
||||
cr, uid, context = request.cr, request.uid, request.context
|
||||
event_obj = request.registry['event.event']
|
||||
|
@ -163,15 +163,11 @@ class website_event(http.Controller):
|
|||
|
||||
return request.website.render("website_event.index", values)
|
||||
|
||||
@website.route(['/event/<int:event_id>'], type='http', auth="public", multilang=True)
|
||||
def event(self, event_id=None, **post):
|
||||
event_obj = request.registry['event.event']
|
||||
event = event_obj.browse(request.cr, request.uid, event_id, dict(request.context, show_address_only=1))
|
||||
@website.route(['/event/<model("event.event"):event>'], type='http', auth="public", multilang=True)
|
||||
def event(self, event=None, **post):
|
||||
values = {
|
||||
'event_id': event,
|
||||
'main_object': event,
|
||||
'event': event,
|
||||
'range': range,
|
||||
'float': float,
|
||||
}
|
||||
return request.website.render("website_event.event_description_full", values)
|
||||
|
||||
|
|
|
@ -18,20 +18,5 @@
|
|||
<field name="state">open</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_event_twitter_form" model="ir.ui.view">
|
||||
<field name="name">view_event_twitter_form</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='visibility']" position="after">
|
||||
<field name="twitter_hashtag"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -55,9 +55,11 @@ class event(osv.osv):
|
|||
help="Website communication history",
|
||||
),
|
||||
'website_url': fields.function(_website_url, string="Website url"),
|
||||
'show_menu': fields.boolean('Dedicated Menu'),
|
||||
'menu_id': fields.many2one('website.menu', 'Event Menu'),
|
||||
}
|
||||
_defaults = {
|
||||
'website_published': False,
|
||||
'show_menu': False,
|
||||
}
|
||||
|
||||
def google_map_img(self, cr, uid, ids, zoom=8, width=298, height=298, context=None):
|
||||
|
|
|
@ -165,48 +165,61 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="event_description_full">
|
||||
<template id="layout">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="additional_title">Events</t>
|
||||
<div id="wrap">
|
||||
<div class="container">
|
||||
<div class="row mt8">
|
||||
<div class="col-sm-7">
|
||||
<ol class="breadcrumb mb0">
|
||||
<li t-if="not event_id.type"><a href="/event">All Events</a></li>
|
||||
<li t-if="event_id.type">
|
||||
<a t-href="/event?type=#{event_id.type.id}" t-esc="event_id.type.name"/>
|
||||
<div class="col-sm-7" id="event_menu">
|
||||
<ol class="breadcrumb mb0" t-if="not event.menu_id">
|
||||
<li t-if="not event.type"><a href="/event">All Events</a></li>
|
||||
<li t-if="event.type">
|
||||
<a t-href="/event?type=#{event.type.id}" t-esc="event.type.name"/>
|
||||
</li>
|
||||
<li t-if="event_id.country_id">
|
||||
<a t-href="/event?country=#{event_id.country_id.id}" t-esc="event_id.country_id.name"/>
|
||||
<li t-if="event.country_id">
|
||||
<a t-href="/event?country=#{event.country_id.id}" t-esc="event.country_id.name"/>
|
||||
</li>
|
||||
<li class="active">
|
||||
<span t-field="event_id.name"/>
|
||||
<span t-field="event.name"/>
|
||||
</li>
|
||||
</ol>
|
||||
</div><div class="col-sm-5">
|
||||
<ol class="breadcrumb mb0" id="event_menu" t-if="event.menu_id">
|
||||
<t t-foreach="event.menu_id.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu"/>
|
||||
</t>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<t t-call="website.publish_management">
|
||||
<t t-set="object" t-value="event_id"/>
|
||||
<t t-set="object" t-value="event"/>
|
||||
<t t-set="publish_edit" t-value="True"/>
|
||||
<t t-set="publish_controller">/event/publish</t>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<t t-raw="0"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<h1 class="text-center" t-field="event_id.name"></h1>
|
||||
<template id="event_description_full">
|
||||
<t t-call="website_event.layout">
|
||||
<div class="container">
|
||||
<h1 class="text-center" t-field="event.name"></h1>
|
||||
<h4 class="text-center text-muted">
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_begin"/> to
|
||||
<span t-field="event_id.date_end"/>
|
||||
<i class="icon-time"></i> <span t-field="event.date_begin"/> to
|
||||
<span t-field="event.date_end"/>
|
||||
</h4>
|
||||
<h4 t-if="event_id.city and event_id.country_id" class="text-center text-muted">
|
||||
<h4 t-if="event.city and event.country_id" class="text-center text-muted">
|
||||
<i class="icon-map-marker"/>
|
||||
<span t-field="event_id.city"/>,
|
||||
<span t-field="event_id.country_id"/>
|
||||
<span t-field="event.city"/>,
|
||||
<span t-field="event.country_id"/>
|
||||
</h4>
|
||||
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-md-8">
|
||||
<form t-action="/event/#{ event_id.id }/add_cart" method="post" t-if="event_id.event_ticket_ids">
|
||||
<form t-action="/event/#{ event.id }/add_cart" method="post" t-if="event.event_ticket_ids">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -218,7 +231,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="event_id.event_ticket_ids" t-as="ticket">
|
||||
<tr t-foreach="event.event_ticket_ids" t-as="ticket">
|
||||
<td>
|
||||
<div t-field="ticket.name"/>
|
||||
<div><small t-field="ticket.product_id.description_sale"/></div>
|
||||
|
@ -226,7 +239,7 @@
|
|||
<td><span t-field="ticket.deadline"/></td>
|
||||
<td><span t-field="ticket.price"/></td>
|
||||
<td>
|
||||
<span t-if="ticket.register_max and (float(ticket.register_current or 0) / ticket.register_max)<=0.2" class="text-muted">
|
||||
<span t-if="ticket.register_max and ((ticket.register_current or 0)*100 / ticket.register_max)>75" class="text-muted">
|
||||
<t t-esc="ticket.register_max - ticket.register_current"/> <span>left</span>
|
||||
</span>
|
||||
</td>
|
||||
|
@ -239,14 +252,14 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="submit" class="btn btn-primary btn-lg pull-right" t-if="event_id.register_avail">Order Now</button>
|
||||
<button type="submit" class="btn btn-primary btn-lg pull-right" t-if="event.register_avail">Order Now</button>
|
||||
<div class="clearfix"/>
|
||||
<hr/>
|
||||
</form>
|
||||
<div t-field="event_id.description"></div>
|
||||
<div t-field="event.description"></div>
|
||||
<div class="clearfix"/>
|
||||
<ul class="media-list" id="comment">
|
||||
<li t-foreach="event_id.website_message_ids" t-as="comment" class="media">
|
||||
<li t-foreach="event.website_message_ids" t-as="comment" class="media">
|
||||
<div class="media-body">
|
||||
<t t-call="website.publish_management">
|
||||
<t t-set="object" t-value="comment"/>
|
||||
|
@ -265,24 +278,24 @@
|
|||
<div class="col-md-4 css_noprint">
|
||||
<div class="clearfix"/>
|
||||
|
||||
<div class="panel panel-default" t-if="event_id.address_id">
|
||||
<div class="panel panel-default" t-if="event.address_id">
|
||||
<div class="panel-heading">
|
||||
<h4>Where</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<a t-att-href="event_id.google_map_link()" target="_BLANK">
|
||||
<img t-att-src="event_id.google_map_img()" width="100%%"/>
|
||||
<a t-att-href="event.google_map_link()" target="_BLANK">
|
||||
<img t-att-src="event.google_map_img()" width="100%%"/>
|
||||
</a>
|
||||
<address class="mt16 mb8" t-field="event_id.address_id"> <!-- TODO: use widget contact -->
|
||||
<!-- <strong t-field="event_id.address_id"/>
|
||||
<p t-field="event_id.address_id"/>
|
||||
<div t-if="event_id.address_id.phone">
|
||||
<span class="icon-phone"/> <span t-field="event_id.address_id.phone"/>
|
||||
<address class="mt16 mb8" t-field="event.address_id"> <!-- TODO: use widget contact -->
|
||||
<!-- <strong t-field="event.address_id"/>
|
||||
<p t-field="event.address_id"/>
|
||||
<div t-if="event.address_id.phone">
|
||||
<span class="icon-phone"/> <span t-field="event.address_id.phone"/>
|
||||
</div>
|
||||
<div t-if="event_id.address_id.email">
|
||||
<div t-if="event.address_id.email">
|
||||
<span class="icon-envelope"/>
|
||||
<a t-att-href="'mailto:'+event_id.address_id.email">
|
||||
<span t-field="event_id.address_id.email"/>
|
||||
<a t-att-href="'mailto:'+event.address_id.email">
|
||||
<span t-field="event.address_id.email"/>
|
||||
</a>
|
||||
</div> -->
|
||||
</address>
|
||||
|
@ -294,22 +307,22 @@
|
|||
<h4>When</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_begin"> </span><br/>
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_end"> </span>
|
||||
<i class="icon-time"></i> <span t-field="event.date_begin"> </span><br/>
|
||||
<i class="icon-time"></i> <span t-field="event.date_end"> </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default" t-if="event_id.organizer_id">
|
||||
<div class="panel panel-default" t-if="event.organizer_id">
|
||||
<div class="panel-heading">
|
||||
<h4>Organizer</h4>
|
||||
</div>
|
||||
<div class="panel-body" t-field="event_id.organizer_id"> <!-- TODO: use widget contact -->
|
||||
<!-- <p><strong t-field="event_id.organizer_id.display_name"/></p>
|
||||
<div t-if="event_id.phone">
|
||||
<span class="icon-phone"/> <span t-field="event_id.phone"/>
|
||||
<div class="panel-body" t-field="event.organizer_id"> <!-- TODO: use widget contact -->
|
||||
<!-- <p><strong t-field="event.organizer_id.display_name"/></p>
|
||||
<div t-if="event.phone">
|
||||
<span class="icon-phone"/> <span t-field="event.phone"/>
|
||||
</div>
|
||||
<div t-if="event_id.email">
|
||||
<i class="icon-envelope"/> <span t-field="event_id.email"/>
|
||||
<div t-if="event.email">
|
||||
<i class="icon-envelope"/> <span t-field="event.email"/>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -319,8 +332,8 @@
|
|||
<h4>Social Stream</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<t t-call="website_mail.follow"><t t-set="object" t-value="event_id"/></t>
|
||||
<div t-if="event_id.twitter_hashtag" class="mt16">
|
||||
<t t-call="website_mail.follow"><t t-set="object" t-value="event"/></t>
|
||||
<div t-if="event.twitter_hashtag" class="mt16">
|
||||
<p><strong>Participate on Twitter</strong></p>
|
||||
<p class="text-muted">
|
||||
Find out what others are seeing and
|
||||
|
@ -328,7 +341,7 @@
|
|||
conversation.
|
||||
</p>
|
||||
<p><strong>Use this tag:
|
||||
<a t-att-href="'http://twitter.com/search?q=#'+event_id.twitter_hashtag" class="label label-primary">#<span t-field="event_id.twitter_hashtag"/></a>
|
||||
<a t-att-href="'http://twitter.com/search?q=#'+event.twitter_hashtag" class="label label-primary">#<span t-field="event.twitter_hashtag"/></a>
|
||||
</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -337,8 +350,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="view_event_form">
|
||||
<record model="ir.ui.view" id="view_event_sale_form">
|
||||
<field name="name">event.event.website.form</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="inherit_id" ref="event_sale.view_event_form"/>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- add state field in header -->
|
||||
<xpath expr="//sheet" position="before">
|
||||
|
@ -19,10 +19,10 @@
|
|||
<p>Website view: <field class="oe_inline" name="website_url" widget="url"/></p>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
<field name="organizer_id" position="after">
|
||||
<xpath expr="//field[@name='organizer_id']" position="after">
|
||||
<field name="website_published"/>
|
||||
</field>
|
||||
<field name="twitter_hashtag"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ Online Events
|
|||
'data': [
|
||||
'data/event_view.xml',
|
||||
'data/event_data.xml',
|
||||
'views/website_event.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/event.xml',
|
||||
],
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
|
||||
import event
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.tools.translate import _
|
||||
from openerp.addons import website_sale
|
||||
from openerp.addons.website.models import website
|
||||
from openerp.addons.website.controllers.main import Website as controllers
|
||||
|
||||
controllers = controllers()
|
||||
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from openerp import tools
|
||||
import urllib
|
||||
|
||||
class website_event(http.Controller):
|
||||
@website.route(['/event/detail/<model("event.event"):event>'], type='http', auth="public", multilang=True)
|
||||
def event_detail(self, event=None, **post):
|
||||
values = {
|
||||
'event': event,
|
||||
}
|
||||
return request.website.render("website_event_track.event_home", values)
|
||||
|
||||
@website.route(['/event/track_proposal/<model("event.event"):event>'], type='http', auth="public", multilang=True)
|
||||
def event_detail(self, event=None, **post):
|
||||
values = { 'event': event }
|
||||
return request.website.render("website_event_track.event_track_proposal", values)
|
||||
|
|
@ -7,7 +7,15 @@
|
|||
<field name="name">Event Tracks</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form,calendar,graph</field>
|
||||
<field name="context">{'search_default_event_id': active_id, 'default_event_id': active_id}</field>
|
||||
<field name="context">{'search_default_event_id': active_id, 'default_event_id': active_id, 'group_by': 'stage_id'}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to add a track.
|
||||
</p><p>
|
||||
Tracks define the agenda of your event. These can be
|
||||
a talk, a round table, a meeting, etc.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
@ -53,6 +61,7 @@
|
|||
<field name="model">event.track.stage</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Event Stage">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
@ -65,6 +74,32 @@
|
|||
action="action_event_track_stage" parent="event.event_configuration"
|
||||
groups="base.group_no_one"/>
|
||||
|
||||
<!-- EVENTS/CONFIGURATION/EVENT Tags -->
|
||||
<record model="ir.ui.view" id="view_event_track_tag_form">
|
||||
<field name="name">Track Tags</field>
|
||||
<field name="model">event.track.tag</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Event Track Tag" version="7.0">
|
||||
<field name="name"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_event_track_tag_tree">
|
||||
<field name="name">Tracks Tag</field>
|
||||
<field name="model">event.track.tag</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Event Track Tag">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_event_track_tag">
|
||||
<field name="name">Track Tags</field>
|
||||
<field name="res_model">event.track.tag</field>
|
||||
</record>
|
||||
<menuitem name="Tracks Tags" id="menu_event_track_tag" action="action_event_track_tag" parent="event.event_configuration" groups="base.group_no_one"/>
|
||||
|
||||
|
||||
<!-- EVENTS/CONFIGURATION/EVENT Tags -->
|
||||
<record model="ir.ui.view" id="view_event_tag_form">
|
||||
<field name="name">Event Tags</field>
|
||||
|
@ -100,11 +135,21 @@
|
|||
<xpath expr="//div[@class='oe_title']" position="inside">
|
||||
<label for="tag_ids" class="oe_edit_only"/>
|
||||
<field name="tag_ids" widget="many2many_tags"/>
|
||||
<div name="event_checkboxes">
|
||||
<field name="show_menu"/>
|
||||
<label for="show_menu"/>
|
||||
<field name="show_tracks"/>
|
||||
<label for="show_tracks"/>
|
||||
<field name="show_track_proposal"/>
|
||||
<label for="show_track_proposal"/>
|
||||
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//div[@class='oe_right oe_button_box']" position="inside">
|
||||
<button name="%(website_event_track.act_event_list_tracks)d" type="action" string="Tracks"/>
|
||||
<button name="%(website_event_track.act_event_list_tracks)d" type="action" string="Activate Blog"/>
|
||||
<button name="%(website_event_track.act_event_list_tracks)d" type="action" string="Desactivate Blog"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='twitter_hashtag']" position="after">
|
||||
<field name="track_tag_ids" widget="many2many_tags"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -115,14 +160,17 @@
|
|||
<field name="name">event.track.kanban</field>
|
||||
<field name="model">event.track</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban version="7.0" string="Tracks">
|
||||
<kanban>
|
||||
<templates>
|
||||
<field name="color"/>
|
||||
<field name="priority"/>
|
||||
<field name="speaker_ids"/>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_project oe_kanban_global_click">
|
||||
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
|
||||
<div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
|
||||
<span class="oe_e">í</span>
|
||||
<ul class="oe_dropdown_menu">
|
||||
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">View Track</a></li></t>
|
||||
<li><a href="/event/1/track/2">View Track</a></li>
|
||||
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit Track</a></li></t>
|
||||
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
|
||||
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
|
||||
|
@ -131,15 +179,26 @@
|
|||
<div class="oe_kanban_content">
|
||||
<h4><field name="name"/></h4>
|
||||
<field name="tag_ids"/>
|
||||
<div>
|
||||
<field name="date"/>
|
||||
<field name="duration"/> hours
|
||||
</div>
|
||||
<div class="oe_kanban_project_avatars">
|
||||
<t t-foreach="record.speaker_ids.raw_value.slice(0,11)" t-as="speaker">
|
||||
<img t-att-src="kanban_image('res.partner', 'image_small', speaker)" t-att-data-speaker_id="speaker"/>
|
||||
</t>
|
||||
<div t-if="duration"><field name="duration"/> hours</div>
|
||||
<span class="oe_right">
|
||||
<t t-set="priority" t-value="record.priority.raw_value || 0"/>
|
||||
<a type="object" name="set_priority" args="['2']" t-if="priority == 3" title="Normal Priority">
|
||||
<img src="/web/static/src/img/icons/star-off.png" width="16" height="16"/>
|
||||
</a>
|
||||
<a type="object" name="set_priority" args="['3']" t-if="priority lte 2" title="Normal Priority">
|
||||
<img t-attf-src="/web/static/src/img/icons/star-#{priority lte 2 ? 'on' : 'off'}.png" width="16" height="16"/>
|
||||
</a>
|
||||
<a type="object" name="set_priority" args="['1']" title="High Priority">
|
||||
<img t-attf-src="/web/static/src/img/icons/star-#{priority lte 1 ? 'on' : 'off'}.png" width="16" height="16"/>
|
||||
</a>
|
||||
<a type="object" name="set_priority" args="['0']" title="Highest Priority">
|
||||
<img t-attf-src="/web/static/src/img/icons/star-#{priority == 0 ? 'on' : 'off'}.png" width="16" height="16"/>
|
||||
</a>
|
||||
</span>
|
||||
<div t-foreach="record.speaker_ids.raw_value.slice(0,11)" t-as="speaker">
|
||||
<img t-att-src="kanban_image('res.partner', 'image_small', speaker)" t-att-data-speaker_id="speaker" class="oe_kanban_avatar oe_left" width="24px" height="24px"/>
|
||||
</div>
|
||||
<div class="oe_clear"/>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
@ -182,8 +241,6 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Event Track" version="7.0">
|
||||
<header>
|
||||
<button name="publish" string="Publish"/>
|
||||
<button name="unpublish" string="Publish"/>
|
||||
<field name="stage_id" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet string="Track">
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
class event_track_tag(osv.osv):
|
||||
_name = "event.track.tag"
|
||||
_columns = {
|
||||
'name': fields.char('Event Track Tag')
|
||||
}
|
||||
|
||||
class event_tag(osv.osv):
|
||||
_name = "event.tag"
|
||||
_columns = {
|
||||
|
@ -34,8 +40,13 @@ class event_tag(osv.osv):
|
|||
|
||||
class event_track_stage(osv.osv):
|
||||
_name = "event.track.stage"
|
||||
_order = 'sequence'
|
||||
_columns = {
|
||||
'name': fields.char('Track Stage')
|
||||
'name': fields.char('Track Stage'),
|
||||
'sequence': fields.integer('Sequence')
|
||||
}
|
||||
_defaults = {
|
||||
'sequence': 0
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,20 +64,39 @@ class event_track(osv.osv):
|
|||
'name': fields.char('Track Title', required=True),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'speaker_ids': fields.many2many('res.partner', string='Speakers'),
|
||||
'tag_ids': fields.many2many('event.tag', string='Tags'),
|
||||
'tag_ids': fields.many2many('event.track.tag', string='Tags'),
|
||||
'stage_id': fields.many2one('event.track.stage'),
|
||||
'description': fields.html('Track Description'),
|
||||
'date': fields.datetime('Track Date'),
|
||||
'duration': fields.float('Duration (Hours)'),
|
||||
'location_id': fields.many2one('event.track.location', 'Location'),
|
||||
'attachment_show': fields.boolean('Show Documents'),
|
||||
'show_attachments': fields.boolean('Show Documents'),
|
||||
'event_id': fields.many2one('event.event', 'Event', required=True),
|
||||
'color': fields.integer('Color Index'),
|
||||
'priority': fields.selection([('3','Low'),('2','Medium (*)'),('1','High (**)'),('0','Highest (***)')], 'Priority', required=True),
|
||||
}
|
||||
def set_priority(self, cr, uid, ids, priority, context={}):
|
||||
return self.write(cr, uid, ids, {'priority' : priority})
|
||||
|
||||
def _default_stage_id(self, cr, uid, context={}):
|
||||
stage_obj = self.pool.get('event.track.stage')
|
||||
ids = stage_obj.search(cr, uid, [], context=context)
|
||||
return ids and ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'user_id': lambda self, cr, uid, ctx: uid,
|
||||
'attachment_show': lambda self, cr, uid, ctx: True,
|
||||
'duration': lambda *args: 2
|
||||
'show_attachments': lambda self, cr, uid, ctx: True,
|
||||
'duration': lambda *args: 0,
|
||||
'stage_id': _default_stage_id,
|
||||
'priority': 3
|
||||
}
|
||||
def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
|
||||
stage_obj = self.pool.get('event.track.stage')
|
||||
result = stage_obj.name_search(cr, uid, '', context=context)
|
||||
return result, {}
|
||||
|
||||
_group_by_full = {
|
||||
'stage_id': _read_group_stage_ids,
|
||||
}
|
||||
|
||||
|
||||
|
@ -80,5 +110,14 @@ class event_event(osv.osv):
|
|||
'tag_ids': fields.many2many('event.tag', string='Tags'),
|
||||
'track_ids': fields.one2many('event.track', 'event_id', 'Tracks'),
|
||||
'blog_id': fields.many2one('blog.category', 'Event Blog'),
|
||||
}
|
||||
'show_track_proposal': fields.boolean('Talks Proposals'),
|
||||
'show_tracks': fields.boolean('Multiple Tracks'),
|
||||
'show_blog': fields.boolean('News'),
|
||||
'track_tag_ids': fields.many2many('event.track.tag', string='Accepted Tracks'),
|
||||
}
|
||||
_defaults = {
|
||||
'show_track_proposal': False,
|
||||
'show_tracks': False,
|
||||
'show_blog': False,
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,151 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<template id="event_home">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap">
|
||||
<div class="oe_structure"/>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
<h1 t-field="event.name" class="mt16"></h1>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="mt16">
|
||||
<t t-call="website.publish_management">
|
||||
<t t-set="object" t-value="event"/>
|
||||
<t t-set="publish_edit" t-value="True"/>
|
||||
<t t-set="publish_controller">/event/publish</t>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<ul class="nav nav-pills pull-right mt16">
|
||||
<li class="active"><a href="#">Event</a></li>
|
||||
<li><a href="#">Agenda</a></li>
|
||||
<li><a href="#">Location</a></li>
|
||||
<li><a href="#">Registration</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="event_track_proposal">
|
||||
<t t-call="website_event.layout">
|
||||
<div class="oe_structure"/>
|
||||
<div class="container">
|
||||
<section id="forms" t-if="not event.show_track_proposal">
|
||||
<h1>Proposals are closed!</h1>
|
||||
<p>
|
||||
This event does not accept proposals.
|
||||
</p>
|
||||
</section>
|
||||
<section class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="oe_structure"/>
|
||||
<div class="row">
|
||||
<section id="forms" t-if="event.show_track_proposal">
|
||||
<form class="form-horizontal mt32" action="/event/track_proposal/success" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" t-att-value="event.id" name="event"/>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="partner_name">Speaker Name</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<input type="text" class="form-control" name="partner_name" required="True" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="email_from">Your Email</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<input type="email" class="form-control" name="email_from" required="True" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="phone">Your Phone</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<input type="text" class="form-control" name="phone" required="True" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="phone">Tags</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-sm-4" t-foreach="event.track_tag_ids" t-as="tag">
|
||||
<input type="checkbox" t-att-value="tag.id" name="tags"/>
|
||||
<t t-esc="tag.name"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="phone">Speaker Biography</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<textarea class="form-control" name="biography" style="min-height: 120px"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 col-sm-4 control-label" for="description">Talk Introduction</label>
|
||||
<div class="col-md-7 col-sm-8">
|
||||
<textarea class="form-control" name="description" style="min-height: 120px"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
|
||||
<button type="submit" class="btn btn-primary">Submit Proposal</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</div><div class="col-md-4 col-md-offset-1">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4>Talks Types</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<strong>Regular Talks</strong>. These are standard talks with slides,
|
||||
alocated in slots of 30 minutes.
|
||||
</li><li>
|
||||
<strong>Lightning Talks</strong>. These are 10 minutes talks on many
|
||||
different topics. Most topics are accepted in lightning talks.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4>Submission Agreement</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
We require speakers to accept an agreement in which they commit to:
|
||||
</p>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
Timely release of presentation material (slides),
|
||||
for publishing on our website.
|
||||
</li><li>
|
||||
Allow video and audio recording of their
|
||||
presentation, for publishing on our website.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue