Browse Source

Finalyse POC....

pull/908/head
Laurent Mignon (ACSONE) 10 years ago
committed by Tom Blauwendraat
parent
commit
c67e8532d7
  1. 5
      __openerp__.py
  2. 28
      project_view.xml
  3. 17
      static/src/css/web_timeline.css
  4. 1325
      static/src/js/web_timeline.js
  5. 67
      static/src/xml/web_timeline.xml
  6. 2
      views/web_timeline.xml

5
__openerp__.py

@ -7,9 +7,10 @@
"author": "ACSONE SA/NV",
"category": "Acsone",
"website": "http://acsone.eu",
'depends': ['web'],
'qweb': ['static/src/xml/timeline.xml'],
'depends': ['web', 'project'],
'qweb': ['static/src/xml/web_timeline.xml'],
'data': [
'views/web_timeline.xml',
'project_view.xml',
],
}

28
project_view.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_task_timeline" model="ir.ui.view">
<field name="name">project.task.timeline</field>
<field name="model">project.task</field>
<field name="type">timeline</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<timeline date_start="date_start"
date_stop="date_end"
progress="progress"
string="Tasks"
default_group_by="user_id" event_open_popup="true" colors="#ec7063:kanban_state=='blocked';#2ecb71:kanban_state=='done';#95a5a5:kanban_state=='normal';">
</timeline>
</field>
</record>
<record id="action_view_task" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">project.task</field>
<field name="view_mode">kanban,tree,form,calendar,gantt,timeline,graph</field>
<field name="search_view_id" ref="project.view_task_search_form"/>
<field name="inherit_id" ref="project.action_view_task"/>
</record>
</data>
</openerp>

17
static/src/css/web_timeline.css

@ -0,0 +1,17 @@
/* Button style */
.openerp .oe_view_manager .oe_view_manager_switch .oe_vm_switch_timeline:after {
content: "N";
}
.timeline-navigation-zoom-in .ui-icon{
background: none !important;
}
.timeline-navigation-zoom-out .ui-icon{
background: none !important;
}
.timeline-navigation-move-left .ui-icon{
background: none !important;
}
.timeline-navigation-move-right .ui-icon{
background: none !important;
}

1325
static/src/js/web_timeline.js
File diff suppressed because it is too large
View File

67
static/src/xml/web_timeline.xml

@ -1,74 +1,7 @@
<template>
<t t-name="TimelineView">
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="oe_timeline_table">
<tr>
<td width="100%">
<div class="oe_timeline_view">
<div class="oe_timeline_widget" />
<div class="oe_timeline_buttons"/>
<div class="oe_timeline_qc_placeholder"/>
</div>
</td>
<td class='oe_timeline_sidebar_container'>
</td>
</tr>
</table>
</t>
<t t-name="TimelineView.sidebar">
<div class="oe_timeline_sidebar">
<div class="oe_timeline_mini" />
<div class="oe_timeline_filter">
<h3><t t-esc="widget.getParent().color_string"/></h3>
</div>
</div>
</t>
<t t-name="TimelineView.sidebar.responsible">
<div class="oe_timeline_all_responsibles">
<div t-foreach="filters" class="oe_timeline_responsible" >
<t t-if="filters_value.value"> <!-- don't display if no value given (or undefined) -->
<input type="checkbox" name="selection" t-att-value="filters_value.value" checked="checked" />
<t t-if="filters_value.value == -1">
<span><i t-attf-class="fa fa-users fa-fw cal_avatar" ></i></span>
</t>
<t t-if="(filters_value.value != -1) &amp;&amp; filters_value.avatar_model ">
<img t-att-src="'/web/binary/image?model=' + filters_value.avatar_model + '&amp;field=image_small&amp;id=' + filters_value.value" class="cal_avatar"/>
</t>
<span t-attf-class="color_filter cal_opacity underline_color_#{filters_value.color}" ><t t-esc="filters_value.label" /></span>
</t>
</div>
</div>
</t>
<div t-name="TimelineView.buttons" class="oe_timeline_buttons">
<t t-if="widget.options.action_buttons !== false">
<t t-if="widget.is_action_enabled('create') &amp;&amp;
((widget.field_widget &amp;&amp;
(widget.field_widget.open_popup_add)) ||
(!widget.field_widget))">
<button type="button" class="oe_timeline_button_new oe_highlight">
<t t-esc="widget.options.create_text || _t('Create')"/>
</button>
</t>
</t>
</div>
<div t-name="TimelineView.quick_create" class="oe_timeline_quick_create openerp">
<div class="form-group">
<label for='name' class='control-label'>Event summary:</label>
<input name='name' class="form-control"/>
</div>
<t t-if="widget._buttons">
<div class="oe_timeline_quick_create_buttons">
<button class="openerp oe_button oe_highlight oe_timeline_quick_create_add ">Create event</button>
<button class="oe_button oe_form_button oe_link oe_timeline_quick_create_edit" ><span>Edit Event <![CDATA[]]></span></button>
</div>
</t>
</div>
</template>

2
views/web_timeline.xml

@ -6,7 +6,7 @@
<template id="assets_backend" name="web_calendar assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/web_timeline/static/src/css/web_timeline.css"/>
<link rel="stylesheet" href="/web_timeline/static/lib/timeline/css/timeline.css"/>
<link rel="stylesheet" href="/web_timeline/static/lib/timeline/timeline.css"/>
<script type="text/javascript" src="/web_timeline/static/lib/timeline/timeline.js"></script>
<script type="text/javascript" src="/web_timeline/static/src/js/web_timeline.js"></script>

Loading…
Cancel
Save