Merge branch 'release/1.16.1'
This commit is contained in:
commit
3c8cc821d7
3 changed files with 115 additions and 79 deletions
|
@ -1,5 +1,14 @@
|
||||||
= Stop… Camping Time! release news
|
= 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
|
== 1.16.0
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
181
stoptime.rb
181
stoptime.rb
|
@ -55,7 +55,7 @@ end
|
||||||
module StopTime
|
module StopTime
|
||||||
|
|
||||||
# The version of the application
|
# The version of the application
|
||||||
VERSION = '1.16.0'
|
VERSION = '1.16.1'
|
||||||
puts "Starting Stop… Camping Time! version #{VERSION}"
|
puts "Starting Stop… Camping Time! version #{VERSION}"
|
||||||
|
|
||||||
# @return [Hash{String=>Object}] The parsed configuration.
|
# @return [Hash{String=>Object}] The parsed configuration.
|
||||||
|
@ -905,6 +905,7 @@ module StopTime::Controllers
|
||||||
@tasks = {}
|
@tasks = {}
|
||||||
@task_count = 0
|
@task_count = 0
|
||||||
@active_tasks = {}
|
@active_tasks = {}
|
||||||
|
@active_task_count = 0
|
||||||
@active_tasks_summary = {}
|
@active_tasks_summary = {}
|
||||||
@totals = [0.0, 0,0]
|
@totals = [0.0, 0,0]
|
||||||
Customer.all.each do |customer|
|
Customer.all.each do |customer|
|
||||||
|
@ -913,6 +914,7 @@ module StopTime::Controllers
|
||||||
@task_count += tasks.count
|
@task_count += tasks.count
|
||||||
active_tasks = customer.active_tasks
|
active_tasks = customer.active_tasks
|
||||||
@active_tasks[customer] = active_tasks
|
@active_tasks[customer] = active_tasks
|
||||||
|
@active_task_count += active_tasks.count
|
||||||
@active_tasks_summary[customer] =
|
@active_tasks_summary[customer] =
|
||||||
active_tasks.inject([0.0, 0.0]) do |summ, task|
|
active_tasks.inject([0.0, 0.0]) do |summ, task|
|
||||||
task_summ = task.summary
|
task_summ = task.summary
|
||||||
|
@ -1025,7 +1027,8 @@ module StopTime::Controllers
|
||||||
end
|
end
|
||||||
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 = @customer.invoices
|
||||||
@invoices.each do |i|
|
@invoices.each do |i|
|
||||||
@input["paid_#{i.number}"] = true if i.paid?
|
@input["paid_#{i.number}"] = true if i.paid?
|
||||||
|
@ -1485,7 +1488,7 @@ module StopTime::Controllers
|
||||||
# Retrieves all registered time in descending order to present
|
# Retrieves all registered time in descending order to present
|
||||||
# the timeline using {Views#timeline}.
|
# the timeline using {Views#timeline}.
|
||||||
def get
|
def get
|
||||||
if @input["show"] == "all"
|
if @input["time_entries"] == "all"
|
||||||
@time_entries = TimeEntry.order("start DESC")
|
@time_entries = TimeEntry.order("start DESC")
|
||||||
else
|
else
|
||||||
@time_entries = TimeEntry.joins(:task)\
|
@time_entries = TimeEntry.joins(:task)\
|
||||||
|
@ -1679,6 +1682,7 @@ module StopTime::Controllers
|
||||||
else
|
else
|
||||||
CompanyInfo.last
|
CompanyInfo.last
|
||||||
end
|
end
|
||||||
|
@company_last = @company == CompanyInfo.last
|
||||||
@input = @company.attributes
|
@input = @company.attributes
|
||||||
@history_warn = true if @company != CompanyInfo.last
|
@history_warn = true if @company != CompanyInfo.last
|
||||||
render :company_form
|
render :company_form
|
||||||
|
@ -1798,7 +1802,8 @@ module StopTime::Views
|
||||||
header.page_header do
|
header.page_header do
|
||||||
h1 do
|
h1 do
|
||||||
text! "Overview"
|
text! "Overview"
|
||||||
small "#{@tasks.count} customers, #{@task_count} active projects/tasks"
|
small "#{@tasks.count} customers, " +
|
||||||
|
"#{@active_task_count} active projects/tasks"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if @tasks.empty?
|
if @tasks.empty?
|
||||||
|
@ -1900,12 +1905,12 @@ module StopTime::Views
|
||||||
a.btn.btn_default.btn_sm.dropdown_toggle role: "button", href: "#",
|
a.btn.btn_default.btn_sm.dropdown_toggle role: "button", href: "#",
|
||||||
data_toggle: "dropdown" do
|
data_toggle: "dropdown" do
|
||||||
_icon("filter")
|
_icon("filter")
|
||||||
text! @input["show"] == "all" ? "All" : "Unbilled"
|
text! @input["time_entries"] == "all" ? "All" : "Unbilled"
|
||||||
span.caret
|
span.caret
|
||||||
end
|
end
|
||||||
ul.dropdown_menu role: "menu", aria_labelledby: "dLabel" do
|
ul.dropdown_menu role: "menu", aria_labelledby: "dLabel" do
|
||||||
li { a "All", href: R(Timeline, show: "all") }
|
li { a "All", href: R(Timeline, time_entries: "all") }
|
||||||
li { a "Unbilled", href: R(Timeline, show: "unbilled") }
|
li { a "Unbilled", href: R(Timeline, time_entries: "unbilled") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2014,10 +2019,11 @@ module StopTime::Views
|
||||||
header.page_header do
|
header.page_header do
|
||||||
h1 do
|
h1 do
|
||||||
text! "Customers"
|
text! "Customers"
|
||||||
|
small "#{@customers.count} customers"
|
||||||
div.btn_group.navbar_right do
|
div.btn_group.navbar_right do
|
||||||
a.btn.btn_default.btn_sm role: "button", href: R(CustomersNew) do
|
a.btn.btn_default.btn_sm role: "button", href: R(CustomersNew) do
|
||||||
_icon("plus")
|
_icon("plus")
|
||||||
span "Add new customer"
|
span "Add customer"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2028,59 +2034,63 @@ module StopTime::Views
|
||||||
"#{a "here", href: R(CustomersNew)}."
|
"#{a "here", href: R(CustomersNew)}."
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
table.table.table_striped.table_condensed do
|
div.row do
|
||||||
thead do
|
div.col_md_9.col_xs_12 do
|
||||||
tr do
|
table.table.table_striped.table_condensed do
|
||||||
th.col_md_2.col_xs_5 "Name"
|
thead do
|
||||||
th.col_md_1.hidden_xs "Short name"
|
tr do
|
||||||
th.col_md_4.col_xs_5 "Address"
|
th.col_md_2.col_xs_5 "Name"
|
||||||
th.col_md_2.hidden_xs "Email"
|
th.col_md_2.hidden_xs "Short name"
|
||||||
th.col_md_2.hidden_xs "Phone"
|
th.col_md_3.col_xs_5 "Address"
|
||||||
th.col_md_1.col_xs_2 {}
|
th.col_md_2.hidden_xs "Email"
|
||||||
end
|
th.col_md_2.hidden_xs "Phone"
|
||||||
end
|
th.col_md_1.col_xs_2 {}
|
||||||
tbody do
|
end
|
||||||
@customers.each do |customer|
|
end
|
||||||
tr do
|
tbody do
|
||||||
td { a customer.name, href: R(CustomersN, customer.id) }
|
@customers.each do |customer|
|
||||||
td.hidden_xs { customer.short_name || "–"}
|
tr do
|
||||||
td do
|
td { a customer.name, href: R(CustomersN, customer.id) }
|
||||||
if customer.address_street.present?
|
td.hidden_xs { customer.short_name || "–"}
|
||||||
text! customer.address_street
|
td do
|
||||||
br
|
if customer.address_street.present?
|
||||||
text! customer.address_postal_code + " " +
|
text! customer.address_street
|
||||||
customer.address_city
|
br
|
||||||
if customer.email.present?
|
text! customer.address_postal_code + " " +
|
||||||
a.visible_xs customer.email,
|
customer.address_city
|
||||||
href: "mailto:#{customer.email}"
|
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
|
end
|
||||||
if customer.phone.present?
|
td.hidden_xs do
|
||||||
# FIXME: hardcoded prefix!
|
if customer.email.present?
|
||||||
span.visible_xs "0#{customer.phone}"
|
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
|
||||||
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -2124,10 +2134,10 @@ module StopTime::Views
|
||||||
_form_input_with_label("Financial contact", "financial_contact", :text,
|
_form_input_with_label("Financial contact", "financial_contact", :text,
|
||||||
control_class: "col-sm-6 col-xs-8")
|
control_class: "col-sm-6 col-xs-8")
|
||||||
_form_input_with_label("Default hourly rate", "hourly_rate", :text,
|
_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")
|
input_addon: "€ / h")
|
||||||
div.form_group do
|
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.col_sm_6.col_xs_8 do
|
||||||
div.checkbox do
|
div.checkbox do
|
||||||
_form_input_checkbox("time_specification")
|
_form_input_checkbox("time_specification")
|
||||||
|
@ -2135,7 +2145,7 @@ module StopTime::Views
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
div.form_group do
|
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",
|
button.btn.btn_primary @button.capitalize, type: "submit",
|
||||||
name: @button, value: @button.capitalize
|
name: @button, value: @button.capitalize
|
||||||
button.btn.btn_default "Cancel", type: "submit",
|
button.btn.btn_default "Cancel", type: "submit",
|
||||||
|
@ -2153,7 +2163,7 @@ module StopTime::Views
|
||||||
a.btn.btn_default.btn_sm role: "button",
|
a.btn.btn_default.btn_sm role: "button",
|
||||||
href: R(CustomersNTasksNew, @customer.id) do
|
href: R(CustomersNTasksNew, @customer.id) do
|
||||||
_icon("plus")
|
_icon("plus")
|
||||||
span "Add new project/task"
|
span "Add project/task"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2243,7 +2253,7 @@ module StopTime::Views
|
||||||
a.btn.btn_default.btn_sm role: "button",
|
a.btn.btn_default.btn_sm role: "button",
|
||||||
href: R(CustomersNInvoicesNew, @customer.id) do
|
href: R(CustomersNInvoicesNew, @customer.id) do
|
||||||
_icon("plus")
|
_icon("plus")
|
||||||
span "Create new invoice"
|
span "Create invoice"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2254,8 +2264,8 @@ module StopTime::Views
|
||||||
|
|
||||||
# Show registered time using the time_entries view as partial view.
|
# Show registered time using the time_entries view as partial view.
|
||||||
div.row do
|
div.row do
|
||||||
div.col_md_10.col_xs_12 do
|
div.col_xs_12 do
|
||||||
h2 "Registered time"
|
h2.timeline! "Registered unbilled time"
|
||||||
_time_entries(@customer)
|
_time_entries(@customer)
|
||||||
end
|
end
|
||||||
end unless @button == "create"
|
end unless @button == "create"
|
||||||
|
@ -2295,7 +2305,7 @@ module StopTime::Views
|
||||||
_form_input_with_label("Name", "name", :text)
|
_form_input_with_label("Name", "name", :text)
|
||||||
div.form_group do
|
div.form_group do
|
||||||
label.control_label.col_sm_3.col_xs_4 "Project/Task type"
|
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
|
div.radio do
|
||||||
label do
|
label do
|
||||||
_form_input_radio("type", "hourly_rate", true)
|
_form_input_radio("type", "hourly_rate", true)
|
||||||
|
@ -2319,7 +2329,7 @@ module StopTime::Views
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
_form_input_with_label("VAT rate", "vat_rate", :number,
|
_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: "%")
|
input_addon: "%")
|
||||||
if @task.billed?
|
if @task.billed?
|
||||||
div.form_group do
|
div.form_group do
|
||||||
|
@ -2350,7 +2360,7 @@ module StopTime::Views
|
||||||
# Show registered time (ab)using the time_entries view as partial view.
|
# Show registered time (ab)using the time_entries view as partial view.
|
||||||
div.row do
|
div.row do
|
||||||
div.col_md_8.col_xs_12 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)
|
_time_entries(@customer, @task)
|
||||||
end
|
end
|
||||||
end unless @method == "create"
|
end unless @method == "create"
|
||||||
|
@ -2382,7 +2392,7 @@ module StopTime::Views
|
||||||
a.btn.btn_default.btn_sm role: "button",
|
a.btn.btn_default.btn_sm role: "button",
|
||||||
href: R(CustomersNInvoicesNew, customer.id) do
|
href: R(CustomersNInvoicesNew, customer.id) do
|
||||||
_icon("plus")
|
_icon("plus")
|
||||||
span "Create new invoice"
|
span "Create invoice"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2403,6 +2413,7 @@ module StopTime::Views
|
||||||
h1 do
|
h1 do
|
||||||
text! "Invoice for "
|
text! "Invoice for "
|
||||||
a @customer.name, href: R(CustomersN, @customer.id)
|
a @customer.name, href: R(CustomersN, @customer.id)
|
||||||
|
small @invoice.number
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
div.row do
|
div.row do
|
||||||
|
@ -2444,7 +2455,7 @@ module StopTime::Views
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
div.form_group do
|
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,
|
button.btn.btn_primary "Update", type: :submit,
|
||||||
name: "update", value: "Update"
|
name: "update", value: "Update"
|
||||||
button.btn.btn_default "Reset", type: :reset,
|
button.btn.btn_default "Reset", type: :reset,
|
||||||
|
@ -2545,7 +2556,7 @@ module StopTime::Views
|
||||||
href: R(CustomersNInvoicesX,
|
href: R(CustomersNInvoicesX,
|
||||||
@customer.id, "#{@invoice.number}.tex") do
|
@customer.id, "#{@invoice.number}.tex") do
|
||||||
_icon("download")
|
_icon("download")
|
||||||
span "Download LaTeX source"
|
span "Download LaTeX"
|
||||||
end
|
end
|
||||||
a.btn.btn_default role: "button",
|
a.btn.btn_default role: "button",
|
||||||
href: R(Company, revision: @company.revision) do
|
href: R(Company, revision: @company.revision) do
|
||||||
|
@ -2745,11 +2756,25 @@ module StopTime::Views
|
||||||
div.alert.alert_info do
|
div.alert.alert_info do
|
||||||
text! " Viewing revision #{@company.revision}, " +
|
text! " Viewing revision #{@company.revision}, " +
|
||||||
" last update at #{@company.updated_at}."
|
" last update at #{@company.updated_at}."
|
||||||
if @company.original.present?
|
div.btn_group do
|
||||||
a.btn.btn_default role: "button",
|
if @company.original.present?
|
||||||
href: R(Company, revision: @company.original.revision) do
|
a.btn.btn_default role: "button",
|
||||||
_icon("backward")
|
href: R(Company, revision: @company.original.revision) do
|
||||||
span "View previous revision"
|
_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
|
end
|
||||||
end
|
end
|
||||||
|
@ -2761,7 +2786,7 @@ module StopTime::Views
|
||||||
text! "Only make changes if you know what you are doing!"
|
text! "Only make changes if you know what you are doing!"
|
||||||
end if @history_warn
|
end if @history_warn
|
||||||
div.row do
|
div.row do
|
||||||
div.col_md_6.col_xs_12 do
|
div.col_md_8.col_xs_12 do
|
||||||
form.form_horizontal.form_condensed \
|
form.form_horizontal.form_condensed \
|
||||||
action: R(Company, revision: @company.revision),
|
action: R(Company, revision: @company.revision),
|
||||||
method: :post do
|
method: :post do
|
||||||
|
|
|
@ -52,7 +52,6 @@ table
|
||||||
th
|
th
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
|
||||||
|
|
||||||
table.table-condensed
|
table.table-condensed
|
||||||
td.indent
|
td.indent
|
||||||
padding-left: 20px
|
padding-left: 20px
|
||||||
|
@ -78,6 +77,9 @@ table.grand-total
|
||||||
.form-group
|
.form-group
|
||||||
margin-bottom: 8px
|
margin-bottom: 8px
|
||||||
|
|
||||||
|
.form-control
|
||||||
|
padding: 4px 6px
|
||||||
|
|
||||||
.form-inline
|
.form-inline
|
||||||
label
|
label
|
||||||
padding-top: 6px
|
padding-top: 6px
|
||||||
|
|
Loading…
Reference in a new issue