Add basic checkbox support to new grids.

Also:

 * Add 'creatable', 'editable' etc. to master view class.
 * Add styles for warning/notice grid rows.
 * Misc. other tweaks.
This commit is contained in:
Lance Edgar 2015-08-14 15:30:38 -05:00
parent e79531fda8
commit d2b065a8fc
13 changed files with 229 additions and 71 deletions

View file

@ -3,9 +3,9 @@
<table>
<thead>
<tr>
## % if grid.checkboxes:
## <th class="checkbox">${h.checkbox('check-all')}</th>
## % endif
% if grid.checkboxes:
<th class="checkbox">${h.checkbox('check-all')}</th>
% endif
% for column in grid.iter_visible_columns():
${grid.column_header(column)}
% endfor
@ -17,9 +17,9 @@
<tbody>
% for i, row in enumerate(grid.iter_rows(), 1):
<tr ${format_attrs(**grid.get_row_attrs(row, i))}>
## % if grid.checkboxes:
## <td class="checkbox">${grid.checkbox(row)}</td>
## % endif
% if grid.checkboxes:
<td class="checkbox">${grid.render_checkbox(row)}</td>
% endif
% for column in grid.iter_visible_columns():
<td ${format_attrs(**grid.get_cell_attrs(row, column))}>${grid.render_cell(row, column)}</td>
% endfor
@ -32,7 +32,7 @@
% endfor
</tbody>
</table>
% if grid.pageable:
% if grid.pageable and grid.pager:
<div class="pager">
<p class="showing">
showing ${grid.pager.first_item} thru ${grid.pager.last_item} of ${grid.pager.item_count}