Browse Source

WIP

pull/2672/head
Rachael Booth 9 months ago
parent
commit
615ebfeff8
  1. 2
      app/models/form/sales/pages/outright_ownership_type.rb
  2. 5
      app/models/form/sales/questions/ownership_scheme.rb
  3. 6
      app/models/form/sales/questions/purchaser_code.rb
  4. 5
      app/models/form/sales/questions/sale_date.rb
  5. 2
      app/views/form/_date_question.html.erb
  6. 18
      config/locales/forms/2024/sales/setup.en.yml

2
app/models/form/sales/pages/outright_ownership_type.rb

@ -16,6 +16,6 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page
end
def header
"Type of outright sale" if form.start_date.year >= 2023
"Type of outright sale page" if form.start_date.year >= 2023
end
end

5
app/models/form/sales/questions/ownership_scheme.rb

@ -2,8 +2,9 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question
def initialize(id, hsh, page)
super
@id = "ownershipsch"
@check_answer_label = "Purchase made under ownership scheme"
@header = "Was this purchase made through an ownership scheme?"
@check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.check_answer_label")
@header = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.question_text")
@hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.ownerschipsch.hint_text")
@type = "radio"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

6
app/models/form/sales/questions/purchaser_code.rb

@ -2,9 +2,9 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question
def initialize(id, hsh, page)
super
@id = "purchid"
@check_answer_label = "Purchaser code"
@header = "What is the purchaser code?"
@hint_text = "This is how you usually refer to the purchaser on your own systems."
@check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.check_answer_label")
@header = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.question_text")
@hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.purchid.hint_text")
@type = "text"
@width = 10
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

5
app/models/form/sales/questions/sale_date.rb

@ -2,8 +2,9 @@ class Form::Sales::Questions::SaleDate < ::Form::Question
def initialize(id, hsh, page)
super
@id = "saledate"
@check_answer_label = "Sale completion date"
@header = "What is the sale completion date?"
@check_answer_label = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.check_answer_label")
@header = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.question_text")
@hint_text = I18n.t("forms.#{form.start_date.year}.sales.setup.saledate.hint_text")
@type = "date"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

2
app/views/form/_date_question.html.erb

@ -3,7 +3,7 @@
<%= f.govuk_date_field question.id.to_sym,
caption: caption(caption_text, page_header, conditional),
legend: legend(question, page_header, conditional),
hint: { text: (question.hint_text.nil? ? "" : (question.hint_text.html_safe + "</br></br>".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" },
hint: { text: (question.hint_text.blank? ? "" : (question.hint_text.html_safe + "</br></br>".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" },
width: 20,
**stimulus_html_attributes(question) do %>
<%= govuk_inset_text(text: question.unresolved_hint_text) if question.unresolved_hint_text.present? && @log.unresolved %>

18
config/locales/forms/2024/sales/setup.en.yml

@ -18,4 +18,22 @@ en:
hint_text: ""
question_text: "Which user are you creating this log for?"
saledate:
check_answer_label: "Sale completion date"
hint_text: ""
question_text: "What is the sale completion date?"
purchid:
check_answer_label: "Purchaser code"
hint_text: "This is how you usually refer to the purchaser on your own systems."
question_text: "What is the purchaser code?"
ownerschipsch:
check_answer_label: "Purchase made under ownership scheme"
hint_text: ""
question_text: "Was this purchase made through an ownership scheme?"
type:
shared_ownership:

Loading…
Cancel
Save