Overhaul newgrid template header a bit, to improve styles

This commit is contained in:
Lance Edgar 2016-04-30 20:54:22 -05:00
parent 130b6dda76
commit 6d2af6d698
5 changed files with 69 additions and 31 deletions

View file

@ -28,8 +28,4 @@
<%def name="grid_tools()"></%def>
<ul id="context-menu">
${self.context_menu_items()}
</ul>
${grid.render_complete(tools=capture(self.grid_tools))|n}
${grid.render_complete(tools=capture(self.grid_tools).strip(), context_menu=capture(self.context_menu_items).strip())|n}

View file

@ -1,12 +1,38 @@
## -*- coding: utf-8 -*-
<div class="newgrid-wrapper">
% if grid.filterable:
${grid.render_filters(allow_save_defaults=allow_save_defaults)|n}
% endif
% if tools:
<div class="grid-tools">
${tools|n}
</div>
% endif
<table class="grid-header">
<tbody>
<tr>
<td class="filters" rowspan="2">
% if grid.filterable:
${grid.render_filters(allow_save_defaults=allow_save_defaults)|n}
% endif
</td>
<td class="menu">
% if context_menu:
<ul id="context-menu">
${context_menu|n}
</ul>
% endif
</td>
</tr>
<tr>
<td class="tools">
% if tools:
<div class="grid-tools">
${tools|n}
</div><!-- grid-tools -->
% endif
</td>
</tr>
</tbody>
</table><!-- grid-header -->
${grid.render_grid()|n}
</div><!-- newgrid-wrapper -->

View file

@ -36,6 +36,9 @@
<script type="text/javascript">
$(function() {
$('.newgrid-wrapper .grid-header .tools select').selectmenu();
$('.newgrid-wrapper').on('click', 'a.print_label', function() {
var quantity = $('table.label-printing #label-quantity');
if (isNaN(quantity.val())) {
@ -96,7 +99,7 @@
<%def name="context_menu_items()">
${parent.context_menu_items()}
% if request.has_perm('batches.create'):
<li>${h.link_to("Create Batch from Results", url('products.create_batch'))}</li>
<li>${h.link_to("Create new Batch from results", url('products.create_batch'))}</li>
% endif
</%def>