Skip to content

Commit 9695d57

Browse files
committed
Add pattern option hideCheckboxes
1 parent 564d41d commit 9695d57

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

ide/app/editors/settings/views-settings.component.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
</label>
4141
<p class="help-block">Reverse the sort ordering</p>
4242
</div>
43+
<div class="checkbox">
44+
<label>
45+
<input #hideCheckboxes formControlName="form.controls.hideCheckboxes" type="checkbox" [checked]="data?.hide_checkboxes"> Hide checkboxes
46+
</label>
47+
<p class="help-block">The first column with checkboxes will not be displayed</p>
48+
</div>
4349
<div class="checkbox">
4450
<label>
4551
<input #staticRendering formControlName="form.controls.staticRendering" type="checkbox" [checked]="data?.static_rendering"> Static rendering

src/Products/CMFPlomino/browser/static/js/table.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ require([
2626
for(var i=0; i<data.rows.length; i++) {
2727
var row = data.rows[i];
2828
html += '<tr>';
29-
html += '<td>' +
30-
'<input type="checkbox" name="sdoc" value="' +
31-
row[0] +
32-
'" />' +
33-
'</td>';
29+
html += '<td>';
30+
if (self.options.hideCheckboxes !== 'True') {
31+
html += '<input type="checkbox" name="sdoc" value="' +
32+
row[0] +
33+
'" />';
34+
}
35+
html += '<td>';
3436
html += '<td><a href="' +
3537
self.options.source +
3638
'/../document/' + row[0] +

src/Products/CMFPlomino/browser/templates/openview.pt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111

1212
<!-- TODO(ivanteoh): do we need 'hasReadPermission' in 2.x -->
1313
<tal:view_parameters
14-
define="plomino_view python:here;
15-
hideCheckboxes python:False;">
14+
define="hideCheckboxes context/hide_checkboxes|nothing;">
1615

17-
<form id="plomino-view" tal:attributes="name python:plomino_view.id"
16+
<form id="plomino-view" tal:attributes="name python:context.id"
1817
class="plominoviewform">
1918

2019
<h1 class="documentFirstHeading" tal:content="context/Title">Title</h1>
@@ -29,7 +28,9 @@
2928
<table
3029
tal:define="columns python:context.getColumns();"
3130
tal:attributes="class python:(context.static_rendering and 'listing') or 'listing plomino-table';
32-
data-pat-plominotable string:source:${context/absolute_url}/tojson;">
31+
data-pat-plominotable
32+
string:source:${context/absolute_url}/tojson;;
33+
hideCheckboxes:${context/hide_checkboxes};">
3334
<tr class="header-row">
3435
<th></th>
3536
<tal:headers tal:repeat="column columns">

src/Products/CMFPlomino/contents/view.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ class IPlominoView(model.Schema):
122122
default=False,
123123
)
124124

125+
hide_checkboxes = schema.Bool(
126+
title=_('CMFPlomino_label_hide_checkboxes',
127+
default="Hide checkboxes"),
128+
description=_('CMFPlomino_help_hide_checkboxes',
129+
default='The first column with checkboxes will not be displayed'),
130+
default=False,
131+
)
132+
125133
static_rendering = schema.Bool(
126134
title=_('CMFPlomino_label_static_rendering',
127135
default="Static rendering"),

0 commit comments

Comments
 (0)