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

@ -6,16 +6,38 @@
********************************************************************************/ ********************************************************************************/
/******************************
* header table
******************************/
.newgrid-wrapper .grid-header td.filters {
vertical-align: bottom;
width: 100%;
}
.newgrid-wrapper .grid-header td.menu {
padding: 0.5em;
vertical-align: top;
white-space: nowrap;
}
.newgrid-wrapper .grid-header td.tools {
margin: 0;
padding: 0;
vertical-align: bottom;
white-space: nowrap;
}
/****************************** /******************************
* filters * filters
******************************/ ******************************/
.newgrid-wrapper .newfilters { .newgrid-wrapper .newfilters {
margin-right: 15em; margin: 0;
} }
.newgrid-wrapper .newfilters fieldset { .newgrid-wrapper .newfilters fieldset {
margin: -8px 0 5px 0; margin: 0;
padding: 1px 5px 5px 5px; padding: 1px 5px 5px 5px;
width: 80%; width: 80%;
} }
@ -38,11 +60,11 @@
line-height: 1.4em; line-height: 1.4em;
} }
.newgrid-wrapper .newfilters .ui-button-text-icon-primary .ui-button-text { .newgrid-wrapper .ui-button-text-icon-primary .ui-button-text {
padding: 0.2em 1em 0.2em 2.1em; padding: 0.2em 1em 0.2em 2.1em;
} }
.newgrid-wrapper .newfilters .ui-selectmenu-button .ui-selectmenu-text { .newgrid-wrapper .ui-selectmenu-button .ui-selectmenu-text {
padding: 0.2em 2.1em 0.2em 1em; padding: 0.2em 2.1em 0.2em 1em;
} }
@ -70,7 +92,8 @@
} }
.newgrid-wrapper .newfilters .buttons { .newgrid-wrapper .newfilters .buttons {
margin: 0 0 5px 0; margin: 0.5em 0 0 0;
padding: 0;
} }
.newgrid-wrapper .newfilters #add-filter-button { .newgrid-wrapper .newfilters #add-filter-button {
@ -79,23 +102,13 @@
} }
/******************************
* tools
******************************/
.grid-tools {
float: right;
margin-bottom: 4px;
}
/****************************** /******************************
* table * table
******************************/ ******************************/
.newgrid { .newgrid {
clear: both; clear: both;
margin-top: 0.3em;
} }
.newgrid table { .newgrid table {

View file

@ -93,7 +93,7 @@
that.filters_form.off('submit'); that.filters_form.off('submit');
that.filters_form.find('input[name="reset-to-default-filters"]').val('true'); that.filters_form.find('input[name="reset-to-default-filters"]').val('true');
that.element.mask("Refreshing data..."); that.element.mask("Refreshing data...");
that.filters_form.submit(); that.filters_form.get(0).submit();
}); });
// When user clicks Save Defaults button, refresh the grid as with // When user clicks Save Defaults button, refresh the grid as with

View file

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

View file

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

View file

@ -36,6 +36,9 @@
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
$('.newgrid-wrapper .grid-header .tools select').selectmenu();
$('.newgrid-wrapper').on('click', 'a.print_label', function() { $('.newgrid-wrapper').on('click', 'a.print_label', function() {
var quantity = $('table.label-printing #label-quantity'); var quantity = $('table.label-printing #label-quantity');
if (isNaN(quantity.val())) { if (isNaN(quantity.val())) {
@ -96,7 +99,7 @@
<%def name="context_menu_items()"> <%def name="context_menu_items()">
${parent.context_menu_items()} ${parent.context_menu_items()}
% if request.has_perm('batches.create'): % 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 % endif
</%def> </%def>