Moved some stuff that didn't belong in the views.
This commit is contained in:
parent
c5d28419de
commit
41ba9ba162
17
stoptime.rb
17
stoptime.rb
|
@ -152,10 +152,12 @@ module StopTime::Models
|
||||||
class FixedCostTaskSupport < V 1.4
|
class FixedCostTaskSupport < V 1.4
|
||||||
def self.up
|
def self.up
|
||||||
add_column(Task.table_name, :billed, :boolean)
|
add_column(Task.table_name, :billed, :boolean)
|
||||||
|
add_column(Task.table_name, :fixed_cost, :float)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def self.down
|
||||||
add_column(Task.table_name, :billed)
|
remove_column(Task.table_name, :billed)
|
||||||
|
remove_column(Task.table_name, :fixed_cost)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -213,6 +215,8 @@ module StopTime::Controllers
|
||||||
|
|
||||||
class CustomersNew
|
class CustomersNew
|
||||||
def get
|
def get
|
||||||
|
@customer = {}
|
||||||
|
@target = [Customers]
|
||||||
render :customer_form
|
render :customer_form
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -220,6 +224,8 @@ module StopTime::Controllers
|
||||||
class CustomersN
|
class CustomersN
|
||||||
def get(customer_id)
|
def get(customer_id)
|
||||||
@customer = Customer.find(customer_id)
|
@customer = Customer.find(customer_id)
|
||||||
|
@edit_task = true
|
||||||
|
@target = [CustomersN, @customer.id]
|
||||||
render :customer_form
|
render :customer_form
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -489,14 +495,7 @@ module StopTime::Views
|
||||||
end
|
end
|
||||||
|
|
||||||
def customer_form
|
def customer_form
|
||||||
if @customer
|
form :action => R(*@target), :method => :post do
|
||||||
@edit_task = true
|
|
||||||
target = [CustomersN, @customer.id]
|
|
||||||
else
|
|
||||||
@customer = {}
|
|
||||||
target = [Customers]
|
|
||||||
end
|
|
||||||
form :action => R(*target), :method => :post do
|
|
||||||
ol do
|
ol do
|
||||||
li { _form_input(@customer, "Name", "name", :text) }
|
li { _form_input(@customer, "Name", "name", :text) }
|
||||||
li { _form_input(@customer, "Short name", "short_name", :text) }
|
li { _form_input(@customer, "Short name", "short_name", :text) }
|
||||||
|
|
Loading…
Reference in New Issue