Final grid refactor for all templates and CSS/JS (newgrid -> grid)
This commit is contained in:
parent
c57e2e17cc
commit
292546e44b
26 changed files with 329 additions and 687 deletions
|
@ -149,8 +149,6 @@
|
|||
${h.stylesheet_link(request.static_url('tailbone:static/css/grids.css'))}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/filters.css'))}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/forms.css'))}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/newgrids.css'))}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/grids3.css'))}
|
||||
</%def>
|
||||
|
||||
<%def name="jquery_smoothness_theme()">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<div class="newgrid-wrapper">
|
||||
<div class="grid-wrapper">
|
||||
|
||||
<table class="grid-header">
|
||||
<tbody>
|
||||
|
@ -35,4 +35,4 @@
|
|||
|
||||
${grid.render_grid()|n}
|
||||
|
||||
</div><!-- newgrid-wrapper -->
|
||||
</div><!-- grid-wrapper -->
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<div class="newgrid grid3 ${grid_class}">
|
||||
<div class="grid ${grid_class}">
|
||||
<table>
|
||||
${grid.make_webhelpers_grid()}
|
||||
</table>
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
## ##############################################################################
|
||||
##
|
||||
## Default master 'index' template. Features a prominent data table and
|
||||
## exposes a way to filter and sort the data, etc. Some index pages also
|
||||
## include a "tools" section, just above the grid on the right.
|
||||
##
|
||||
## ##############################################################################
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${grid.model_title_plural}</%def>
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.js'))}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('.newgrid-wrapper').gridwrapper();
|
||||
|
||||
% if master.mergeable and request.has_perm('{}.merge'.format(permission_prefix)):
|
||||
|
||||
$('form[name="merge-things"] button').button('option', 'disabled', $('.newgrid tbody td.checkbox input:checked').length != 2);
|
||||
|
||||
$('.newgrid-wrapper').on('click', 'tbody td.checkbox input', function() {
|
||||
$('form[name="merge-things"] button').button('option', 'disabled', $('.newgrid tbody td.checkbox input:checked').length != 2);
|
||||
});
|
||||
|
||||
|
||||
$('form[name="merge-things"]').submit(function() {
|
||||
var uuids = [];
|
||||
$('.newgrid tbody td.checkbox input:checked').each(function() {
|
||||
uuids.push($(this).parents('tr:first').data('uuid'));
|
||||
});
|
||||
if (uuids.length != 2) {
|
||||
return false;
|
||||
}
|
||||
$(this).find('[name="uuids"]').val(uuids.toString());
|
||||
$(this).find('button')
|
||||
.button('option', 'label', "Preparing to Merge...")
|
||||
.button('disable');
|
||||
});
|
||||
|
||||
% endif
|
||||
|
||||
% if master.bulk_deletable and request.has_perm('{}.bulk_delete'.format(permission_prefix)):
|
||||
|
||||
$('form[name="bulk-delete"] button').click(function() {
|
||||
var count = 0;
|
||||
var match = /showing \d+ thru \d+ of (\S+)/.exec($('.pager .showing').text());
|
||||
if (match) {
|
||||
count = match[1];
|
||||
} else {
|
||||
alert("There don't seem to be any results to delete!");
|
||||
return;
|
||||
}
|
||||
if (! confirm("You are about to delete " + count + " ${model_title_plural}.\n\nAre you sure?")) {
|
||||
return
|
||||
}
|
||||
$(this).button('disable').button('option', 'label', "Deleting Results...");
|
||||
$('form[name="bulk-delete"]').submit();
|
||||
});
|
||||
|
||||
% endif
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if master.creatable and request.has_perm('{}.create'.format(grid.permission_prefix)):
|
||||
<li>${h.link_to("Create a new {}".format(grid.model_title), url('{}.create'.format(grid.route_prefix)))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="grid_tools()">
|
||||
% if master.mergeable and request.has_perm('{}.merge'.format(permission_prefix)):
|
||||
${h.form(url('{}.merge'.format(route_prefix)), name='merge-things')}
|
||||
${h.csrf_token(request)}
|
||||
${h.hidden('uuids')}
|
||||
<button type="submit">Merge 2 ${model_title_plural}</button>
|
||||
${h.end_form()}
|
||||
% endif
|
||||
% if master.bulk_deletable and request.has_perm('{}.bulk_delete'.format(permission_prefix)):
|
||||
${h.form(url('{}.bulk_delete'.format(route_prefix)), name='bulk-delete')}
|
||||
${h.csrf_token(request)}
|
||||
<button type="button">Delete Results</button>
|
||||
${h.end_form()}
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${grid.render_complete(tools=capture(self.grid_tools).strip(), context_menu=capture(self.context_menu_items).strip())|n}
|
|
@ -13,7 +13,7 @@
|
|||
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.js'))}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.newgrid-wrapper').gridwrapper();
|
||||
$('.grid-wrapper').gridwrapper();
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.js'))}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.newgrid-wrapper').gridwrapper();
|
||||
$('.grid-wrapper').gridwrapper();
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.newgrid-wrapper {
|
||||
.grid-wrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -6,19 +6,91 @@
|
|||
## include a "tools" section, just above the grid on the right.
|
||||
##
|
||||
## ##############################################################################
|
||||
<%inherit file="/master/index.mako" />
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${model_title_plural}</%def>
|
||||
|
||||
<%def name="extra_javascript()">
|
||||
${parent.extra_javascript()}
|
||||
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.js'))}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('.grid-wrapper').gridwrapper();
|
||||
|
||||
% if master.mergeable and request.has_perm('{}.merge'.format(permission_prefix)):
|
||||
|
||||
$('form[name="merge-things"] button').button('option', 'disabled', $('.grid tbody td.checkbox input:checked').length != 2);
|
||||
|
||||
$('.grid-wrapper').on('click', 'tbody td.checkbox input', function() {
|
||||
$('form[name="merge-things"] button').button('option', 'disabled', $('.grid tbody td.checkbox input:checked').length != 2);
|
||||
});
|
||||
|
||||
|
||||
$('form[name="merge-things"]').submit(function() {
|
||||
var uuids = [];
|
||||
$('.grid tbody td.checkbox input:checked').each(function() {
|
||||
uuids.push($(this).parents('tr:first').data('uuid'));
|
||||
});
|
||||
if (uuids.length != 2) {
|
||||
return false;
|
||||
}
|
||||
$(this).find('[name="uuids"]').val(uuids.toString());
|
||||
$(this).find('button')
|
||||
.button('option', 'label', "Preparing to Merge...")
|
||||
.button('disable');
|
||||
});
|
||||
|
||||
% endif
|
||||
|
||||
% if master.bulk_deletable and request.has_perm('{}.bulk_delete'.format(permission_prefix)):
|
||||
|
||||
$('form[name="bulk-delete"] button').click(function() {
|
||||
var count = 0;
|
||||
var match = /showing \d+ thru \d+ of (\S+)/.exec($('.pager .showing').text());
|
||||
if (match) {
|
||||
count = match[1];
|
||||
} else {
|
||||
alert("There don't seem to be any results to delete!");
|
||||
return;
|
||||
}
|
||||
if (! confirm("You are about to delete " + count + " ${model_title_plural}.\n\nAre you sure?")) {
|
||||
return
|
||||
}
|
||||
$(this).button('disable').button('option', 'label', "Deleting Results...");
|
||||
$('form[name="bulk-delete"]').submit();
|
||||
});
|
||||
|
||||
% endif
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if master.creatable and request.has_perm('{}.create'.format(permission_prefix)):
|
||||
<li>${h.link_to("Create a new {}".format(model_title), url('{}.create'.format(route_prefix)))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="grid_tools()">
|
||||
% if master.mergeable and request.has_perm('{}.merge'.format(permission_prefix)):
|
||||
${h.form(url('{}.merge'.format(route_prefix)), name='merge-things')}
|
||||
${h.csrf_token(request)}
|
||||
${h.hidden('uuids')}
|
||||
<button type="submit">Merge 2 ${model_title_plural}</button>
|
||||
${h.end_form()}
|
||||
% endif
|
||||
% if master.bulk_deletable and request.has_perm('{}.bulk_delete'.format(permission_prefix)):
|
||||
${h.form(url('{}.bulk_delete'.format(route_prefix)), name='bulk-delete')}
|
||||
${h.csrf_token(request)}
|
||||
<button type="button">Delete Results</button>
|
||||
${h.end_form()}
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
## ${grid.render_complete(tools=capture(self.grid_tools).strip(), context_menu=capture(self.context_menu_items).strip())|n}
|
||||
|
||||
<div class="newgrid-wrapper">
|
||||
<div class="grid-wrapper">
|
||||
|
||||
<table class="grid-header">
|
||||
<tbody>
|
||||
|
@ -51,5 +123,5 @@
|
|||
|
||||
${grid.render_grid()|n}
|
||||
|
||||
</div><!-- newgrid-wrapper -->
|
||||
</div><!-- grid-wrapper -->
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
var destination = null;
|
||||
|
||||
function update_move_button() {
|
||||
var count = $('.newgrid tr:not(.header) td.checkbox input:checked').length;
|
||||
var count = $('.grid tr:not(.header) td.checkbox input:checked').length;
|
||||
$('form[name="move-selected"] button')
|
||||
.button('option', 'label', "Move " + count + " selected to " + destination)
|
||||
.button('option', 'disabled', count < 1);
|
||||
|
@ -18,17 +18,17 @@
|
|||
|
||||
update_move_button();
|
||||
|
||||
$('.newgrid-wrapper').on('change', 'tr.header td.checkbox input', function() {
|
||||
$('.grid-wrapper').on('change', 'tr.header td.checkbox input', function() {
|
||||
update_move_button();
|
||||
});
|
||||
|
||||
$('.newgrid-wrapper').on('click', 'tr:not(.header) td.checkbox input', function() {
|
||||
$('.grid-wrapper').on('click', 'tr:not(.header) td.checkbox input', function() {
|
||||
update_move_button();
|
||||
});
|
||||
|
||||
$('form[name="move-selected"]').submit(function() {
|
||||
var uuids = [];
|
||||
$('.newgrid tr:not(.header) td.checkbox input:checked').each(function() {
|
||||
$('.grid tr:not(.header) td.checkbox input:checked').each(function() {
|
||||
uuids.push($(this).parents('tr:first').data('uuid'));
|
||||
});
|
||||
if (! uuids.length) {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</script>
|
||||
<style type="text/css">
|
||||
|
||||
.newgrid-wrapper {
|
||||
.grid-wrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
${parent.extra_styles()}
|
||||
<style type="text/css">
|
||||
|
||||
.newgrid-wrapper {
|
||||
.grid-wrapper {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ ${h.end_form()}
|
|||
<%def name="extra_td(cost)"></%def>
|
||||
|
||||
<%def name="order_form_grid()">
|
||||
<div class="newgrid">
|
||||
<div class="grid">
|
||||
<table class="order-form">
|
||||
<% column_count = 8 + len(header_columns) + (0 if ignore_cases else 1) + int(capture(self.extra_count)) %>
|
||||
% for department in sorted(departments.values(), key=lambda d: d.name if d else ''):
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
$('#permission').selectmenu();
|
||||
|
||||
$('#find-by-perm-form').submit(function() {
|
||||
$('.newgrid').remove();
|
||||
$('.grid').remove();
|
||||
$(this).find('#submit').button('disable').button('option', 'label', "Searching, please wait...");
|
||||
});
|
||||
|
||||
|
@ -59,7 +59,7 @@ ${h.csrf_token(request)}
|
|||
${h.end_form()}
|
||||
|
||||
% if principals is not None:
|
||||
<div class="newgrid half">
|
||||
<div class="grid half">
|
||||
<br />
|
||||
<h2>${model_title_plural} with that permission (${len(principals)} total):</h2>
|
||||
${self.principal_table()}
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
|
||||
$(function() {
|
||||
|
||||
$('.newgrid-wrapper .grid-header .tools select').selectmenu();
|
||||
$('.grid-wrapper .grid-header .tools select').selectmenu();
|
||||
|
||||
$('.newgrid-wrapper').on('click', 'a.print_label', function() {
|
||||
$('.grid-wrapper').on('click', 'a.print_label', function() {
|
||||
var tr = $(this).parents('tr:first');
|
||||
var quantity = $('table.label-printing #label-quantity');
|
||||
if (isNaN(quantity.val())) {
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
<%def name="lookup_codes_panel()">
|
||||
<div class="panel-grid" id="product-codes">
|
||||
<h2>Additional Lookup Codes</h2>
|
||||
<div class="newgrid full no-border">
|
||||
<div class="grid full no-border">
|
||||
<table>
|
||||
<thead>
|
||||
<th>Seq</th>
|
||||
|
@ -176,7 +176,7 @@
|
|||
<%def name="sources_panel()">
|
||||
<div class="panel-grid" id="product-costs">
|
||||
<h2>Vendor Sources</h2>
|
||||
<div class="newgrid full no-border">
|
||||
<div class="grid full no-border">
|
||||
<table>
|
||||
<thead>
|
||||
<th>Pref.</th>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/master/index.mako" />
|
||||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/master2/index.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
${parent.context_menu_items()}
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/mobile/base.mako" />
|
||||
|
||||
<%def name="title()">New ${mode_title} Batch</%def>
|
||||
|
||||
${h.form(request.current_route_url(), class_='ui-filterable', name='new-purchasing-batch')}
|
||||
${h.csrf_token(request)}
|
||||
|
||||
% if vendor is Undefined:
|
||||
|
||||
<div class="field-wrapper vendor">
|
||||
<div class="field autocomplete" data-url="${url('vendors.autocomplete')}">
|
||||
${h.hidden('vendor')}
|
||||
${h.text('new-purchasing-batch-vendor-text', placeholder="Vendor name", autocomplete='off', **{'data-type': 'search'})}
|
||||
<ul data-role="listview" data-inset="true" data-filter="true" data-input="#new-purchasing-batch-vendor-text"></ul>
|
||||
<button type="button" style="display: none;">Change Vendor</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
${h.submit('submit', "Find purchase orders")}
|
||||
## <button type="button">New receiving from scratch</button>
|
||||
|
||||
% else: ## vendor is known
|
||||
|
||||
<div class="field-wrapper vendor">
|
||||
<div class="field">
|
||||
${h.hidden('vendor', value=vendor.uuid)}
|
||||
${vendor}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
% if purchases:
|
||||
${h.hidden('purchase')}
|
||||
<ul data-role="listview" data-inset="true">
|
||||
% for uuid, purchase in purchases:
|
||||
<li data-uuid="${uuid}">${h.link_to(purchase, '#')}</li>
|
||||
% endfor
|
||||
</ul>
|
||||
% else:
|
||||
<p>(no eligible purchases found)</p>
|
||||
% endif
|
||||
|
||||
## ${h.link_to("Receive from scratch for {}".format(vendor), '#', class_='ui-btn ui-corner-all')}
|
||||
${h.link_to("Start over", url('purchases.batch.mobile_create'), class_='ui-btn ui-corner-all')}
|
||||
|
||||
% endif
|
||||
|
||||
${h.end_form()}
|
|
@ -1,5 +1,5 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/master/index.mako" />
|
||||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/master2/index.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
${parent.context_menu_items()}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
## -*- coding: utf-8; -*-
|
||||
<%namespace file="/shifts/base.mako" import="timesheet" />
|
||||
<%namespace file="/shifts/schedule.mako" import="render_day" />
|
||||
<html>
|
||||
|
@ -6,7 +6,7 @@
|
|||
## TODO: this seems a little hacky..?
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/normalize.css'), media='all')}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/base.css'), media='all')}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/newgrids.css'), media='all')}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/grids.css'), media='all')}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/timesheet.css'), media='all')}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/schedule_print.css'), media='print')}
|
||||
</head>
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="tailbone:templates/master/index.mako" />
|
||||
|
||||
<%def name="content_title()"></%def>
|
||||
|
||||
${parent.body()}
|
6
tailbone/templates/themes/better/master2/index.mako
Normal file
6
tailbone/templates/themes/better/master2/index.mako
Normal file
|
@ -0,0 +1,6 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="tailbone:templates/master2/index.mako" />
|
||||
|
||||
<%def name="content_title()"></%def>
|
||||
|
||||
${parent.body()}
|
Loading…
Add table
Add a link
Reference in a new issue