From 555935c71e8f944e4c9ed4757aa9af79676f6120 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 21 Feb 2017 14:27:16 -0600 Subject: [PATCH] Expose notes field for purchasing batches Plus various other tweaks for styles and coding conventions etc. --- tailbone/static/css/purchases.css | 5 +++++ tailbone/templates/forms/fieldset.mako | 4 +--- tailbone/templates/forms/lib.mako | 4 +--- tailbone/templates/purchases/batches/view.mako | 14 +++++++------- tailbone/views/purchases/batch.py | 2 ++ 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tailbone/static/css/purchases.css b/tailbone/static/css/purchases.css index 13ca518a..222c2199 100644 --- a/tailbone/static/css/purchases.css +++ b/tailbone/static/css/purchases.css @@ -6,3 +6,8 @@ div.field-wrapper { padding: 0; } + +.field-wrapper.notes .field { + line-height: 1.1em; + white-space: pre; +} diff --git a/tailbone/templates/forms/fieldset.mako b/tailbone/templates/forms/fieldset.mako index 8ffcc1e6..98fc47d8 100644 --- a/tailbone/templates/forms/fieldset.mako +++ b/tailbone/templates/forms/fieldset.mako @@ -13,9 +13,7 @@
${error}
% endfor ${field.label_tag()|n} -
- ${field.render()|n} -
+
${field.render()|n}
% if 'instructions' in field.metadata: ${field.metadata['instructions']} % endif diff --git a/tailbone/templates/forms/lib.mako b/tailbone/templates/forms/lib.mako index fb6067d9..602d35c4 100644 --- a/tailbone/templates/forms/lib.mako +++ b/tailbone/templates/forms/lib.mako @@ -4,9 +4,7 @@ % if field.requires_label:
${field.label_tag()|n} -
- ${field.render_readonly()} -
+
${field.render_readonly()}
% endif diff --git a/tailbone/templates/purchases/batches/view.mako b/tailbone/templates/purchases/batches/view.mako index 18b83db9..25be1af0 100644 --- a/tailbone/templates/purchases/batches/view.mako +++ b/tailbone/templates/purchases/batches/view.mako @@ -1,13 +1,8 @@ ## -*- coding: utf-8 -*- <%inherit file="/newbatch/view.mako" /> -<%def name="extra_styles()"> - ${parent.extra_styles()} - ${h.stylesheet_link(request.static_url('tailbone:static/css/purchases.css'))} - - -<%def name="head_tags()"> - ${parent.head_tags()} +<%def name="extra_javascript()"> + ${parent.extra_javascript()} +<%def name="extra_styles()"> + ${parent.extra_styles()} + ${h.stylesheet_link(request.static_url('tailbone:static/css/purchases.css'))} + + <%def name="leading_buttons()"> % if batch.mode == enum.PURCHASE_BATCH_MODE_ORDERING and not batch.complete and not batch.executed and request.has_perm('purchases.batch.order_form'): diff --git a/tailbone/views/purchases/batch.py b/tailbone/views/purchases/batch.py index 9b73a6f6..1eb1ebe7 100644 --- a/tailbone/views/purchases/batch.py +++ b/tailbone/views/purchases/batch.py @@ -143,6 +143,7 @@ class PurchaseBatchView(BatchMasterView): fs.po_number.set(label="PO Number") fs.po_total.set(label="PO Total", readonly=True, renderer=forms.renderers.CurrencyFieldRenderer) fs.invoice_total.set(readonly=True, renderer=forms.renderers.CurrencyFieldRenderer) + fs.notes.set(renderer=fa.TextAreaFieldRenderer, size=(80, 10)) fs.append(fa.Field('vendor_email', readonly=True, value=lambda b: b.vendor.email.address if b.vendor.email else None)) @@ -188,6 +189,7 @@ class PurchaseBatchView(BatchMasterView): fs.invoice_date, fs.invoice_number, fs.invoice_total, + fs.notes, fs.created, fs.created_by, fs.complete,