[IMP] in list views: hide drag-n-drop handle and trash can with css classes

bzr revid: rco@openerp.com-20120904074145-5mefinpkz0pl0qyb
This commit is contained in:
Raphael Collet 2012-09-04 09:41:45 +02:00
parent 00b8441f0a
commit b203377994
4 changed files with 29 additions and 5 deletions

View File

@ -69,7 +69,6 @@
display: none !important;
}
}
.openerp.openerp_webclient_container {
height: 100%;
position: relative;
@ -85,7 +84,7 @@
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
/* http://www.quirksmode.org/dom/inputfile.html
* http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
*/ */
*/
}
.openerp :-moz-placeholder {
color: #afafb6 !important;
@ -2638,6 +2637,12 @@
content: "ö";
color: #404040;
}
.openerp .oe_list_cannot_edit .oe_list_header_handle, .openerp .oe_list_cannot_edit .oe_list_field_handle {
display: none !important;
}
.openerp .oe_list_cannot_delete .oe_list_header_delete, .openerp .oe_list_cannot_delete .oe_list_record_delete {
display: none !important;
}
.openerp .tree_header {
background-color: #f0f0f0;
border-bottom: 1px solid #cacaca;

View File

@ -2050,6 +2050,13 @@ $sheet-max-width: 860px
.oe_list_handle
@include text-to-icon("ö")
.oe_list_cannot_edit
.oe_list_header_handle, .oe_list_field_handle
display: none !important
.oe_list_cannot_delete
.oe_list_header_delete, .oe_list_record_delete
display: none !important
// }}}
// Tree view {{{
.tree_header

View File

@ -250,6 +250,18 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.$el.html(QWeb.render(this._template, this));
this.$el.addClass(this.fields_view.arch.attrs['class']);
// add css classes that reflect the (absence of) access rights
if (!this._is_action_enabled('create')) {
this.$el.addClass('oe_list_cannot_create');
}
if (!this._is_action_enabled('edit')) {
this.$el.addClass('oe_list_cannot_edit');
}
if (!this._is_action_enabled('delete')) {
this.$el.addClass('oe_list_cannot_delete');
}
// Head hook
// Selecting records
this.$el.find('.oe_list_record_selector').click(function(){

View File

@ -635,7 +635,7 @@
<t t-if="column.tag !== 'button'"><t t-esc="column.string"/></t>
</th>
</t>
<th t-if="options.deletable and _is_action_enabled('delete')" width="13px"/>
<th t-if="options.deletable" class="oe_list_header_delete" width="13px"/>
</tr>
</thead>
<tfoot>
@ -644,7 +644,7 @@
<td t-foreach="aggregate_columns" t-as="column" class="oe_list_footer oe_number"
t-att-data-field="column.id" t-att-title="column.label">
</td>
<td t-if="options.deletable and _is_action_enabled('delete')"/>
<td t-if="options.deletable"/>
</tr>
</tfoot>
</table>
@ -691,7 +691,7 @@
t-att-data-field="column.id"
><t t-raw="render_cell(record, column)"/></td>
</t>
<td t-if="options.deletable and view._is_action_enabled('delete')" class='oe_list_record_delete' width="13px">
<td t-if="options.deletable" class='oe_list_record_delete' width="13px">
<button type="button" name="delete" class="oe_i">d</button>
</td>
</tr>