Move the customers table into a more narrow row

This commit is contained in:
Paul van Tilburg 2015-06-20 23:30:56 +02:00
parent ad4362f471
commit 43b9c1336f
1 changed files with 56 additions and 52 deletions

View File

@ -2029,59 +2029,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
@ -2776,7 +2780,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