From ad4362f4716f39155bc4583f13a212af2f57b2b6 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 20 Jun 2015 23:30:02 +0200 Subject: [PATCH 01/14] Allow for forward navigation through the company info versions in the view --- stoptime.rb | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index b3fc9c3..e74f35f 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1679,6 +1679,7 @@ module StopTime::Controllers else CompanyInfo.last end + @company_last = @company == CompanyInfo.last @input = @company.attributes @history_warn = true if @company != CompanyInfo.last render :company_form @@ -2745,11 +2746,25 @@ module StopTime::Views div.alert.alert_info do text! " Viewing revision #{@company.revision}, " + " last update at #{@company.updated_at}." - if @company.original.present? - a.btn.btn_default role: "button", - href: R(Company, revision: @company.original.revision) do - _icon("backward") - span "View previous revision" + div.btn_group do + if @company.original.present? + a.btn.btn_default role: "button", + href: R(Company, revision: @company.original.revision) do + _icon("backward") + span "View previous revision" + end + end + unless @company_last + a.btn.btn_default role: "button", + href: R(Company, revision: @company.revision.succ) do + _icon("forward") + span "View next revision" + end + a.btn.btn_default role: "button", + href: R(Company) do + _icon("fast-forward") + span "Most recent revision" + end end end end From 43b9c1336f207be363ba0635975bcfe4926bbf71 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 20 Jun 2015 23:30:56 +0200 Subject: [PATCH 02/14] Move the customers table into a more narrow row --- stoptime.rb | 108 +++++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 52 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index e74f35f..0e680d1 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -2029,59 +2029,63 @@ module StopTime::Views "#{a "here", href: R(CustomersNew)}." end else - table.table.table_striped.table_condensed do - thead do - tr do - th.col_md_2.col_xs_5 "Name" - th.col_md_1.hidden_xs "Short name" - th.col_md_4.col_xs_5 "Address" - th.col_md_2.hidden_xs "Email" - th.col_md_2.hidden_xs "Phone" - th.col_md_1.col_xs_2 {} - end - end - tbody do - @customers.each do |customer| - tr do - td { a customer.name, href: R(CustomersN, customer.id) } - td.hidden_xs { customer.short_name || "–"} - td do - if customer.address_street.present? - text! customer.address_street - br - text! customer.address_postal_code + " " + - customer.address_city - if customer.email.present? - a.visible_xs customer.email, - href: "mailto:#{customer.email}" + div.row do + div.col_md_9.col_xs_12 do + table.table.table_striped.table_condensed do + thead do + tr do + th.col_md_2.col_xs_5 "Name" + th.col_md_2.hidden_xs "Short name" + th.col_md_3.col_xs_5 "Address" + th.col_md_2.hidden_xs "Email" + th.col_md_2.hidden_xs "Phone" + th.col_md_1.col_xs_2 {} + end + end + tbody do + @customers.each do |customer| + tr do + td { a customer.name, href: R(CustomersN, customer.id) } + td.hidden_xs { customer.short_name || "–"} + td do + if customer.address_street.present? + text! customer.address_street + br + text! customer.address_postal_code + " " + + customer.address_city + if customer.email.present? + a.visible_xs customer.email, + href: "mailto:#{customer.email}" + end + if customer.phone.present? + # FIXME: hardcoded prefix! + span.visible_xs "0#{customer.phone}" + end + else + "–" + end end - if customer.phone.present? - # FIXME: hardcoded prefix! - span.visible_xs "0#{customer.phone}" + td.hidden_xs do + if customer.email.present? + a customer.email, href: "mailto:#{customer.email}" + else + "–" + end + end + td.hidden_xs do + if customer.phone.present? + # FIXME: hardcoded prefix! + "0#{customer.phone}" + else + "–" + end + end + td do + form action: R(CustomersN, customer.id), method: :post do + button.btn.btn_xs.btn_danger "Delete", type: :submit, + name: "delete", value: "Delete" + end end - else - "–" - end - end - td.hidden_xs do - if customer.email.present? - a customer.email, href: "mailto:#{customer.email}" - else - "–" - end - end - td.hidden_xs do - if customer.phone.present? - # FIXME: hardcoded prefix! - "0#{customer.phone}" - else - "–" - end - end - td do - form action: R(CustomersN, customer.id), method: :post do - button.btn.btn_xs.btn_danger "Delete", type: :submit, - name: "delete", value: "Delete" end end end @@ -2776,7 +2780,7 @@ module StopTime::Views text! "Only make changes if you know what you are doing!" end if @history_warn div.row do - div.col_md_6.col_xs_12 do + div.col_md_8.col_xs_12 do form.form_horizontal.form_condensed \ action: R(Company, revision: @company.revision), method: :post do From 4eef4669a52d74e465519503cf444156259632a9 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:20:11 +0200 Subject: [PATCH 03/14] Only show unbilled time in the customer form Done so that it is the same as in the task form. Also the list of all time entries for a customer can be very long, thus creating a long load time of the customer form. --- stoptime.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stoptime.rb b/stoptime.rb index 0e680d1..103bbb4 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1025,7 +1025,8 @@ module StopTime::Controllers end end - @time_entries = @customer.time_entries.order("start DESC") + @time_entries = @customer.time_entries.order("start DESC")\ + .reject { |te| te.task.billed? } @invoices = @customer.invoices @invoices.each do |i| @input["paid_#{i.number}"] = true if i.paid? From 7ecece395021457041ba4280ec25113a1912fadb Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:21:33 +0200 Subject: [PATCH 04/14] Shorten some button labels --- stoptime.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index 103bbb4..742eea9 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -2019,7 +2019,7 @@ module StopTime::Views div.btn_group.navbar_right do a.btn.btn_default.btn_sm role: "button", href: R(CustomersNew) do _icon("plus") - span "Add new customer" + span "Add customer" end end end @@ -2159,7 +2159,7 @@ module StopTime::Views a.btn.btn_default.btn_sm role: "button", href: R(CustomersNTasksNew, @customer.id) do _icon("plus") - span "Add new project/task" + span "Add project/task" end end end @@ -2249,7 +2249,7 @@ module StopTime::Views a.btn.btn_default.btn_sm role: "button", href: R(CustomersNInvoicesNew, @customer.id) do _icon("plus") - span "Create new invoice" + span "Create invoice" end end end @@ -2388,7 +2388,7 @@ module StopTime::Views a.btn.btn_default.btn_sm role: "button", href: R(CustomersNInvoicesNew, customer.id) do _icon("plus") - span "Create new invoice" + span "Create invoice" end end end @@ -2551,7 +2551,7 @@ module StopTime::Views href: R(CustomersNInvoicesX, @customer.id, "#{@invoice.number}.tex") do _icon("download") - span "Download LaTeX source" + span "Download LaTeX" end a.btn.btn_default role: "button", href: R(Company, revision: @company.revision) do From 1cf130c1ddeb438969c30a4a2f04d8b807c22029 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:23:19 +0200 Subject: [PATCH 05/14] Tweaked some form grid column widths --- stoptime.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index 742eea9..104faab 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -2130,10 +2130,10 @@ module StopTime::Views _form_input_with_label("Financial contact", "financial_contact", :text, control_class: "col-sm-6 col-xs-8") _form_input_with_label("Default hourly rate", "hourly_rate", :text, - control_class: "col-sm-3 col-xs-4", + control_class: "col-sm-4 col-xs-5", input_addon: "€ / h") div.form_group do - label.control_label.col_sm_4.col_xs_4 "Time specifications?" + label.control_label.col_sm_3.col_xs_4 "Time specifications?" div.col_sm_6.col_xs_8 do div.checkbox do _form_input_checkbox("time_specification") @@ -2141,7 +2141,7 @@ module StopTime::Views end end div.form_group do - div.col_sm_offset_4.col_sm_6.col_xs_offset_4.col_xs_8 do + div.col_sm_offset_3.col_sm_6.col_xs_offset_4.col_xs_8 do button.btn.btn_primary @button.capitalize, type: "submit", name: @button, value: @button.capitalize button.btn.btn_default "Cancel", type: "submit", @@ -2301,7 +2301,7 @@ module StopTime::Views _form_input_with_label("Name", "name", :text) div.form_group do label.control_label.col_sm_3.col_xs_4 "Project/Task type" - div.col_sm_4.col_xs_8 do + div.col_sm_5.col_xs_8 do div.radio do label do _form_input_radio("type", "hourly_rate", true) @@ -2325,7 +2325,7 @@ module StopTime::Views end end _form_input_with_label("VAT rate", "vat_rate", :number, - control_class: "col-sm-3 col-xs-6", + control_class: "col-lg-3 col-sm-4 col-xs-6", input_addon: "%") if @task.billed? div.form_group do @@ -2450,7 +2450,7 @@ module StopTime::Views end end div.form_group do - div.col_sm_offset_3.col_sm_4.col_xs_offset_4.col_xs_8 do + div.col_sm_offset_3.col_sm_6.col_xs_offset_4.col_xs_8 do button.btn.btn_primary "Update", type: :submit, name: "update", value: "Update" button.btn.btn_default "Reset", type: :reset, From 16b13de52c1cdbfbe2e04d6dd5d067737eb78bb8 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:23:28 +0200 Subject: [PATCH 06/14] Reduce the padding in form controls --- templates/sass/style.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/sass/style.sass b/templates/sass/style.sass index 83b8b28..937277f 100644 --- a/templates/sass/style.sass +++ b/templates/sass/style.sass @@ -37,6 +37,9 @@ footer .btn-group margin-bottom: 8px +.form-control + padding: 4px 6px + /* Table layout */ table table-layout: fixed From 58ec60ab60d4de21e80ac7d223e914a4cb277f2f Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:23:50 +0200 Subject: [PATCH 07/14] Add an anchor for timelines Also expand the customer timeline table row to have full width. --- stoptime.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index 104faab..fc54c63 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -2260,8 +2260,8 @@ module StopTime::Views # Show registered time using the time_entries view as partial view. div.row do - div.col_md_10.col_xs_12 do - h2 "Registered time" + div.col_xs_12 do + h2.timeline! "Registered unbilled time" _time_entries(@customer) end end unless @button == "create" @@ -2356,7 +2356,7 @@ module StopTime::Views # Show registered time (ab)using the time_entries view as partial view. div.row do div.col_md_8.col_xs_12 do - h2 "Registered #{@task.billed? ? "billed" : "unbilled"} time" + h2.timeline! "Registered #{@task.billed? ? "billed" : "unbilled"} time" _time_entries(@customer, @task) end end unless @method == "create" From 23af29b8008420e08e9afcd1ee1dd8ef7394d592 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:29:03 +0200 Subject: [PATCH 08/14] Add missing subtitle on the customers view --- stoptime.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/stoptime.rb b/stoptime.rb index fc54c63..ba6a739 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -2016,6 +2016,7 @@ module StopTime::Views header.page_header do h1 do text! "Customers" + small "#{@customers.count} customers" div.btn_group.navbar_right do a.btn.btn_default.btn_sm role: "button", href: R(CustomersNew) do _icon("plus") From 5160e79953498c569253d1394db2219f7dfbbbf0 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:29:35 +0200 Subject: [PATCH 09/14] Actually count and show the active projects/tasks in the overview --- stoptime.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stoptime.rb b/stoptime.rb index ba6a739..c26bb22 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -905,6 +905,7 @@ module StopTime::Controllers @tasks = {} @task_count = 0 @active_tasks = {} + @active_task_count = 0 @active_tasks_summary = {} @totals = [0.0, 0,0] Customer.all.each do |customer| @@ -913,6 +914,7 @@ module StopTime::Controllers @task_count += tasks.count active_tasks = customer.active_tasks @active_tasks[customer] = active_tasks + @active_task_count += active_tasks.count @active_tasks_summary[customer] = active_tasks.inject([0.0, 0.0]) do |summ, task| task_summ = task.summary @@ -1800,7 +1802,8 @@ module StopTime::Views header.page_header do h1 do text! "Overview" - small "#{@tasks.count} customers, #{@task_count} active projects/tasks" + small "#{@tasks.count} customers, " + + "#{@active_task_count} active projects/tasks" end end if @tasks.empty? From ebd220aac6b48c759df6f78b48f6dc8b07354d6b Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:38:29 +0200 Subject: [PATCH 10/14] Also add missing subtitle in the invoice form --- stoptime.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/stoptime.rb b/stoptime.rb index c26bb22..da8d736 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -2413,6 +2413,7 @@ module StopTime::Views h1 do text! "Invoice for " a @customer.name, href: R(CustomersN, @customer.id) + small @invoice.number end end div.row do From 1e33df19d6286b557c22484d09fd8cc55fb4d34b Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:39:41 +0200 Subject: [PATCH 11/14] Small Sass reformatting --- templates/sass/style.sass | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/sass/style.sass b/templates/sass/style.sass index 937277f..6780b91 100644 --- a/templates/sass/style.sass +++ b/templates/sass/style.sass @@ -37,9 +37,6 @@ footer .btn-group margin-bottom: 8px -.form-control - padding: 4px 6px - /* Table layout */ table table-layout: fixed @@ -55,7 +52,6 @@ table th overflow: hidden - table.table-condensed td.indent padding-left: 20px @@ -81,6 +77,9 @@ table.grand-total .form-group margin-bottom: 8px +.form-control + padding: 4px 6px + .form-inline label padding-top: 6px From f5d2c5af08a0d0f1bab3f55d271fd05002b9ae54 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:42:02 +0200 Subject: [PATCH 12/14] Rename the time entry filter param --- stoptime.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index da8d736..5c5d7aa 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1488,7 +1488,7 @@ module StopTime::Controllers # Retrieves all registered time in descending order to present # the timeline using {Views#timeline}. def get - if @input["show"] == "all" + if @input["time_entries"] == "all" @time_entries = TimeEntry.order("start DESC") else @time_entries = TimeEntry.joins(:task)\ @@ -1905,12 +1905,12 @@ module StopTime::Views a.btn.btn_default.btn_sm.dropdown_toggle role: "button", href: "#", data_toggle: "dropdown" do _icon("filter") - text! @input["show"] == "all" ? "All" : "Unbilled" + text! @input["time_entries"] == "all" ? "All" : "Unbilled" span.caret end ul.dropdown_menu role: "menu", aria_labelledby: "dLabel" do - li { a "All", href: R(Timeline, show: "all") } - li { a "Unbilled", href: R(Timeline, show: "unbilled") } + li { a "All", href: R(Timeline, time_entries: "all") } + li { a "Unbilled", href: R(Timeline, time_entries: "unbilled") } end end end From 1376ac3828774cf0f7ee094f39caa3c48a9a9503 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:48:40 +0200 Subject: [PATCH 13/14] Bump version to 1.16.1 --- stoptime.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stoptime.rb b/stoptime.rb index 5c5d7aa..8dbef5b 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -55,7 +55,7 @@ end module StopTime # The version of the application - VERSION = '1.16.0' + VERSION = '1.16.1' puts "Starting Stop… Camping Time! version #{VERSION}" # @return [Hash{String=>Object}] The parsed configuration. From 8c15c2f31852be90a5ec2fe2de1f240cb3d9f43e Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 11 Jul 2015 21:51:02 +0200 Subject: [PATCH 14/14] Update the changelog for the 1.16.1 release --- CHANGELOG.rdoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 7291dbf..6ec4f8e 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -1,5 +1,14 @@ = Stop… Camping Time! release news +== 1.16.1 + +Features: + +* Allow back/forth navigation through company info version +* Only show unbilled time in the customer from (load time improvement!) +* Tweaked some form input sizes +* Add missing view subtitles + == 1.16.0 Features: