Add an _icon helper method; add icons to almost all buttons
This commit is contained in:
parent
e43821dc69
commit
67d0b60a9f
25
stoptime.rb
25
stoptime.rb
|
@ -1897,6 +1897,7 @@ module StopTime::Views
|
||||||
div.btn_group.navbar_right do
|
div.btn_group.navbar_right do
|
||||||
a.btn.btn_default.btn_sm.dropdown_toggle :role => "button",
|
a.btn.btn_default.btn_sm.dropdown_toggle :role => "button",
|
||||||
:href => "#", "data-toggle" => "dropdown" do
|
:href => "#", "data-toggle" => "dropdown" do
|
||||||
|
_icon("filter")
|
||||||
text! @input["show"] == "all" ? "All" : "Unbilled"
|
text! @input["show"] == "all" ? "All" : "Unbilled"
|
||||||
span.caret
|
span.caret
|
||||||
end
|
end
|
||||||
|
@ -1936,6 +1937,7 @@ module StopTime::Views
|
||||||
if @time_entry.present?
|
if @time_entry.present?
|
||||||
a.btn.btn_default :role => "button",
|
a.btn.btn_default :role => "button",
|
||||||
:href => R(CustomersN, @time_entry.customer.id) do
|
:href => R(CustomersN, @time_entry.customer.id) do
|
||||||
|
_icon("user")
|
||||||
span "Show customer"
|
span "Show customer"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1952,6 +1954,7 @@ module StopTime::Views
|
||||||
:href => R(CustomersNTasksN,
|
:href => R(CustomersNTasksN,
|
||||||
@time_entry.customer.id,
|
@time_entry.customer.id,
|
||||||
@time_entry.task.id) do
|
@time_entry.task.id) do
|
||||||
|
_icon("pencil")
|
||||||
span "Show project/task"
|
span "Show project/task"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1965,6 +1968,7 @@ module StopTime::Views
|
||||||
:href => R(CustomersNInvoicesX,
|
:href => R(CustomersNInvoicesX,
|
||||||
@time_entry.customer.id,
|
@time_entry.customer.id,
|
||||||
@time_entry.task.invoice.number) do
|
@time_entry.task.invoice.number) do
|
||||||
|
_icon("file")
|
||||||
span @time_entry.task.invoice.number
|
span @time_entry.task.invoice.number
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2010,6 +2014,7 @@ module StopTime::Views
|
||||||
text! "Customers"
|
text! "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")
|
||||||
span "Add new customer"
|
span "Add new customer"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2143,6 +2148,7 @@ module StopTime::Views
|
||||||
div.btn_group.navbar_right do
|
div.btn_group.navbar_right do
|
||||||
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")
|
||||||
span "Add new project/task"
|
span "Add new project/task"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2269,6 +2275,7 @@ module StopTime::Views
|
||||||
div.col_sm_offset_1.col_sm_3.hidden_xs do
|
div.col_sm_offset_1.col_sm_3.hidden_xs do
|
||||||
a.btn.btn_default :role => "button",
|
a.btn.btn_default :role => "button",
|
||||||
:href => R(CustomersN, @customer.id) do
|
:href => R(CustomersN, @customer.id) do
|
||||||
|
_icon("user")
|
||||||
span "Show customer"
|
span "Show customer"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2309,6 +2316,7 @@ module StopTime::Views
|
||||||
:href => R(CustomersNInvoicesX,
|
:href => R(CustomersNInvoicesX,
|
||||||
@customer.id,
|
@customer.id,
|
||||||
@task.invoice.number) do
|
@task.invoice.number) do
|
||||||
|
_icon("file")
|
||||||
span @task.invoice.number
|
span @task.invoice.number
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2354,6 +2362,7 @@ module StopTime::Views
|
||||||
div.btn_group.navbar_right do
|
div.btn_group.navbar_right do
|
||||||
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")
|
||||||
span "Create new invoice"
|
span "Create new invoice"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2506,16 +2515,19 @@ module StopTime::Views
|
||||||
:href => R(CustomersNInvoicesX,
|
:href => R(CustomersNInvoicesX,
|
||||||
@customer.id,
|
@customer.id,
|
||||||
"#{@invoice.number}.pdf") do
|
"#{@invoice.number}.pdf") do
|
||||||
|
_icon("download")
|
||||||
span "Download PDF"
|
span "Download PDF"
|
||||||
end
|
end
|
||||||
a.btn.btn_default :role => "button",
|
a.btn.btn_default :role => "button",
|
||||||
:href => R(CustomersNInvoicesX,
|
:href => R(CustomersNInvoicesX,
|
||||||
@customer.id,
|
@customer.id,
|
||||||
"#{@invoice.number}.tex") do
|
"#{@invoice.number}.tex") do
|
||||||
|
_icon("download")
|
||||||
span "Download LaTeX source"
|
span "Download LaTeX source"
|
||||||
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
|
||||||
|
_icon("briefcase")
|
||||||
span "Show company info"
|
span "Show company info"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2525,6 +2537,7 @@ module StopTime::Views
|
||||||
@customer.id, @invoice.number),
|
@customer.id, @invoice.number),
|
||||||
:method => :delete do
|
:method => :delete do
|
||||||
button.btn.btn_danger :type => "submit" do
|
button.btn.btn_danger :type => "submit" do
|
||||||
|
_icon("trash")
|
||||||
span "Remove old"
|
span "Remove old"
|
||||||
end
|
end
|
||||||
text! "An invoice has already been generated!"
|
text! "An invoice has already been generated!"
|
||||||
|
@ -2714,6 +2727,7 @@ module StopTime::Views
|
||||||
if @company.original.present?
|
if @company.original.present?
|
||||||
a.btn.btn_default :role => "button",
|
a.btn.btn_default :role => "button",
|
||||||
:href => R(Company, :revision => @company.original.revision) do
|
:href => R(Company, :revision => @company.original.revision) do
|
||||||
|
_icon("backward")
|
||||||
span "View previous revision"
|
span "View previous revision"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2764,6 +2778,13 @@ module StopTime::Views
|
||||||
#
|
#
|
||||||
private
|
private
|
||||||
|
|
||||||
|
# Parial view that generates an icon.
|
||||||
|
#
|
||||||
|
# @return [Mab::Mixin::Tag] the icon
|
||||||
|
def _icon(name)
|
||||||
|
span.glyphicon.send("glyphicon_#{name}", {:"aria-hidden" => true})
|
||||||
|
end
|
||||||
|
|
||||||
# Partial view that generates the menu.
|
# Partial view that generates the menu.
|
||||||
#
|
#
|
||||||
# @return [Mab::Mixin::Tag] the main menu
|
# @return [Mab::Mixin::Tag] the main menu
|
||||||
|
@ -2841,7 +2862,7 @@ module StopTime::Views
|
||||||
td { _format_period(invoice.period) }
|
td { _format_period(invoice.period) }
|
||||||
td.text_right { "€ %.2f" % invoice.total_amount }
|
td.text_right { "€ %.2f" % invoice.total_amount }
|
||||||
td do
|
td do
|
||||||
i(:class => "icon-ok") if invoice.paid?
|
_icon("ok") if invoice.paid?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -3121,7 +3142,7 @@ module StopTime::Views
|
||||||
end
|
end
|
||||||
td.col_md_1 { "%.2fh" % entry.hours_total }
|
td.col_md_1 { "%.2fh" % entry.hours_total }
|
||||||
td.col_md_1 do
|
td.col_md_1 do
|
||||||
i(:class => "icon-ok") if entry.bill?
|
_icon("ok") if entry.bill?
|
||||||
end
|
end
|
||||||
td.col_md_1 do
|
td.col_md_1 do
|
||||||
form.form_inline :action => R(TimelineN, entry.id),
|
form.form_inline :action => R(TimelineN, entry.id),
|
||||||
|
|
Loading…
Reference in New Issue