Move container divs to the a single container div in the layout view

This commit is contained in:
Paul van Tilburg 2013-06-20 21:15:52 +02:00
parent b19a0dfee3
commit 2dca39e38d
1 changed files with 556 additions and 592 deletions

View File

@ -1432,8 +1432,10 @@ module StopTime::Views
end
body do
_menu
div.container do
self << yield
footer { br }
end
# JQuery and Bootstrap JavaScript
script :src => "http://code.jquery.com/jquery.js"
script :src => (R(Static, "") + "javascripts/bootstrap.min.js")
@ -1448,7 +1450,6 @@ module StopTime::Views
h2 "Overview"
end
end
div.container do
div.row do
if @tasks.empty?
div.alert.alert_info do
@ -1493,7 +1494,6 @@ module StopTime::Views
end
end
end
end
# The main overview showing the timeline of registered time.
# If the _task_id_ argument is set, the task column will be hidden and
@ -1501,15 +1501,12 @@ module StopTime::Views
# FIXME: This should be done in a nicer way.
def time_entries(task_id=nil)
header do
div.container do
if task_id.present?
h2 "Registered #{@task.billed? ? "billed" : "unbilled"} time"
else
h2 "Timeline"
end
end
end
div.container do
table.table.table_condensed.table_striped.table_hover do
unless task_id.present?
col.customer_short
@ -1591,16 +1588,12 @@ module StopTime::Views
end
end
end
end
# Form for editing a time entry (Models::TimeEntry).
def time_entry_form
header do
div.container do
h2 "Time Entry Information"
end
end
div.container do
div.alert do
button.close(:type => "button", "data-dismiss" => "alert") { "&times;" }
strong "Warning!"
@ -1649,16 +1642,12 @@ module StopTime::Views
end
end
end
end
# The main overview of the list of customers.
def customers
header do
div.container do
h2 "Customers"
end
end
div.container do
if @customers.empty?
p do
text! "None found! You can create one " +
@ -1721,17 +1710,14 @@ module StopTime::Views
end
end
end
a.btn "» Add a new customer", :href=> R(CustomersNew)
end
end
end
# Form for editing the properties of customer (Models::Customer) but also
# for adding/editing/deleting tasks and showing a list of invoices for
# the customer.
def customer_form
div.container do
div.row do
div.span6 do
h2 "Customer Information"
@ -1777,7 +1763,6 @@ module StopTime::Views
:href => R(CustomersNTasksNew, @customer.id)
end
end
h2 "Invoices"
_invoice_list(@invoices)
a.btn "» Create a new invoice",
@ -1786,16 +1771,12 @@ module StopTime::Views
end
end
end
end
# Form for updating the properties of a task (Models::Task).
def task_form
header do
div.container do
h2 "Task Information"
end
end
div.container do
div.alert do
button.close(:type => "button", "data-dismiss" => "alert") { "&times;" }
strong "Warning!"
@ -1847,16 +1828,12 @@ module StopTime::Views
# Show registered time (ab)using the time_entries view as partial view.
time_entries(@task.id) unless @method == "create"
end
end
# The main overview of the existing invoices.
def invoices
header do
div.container do
h2 "Invoices"
end
end
div.container do
div.row do
div.span7 do
if @invoices.values.flatten.empty?
@ -1874,21 +1851,17 @@ module StopTime::Views
end
end
end
end
# A view displaying the information (billed tasks and time) of an
# invoice (Models::Invoice) that also allows for updating the "+paid+"
# property.
def invoice_form
header do
div.container do
h2 do
span "Invoice for "
text! "Invoice for "
a @customer.name, :href => R(CustomersN, @customer.id)
end
end
end
div.container do
div.row do
div.span6 do
form.form_horizontal.form_condensed :action => R(CustomersNInvoicesX, @customer.id, @invoice.number),
@ -2014,17 +1987,13 @@ module StopTime::Views
end
end
end
end
# Form for selecting fixed cost tasks and registered time for tasks with
# an hourly rate that need to be billed.
def invoice_select_form
header do
div.container do
h2 "Registered Time"
end
end
div.container do
div.row do
div.span10 do
form.form_horizontal :action => R(CustomersNInvoices, @customer.id),
@ -2123,16 +2092,12 @@ module StopTime::Views
end
end
end
end
# Form for editing the company information stored in Models::CompanyInfo.
def company_form
header do
div.container do
h2 "Company Information"
end
end
div.container do
div.alert.alert_error.alert_block do
button.close(:type => "button", "data-dismiss" => "alert") { "&times;" }
h4 "There were #{@errors.count} errors in the form!"
@ -2188,7 +2153,6 @@ module StopTime::Views
end
end
end
end
###############
# Partial views