You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
2 years ago
|
module Forms
|
||
1 week ago
|
module BulkUploadForm
|
||
2 years ago
|
class Guidance
|
||
|
include ActiveModel::Model
|
||
|
include ActiveModel::Attributes
|
||
|
include Rails.application.routes.url_helpers
|
||
2 months ago
|
include CollectionTimeHelper
|
||
2 years ago
|
|
||
1 week ago
|
attribute :log_type
|
||
2 years ago
|
attribute :year, :integer
|
||
6 months ago
|
attribute :referrer
|
||
3 months ago
|
attribute :organisation_id, :integer
|
||
2 years ago
|
|
||
2 months ago
|
def initialize(params)
|
||
|
super(params)
|
||
|
|
||
|
self.year = current_collection_start_year if year.nil?
|
||
|
end
|
||
|
|
||
2 years ago
|
def view_path
|
||
|
"bulk_upload_shared/guidance"
|
||
|
end
|
||
|
|
||
|
def back_path
|
||
6 months ago
|
case referrer
|
||
|
when "prepare-your-file"
|
||
1 week ago
|
send("bulk_upload_#{log_type}_log_path", id: "prepare-your-file", form: { year:, organisation_id: }.compact)
|
||
6 months ago
|
when "home"
|
||
|
root_path
|
||
|
else
|
||
|
guidance_path
|
||
|
end
|
||
2 years ago
|
end
|
||
|
|
||
12 months ago
|
def lettings_template_path
|
||
1 week ago
|
Forms::BulkUploadForm::PrepareYourFile.new(year:, log_type: "lettings").template_path
|
||
2 years ago
|
end
|
||
|
|
||
12 months ago
|
def lettings_specification_path
|
||
1 week ago
|
Forms::BulkUploadForm::PrepareYourFile.new(year:, log_type: "lettings").specification_path
|
||
2 years ago
|
end
|
||
12 months ago
|
|
||
|
def sales_template_path
|
||
1 week ago
|
Forms::BulkUploadForm::PrepareYourFile.new(year:, log_type: "sales").template_path
|
||
12 months ago
|
end
|
||
|
|
||
|
def sales_specification_path
|
||
1 week ago
|
Forms::BulkUploadForm::PrepareYourFile.new(year:, log_type: "sales").specification_path
|
||
12 months ago
|
end
|
||
2 years ago
|
end
|
||
|
end
|
||
|
end
|