[IMP] kanban :- add basic structure of folding and unfolding columns.
bzr revid: ysa@tinyerp.com-20110920120247-0f916npmmeu83qhu
This commit is contained in:
parent
4d578b6e00
commit
9fa1aaec6e
|
@ -3,6 +3,12 @@
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.oe_vertical_text {
|
||||
-moz-transform: rotate(-90deg);
|
||||
-o-transform: rotate(-90deg);
|
||||
-webkit-transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.openerp .oe_kanban_view .ui-sortable-placeholder {
|
||||
border: 1px dotted black;
|
||||
visibility: visible !important;
|
||||
|
@ -199,5 +205,4 @@
|
|||
/* Alert color */
|
||||
.openerp .oe_kanban_color_alert .oe_kanban_color_border {
|
||||
border-color: #c00 !important;
|
||||
}
|
||||
|
||||
}
|
|
@ -148,6 +148,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
|
|||
self.all_display_data.sort(this.sort_group);
|
||||
this.$element.html(QWeb.render("KanbanView", {"data": self.all_display_data}));
|
||||
this.on_reload_kanban();
|
||||
this.$element.find(".oe_vertical_text").hide();
|
||||
var drag_handel = false;
|
||||
if (this.$element.find(".oe_kanban_draghandle").length > 0) {
|
||||
drag_handel = ".oe_kanban_draghandle";
|
||||
|
@ -166,6 +167,26 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
|
|||
});
|
||||
this.$element.find(".oe_column").disableSelection()
|
||||
this.$element.find('button.oe_kanban_button_new').click(this.do_add_record);
|
||||
this.$element.find(".fold-columns-icon").click(function(event) {
|
||||
self.do_fold_unfold_columns(event, this.id);
|
||||
});
|
||||
},
|
||||
do_fold_unfold_columns: function(event, element_id) {
|
||||
var column_id = "column_" + element_id;
|
||||
var column_element = this.$element.find("#" + column_id + ".oe_fold_column");
|
||||
if (column_element.is(":hidden")) {
|
||||
this.$element.find("#" + column_id).find("img.fold-columns-icon").attr('src', '/web_kanban/static/src/img/minus-icon.png');
|
||||
column_element.show();
|
||||
this.$element.find("#" + column_id + ".oe_table_column").css("width",Math.round(99 / this.all_display_data.length) + "%");
|
||||
this.$element.find("#" + column_id + ".oe_vertical_text").hide();
|
||||
}
|
||||
else{
|
||||
this.$element.find("#" + column_id).find("img.fold-columns-icon").attr('src', '/web_kanban/static/src/img/plus-icon.png');
|
||||
column_element.hide();
|
||||
this.$element.find("#" + column_id + ".oe_table_column").css("width","0.5%");
|
||||
this.$element.find("#" + column_id + ".oe_vertical_text").show();
|
||||
}
|
||||
|
||||
},
|
||||
do_record_group: function() {
|
||||
if (this.NO_OF_COLUMNS) {
|
||||
|
|
|
@ -10,15 +10,19 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td t-foreach="data" t-as="columns" class="oe_table_column oe_column_heading" t-att-id="'column_' + columns.value">
|
||||
<t t-if="columns.value" t-esc="columns.header"/>
|
||||
<t t-if="columns.aggregates">
|
||||
<br/><t t-esc="columns.aggregates"/>
|
||||
</t>
|
||||
<img t-att-id="columns.value" class="fold-columns-icon" src="/web_kanban/static/src/img/minus-icon.png"/>
|
||||
<div t-att-id="'column_' + columns.value" class="oe_fold_column">
|
||||
<t t-if="columns.value" t-esc="columns.header"/>
|
||||
<t t-if="columns.aggregates">
|
||||
<br/><t t-esc="columns.aggregates"/>
|
||||
</t>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td t-foreach="data" t-as="columns" class="oe_table_column" t-att-id="'column_' + columns.value" t-attf-style="width: #{Math.round(99 / data.length)}%">
|
||||
<div class="oe_column" t-att-id="'column_' + columns.value">
|
||||
<td t-foreach="data" t-as="columns" class="oe_table_column oe_column_data" t-att-id="'column_' + columns.value" t-attf-style="width: #{Math.round(99 / data.length)}%">
|
||||
<p class="oe_vertical_text" t-att-id="'column_' + columns.value"> <t t-esc="columns.header"/></p>
|
||||
<div class="oe_column oe_fold_column" t-att-id="'column_' + columns.value">
|
||||
<div t-foreach="columns.records" t-as="record" class="oe_kanban_record" t-att-id="'main_' + record.id"/>
|
||||
</div>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue