From 3852c854320566a8be698fde7009acd5150a2c0f Mon Sep 17 00:00:00 2001 From: Louis Knapp Date: Tue, 29 Dec 2015 14:08:40 -0600 Subject: [PATCH] lk | receipt button appears when client has a bike --- app/views/clients/_receipt_button.html.haml | 2 ++ app/views/clients/edit.html.haml | 1 + app/views/freecyclery/receipt.html.haml | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 app/views/clients/_receipt_button.html.haml diff --git a/app/views/clients/_receipt_button.html.haml b/app/views/clients/_receipt_button.html.haml new file mode 100644 index 0000000..68dc20c --- /dev/null +++ b/app/views/clients/_receipt_button.html.haml @@ -0,0 +1,2 @@ +.btn.btn-default + = link_to 'Print Receipt', client_receipt_path(@client) diff --git a/app/views/clients/edit.html.haml b/app/views/clients/edit.html.haml index 1e9a666..bf49440 100644 --- a/app/views/clients/edit.html.haml +++ b/app/views/clients/edit.html.haml @@ -1,4 +1,5 @@ .container %h1 Edit client + = render 'receipt_button' if @client.bike_id = render 'form' = link_to 'Back', clients_path diff --git a/app/views/freecyclery/receipt.html.haml b/app/views/freecyclery/receipt.html.haml index b0e67b0..1441828 100644 --- a/app/views/freecyclery/receipt.html.haml +++ b/app/views/freecyclery/receipt.html.haml @@ -10,7 +10,7 @@ .client-information = @client.name %br - = @client.agency.agency_name + = @client.agency.agency_name if @client.agency .horizontal-line %br = 'Paid $25 for lock and helmet' if @client.will_pay @@ -47,7 +47,7 @@ .client-information = @client.name %br - = @client.agency.agency_name + = @client.agency.agency_name if @client.agency .horizontal-line %br = 'Paid $25 for lock and helmet' if @client.will_pay