From 109920f5caaab368ac645d8d3946c53e7065dd91 Mon Sep 17 00:00:00 2001 From: Louis Knapp Date: Sun, 18 Dec 2016 10:16:56 -0600 Subject: [PATCH] lk | improves client receipt format --- app/assets/stylesheets/client_receipt.scss | 25 ++++- app/models/bike.rb | 2 +- app/views/clients/_receipt.html.haml | 111 +++++++++------------ 3 files changed, 71 insertions(+), 67 deletions(-) diff --git a/app/assets/stylesheets/client_receipt.scss b/app/assets/stylesheets/client_receipt.scss index f2f9c01..ebc167c 100644 --- a/app/assets/stylesheets/client_receipt.scss +++ b/app/assets/stylesheets/client_receipt.scss @@ -1,6 +1,8 @@ .print-receipts, .freecyclery-receipt{ h2 { + padding-left: 25px; font-size: 18px; + font-weight: bold; } .horizontal-line{ width: 100%; @@ -10,6 +12,27 @@ page-break-inside: avoid; margin: 10px; border: 5px solid black; - height: 400px; + height: 425px; } + .client-information { + padding: 5px; + margin-left: 25px; + } + .receipt-body { + font-size: 10px; + line-height: 120%; + margin-left: 5px; + p { + font-size: 10px; + border-bottom: 0; + padding-bottom: 0; + margin-bottom: 0; + } + } +} + +.container.print-receipts { + margin-top: -50px; + width: 100%; } + diff --git a/app/models/bike.rb b/app/models/bike.rb index 4a16c24..e2e7115 100644 --- a/app/models/bike.rb +++ b/app/models/bike.rb @@ -30,7 +30,7 @@ class Bike < ActiveRecord::Base end def name - self.color + " " + self.brand + ' ' + self.model + " (" + self.log_number.to_s + ")" + (self.color + " " + self.brand + ' ' + self.model + " (" + self.log_number.to_s + ")").titleize end def client diff --git a/app/views/clients/_receipt.html.haml b/app/views/clients/_receipt.html.haml index 7bca97c..95a6dcf 100644 --- a/app/views/clients/_receipt.html.haml +++ b/app/views/clients/_receipt.html.haml @@ -1,78 +1,59 @@ .col-xs-6 .receipt - %h2 - %strong= client.bike.name + %h2= client.bike.name %br .horizontal-line .client-information - = client.name - %br - = client.agency.name if client.agency + %strong= "#{client.name}#{" - " + client.agency.name if client.agency}" .horizontal-line - %br - Includes: - %br - = 'Helmet' if client.helmet - %br - = 'Lock' if client.lock - %br - %br - Date Received - %br - _______________ - %br - Client Signature - %br - %br - ________________ - %br - Recyclery Volunteer Initials - %br - %br - ___ - %br - CLIENT COPY + .receipt-body + %p= "Includes Helmet" if client.helmet + %p= "Includes Lock" if client.lock + %p= "Owes $25" if client.will_pay + %br + %p Date ___________________ + %br + %br + _______________________________________________ + %br + Client Signature + %br + %br + %br + ____________ Recyclery Initials .col-xs-6 .receipt - %h2 - %strong= client.bike.name + %h2= client.bike.name %br .horizontal-line .client-information - = client.name - %br - = client.agency.name if client.agency + %strong= "#{client.name}#{" - " + client.agency.name if client.agency}" .horizontal-line - .row - .col-xs-6 - %br - = 'Will make 25$ payment for lock and helmet' if client.will_pay - %br - Includes: - %br - = 'Helmet' if client.helmet - %br - = 'Lock' if client.lock - %br - %br - Date Received - %br - _______________ - %br - Client Signature - %br - %br - ________________ - .col-xs-6 - .client-info-header CLIENT INFO - .client-email= "Contact Email: " + client.agency.email - .client-phone= "Contact Phone #: " + client.agency.phone - .client-photo-consent [ ] I grant consent to the Recyclery to use and publish photographs of me. - %br - Recyclery Volunteer Initials - %br - %br - ___ - %br - RECYCLERY COPY + .receipt-body + %p= "Includes Helmet" if client.helmet + %p= "Includes Lock" if client.lock + %p= "Owes $25" if client.will_pay + %br + %p Date ___________________ + %br + %br + _______________________________________________ + %br + Client Signature + %br + %br + ____________ Recyclery Initials + %br + %br + %br + _______________________________________________ + %br + Contact Email + %br + %br + _________________________________ Contact Phone + %br + %br + ▢ Client grants The Recyclery Collective consent to use and publish photos. +