Refactor "edit printer settings" view for Label Profile

for sake of Buefy, but it was definitely using some old form patterns...
This commit is contained in:
Lance Edgar 2019-05-23 17:58:46 -05:00
parent a37b0229a0
commit 5907973d42
3 changed files with 86 additions and 73 deletions

View file

@ -1,5 +1,5 @@
## -*- coding: utf-8 -*-
<%inherit file="/base.mako" />
## -*- coding: utf-8; -*-
<%inherit file="/form.mako" />
<%def name="title()">Printer Settings</%def>
@ -9,42 +9,5 @@
<li>${h.link_to("Edit this Label Profile", url('labelprofiles.edit', 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())}
${h.csrf_token(request)}
% for name, display in printer.required_settings.items():
<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('labelprofiles.view', uuid=profile.uuid)}';">Cancel</button>
</div>
${h.end_form()}
</div>
</div>
${parent.body()}