extensive commit (see note)

The following changes are included:

- Added support for GPC data type.

- Added eager import of ``rattail.sil`` in ``before_render`` hook.

- Removed ``rattail.pyramid.util`` module.

- Added initial batch support: views, templates, creation from Product grid.

- Added batch params template for ``PrintLabels`` provider.

- Added support for ``rattail.LabelProfile`` class.

- Improved Product grid to include filter/sort on Vendor.
This commit is contained in:
Lance Edgar 2012-08-29 11:37:17 -07:00
parent 563a10a283
commit cf10fe19e8
36 changed files with 1166 additions and 1529 deletions

View file

@ -0,0 +1,26 @@
<%inherit file="/crud.mako" />
<%def name="head_tags()">
${parent.head_tags()}
<style type="text/css">
div.form div.field-wrapper.format textarea {
width: auto;
}
</style>
</%def>
<%def name="context_menu_items()">
<li>${h.link_to("Back to Label Profiles", url('label_profiles'))}</li>
% if form.updating:
<% profile = form.fieldset.model %>
<% printer = profile.get_printer() %>
% if printer.required_settings:
<li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li>
% endif
<li>${h.link_to("View this Label Profile", url('label_profile.read', uuid=profile.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Label Profiles</%def>
<%def name="context_menu_items()">
% if request.has_perm('label_profiles.create'):
<li>${h.link_to("Create a new Label Profile", url('label_profile.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,48 @@
<%inherit file="/base.mako" />
<%def name="title()">Printer Settings</%def>
<%def name="context_menu_items()">
<li>${h.link_to("Back to Label Profiles", url('label_profiles'))}</li>
<li>${h.link_to("View this Label Profile", url('label_profile.read', uuid=profile.uuid))}</li>
<li>${h.link_to("Edit this Label Profile", url('label_profile.update', uuid=profile.uuid))}</li>
</%def>
<div class="form-wrapper">
<ul class="context-menu">
${self.context_menu_items()}
</ul>
<div class="form">
<div class="field-wrapper">
<label>Label Profile</label>
<div class="field">${profile.description}</div>
</div>
<div class="field-wrapper">
<label>Printer Spec</label>
<div class="field">${profile.printer_spec}</div>
</div>
${h.form(request.current_route_url())}
% for name, display in printer.required_settings.iteritems():
<div class="field-wrapper">
<label for="${name}">${display}</label>
<div class="field">
${h.text(name, value=profile.get_printer_setting(name))}
</div>
</div>
% endfor
<div class="buttons">
${h.submit('update', "Update")}
<button type="button" onclick="location.href = '${url('label_profile.read', uuid=profile.uuid)}';">Cancel</button>
</div>
${h.end_form()}
</div>
</div>

View file

@ -0,0 +1,32 @@
<%inherit file="/labels/profiles/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Label Profiles", url('label_profiles'))}</li>
% if form.readonly and request.has_perm('label_profiles.update'):
<% profile = form.fieldset.model %>
<% printer = profile.get_printer() %>
<li>${h.link_to("Edit this Label Profile", url('label_profile.update', uuid=form.fieldset.model.uuid))}</li>
% if printer.required_settings:
<li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li>
% endif
% endif
</%def>
${parent.body()}
<% profile = form.fieldset.model %>
<% printer = profile.get_printer() %>
% if printer.required_settings:
<h2>Printer Settings</h2>
<div class="form">
% for name, display in printer.required_settings.iteritems():
<div class="field-wrapper">
<label>${display}</label>
<div class="field">${profile.get_printer_setting(name) or ''}</div>
</div>
% endfor
</div>
% endif