<commit_before>@import uk.gov.hmrc.bforms.models.FieldValue
@import uk.gov.hmrc.bforms.models.FormFieldValidationResult
@import uk.gov.hmrc.play.views.html.helpers._

@(fieldValue: FieldValue, validationResult: Option[FormFieldValidationResult])

<h3>@localisation(fieldValue.label)</h3>
<p>@{fieldValue.helpText}</p>
Street <input type="text"
	      id="@{fieldValue.id}.street1"
	      name="@{fieldValue.id}.street1"
	      value="@validationResult.map(_.getCurrentValue("street1")).getOrElse("")"
	      class="form-control form-control--block" >

<input type="text"
       id="@{fieldValue.id}.street2"
       name="@{fieldValue.id}.street2"
       value="@validationResult.map(_.getCurrentValue("street2")).getOrElse("")"
       class="form-control form-control--block">

<input type="text"
       id="@{fieldValue.id}.street3"
       name="@{fieldValue.id}.street3"
       value="@validationResult.map(_.getCurrentValue("street3")).getOrElse("")"
       class="form-control form-control--block">

Town <input type="text"
	    id="@{fieldValue.id}.town"
	    name="@{fieldValue.id}.town"
	    value="@validationResult.map(_.getCurrentValue("town")).getOrElse("")"
	    class="form-control form-control--block">

County <input type="text"
	      id="@{fieldValue.id}.county"
	      name="@{fieldValue.id}.county"
	      value="@validationResult.map(_.getCurrentValue("county")).getOrElse("")"
	      class="form-control form-control--block">

Postcode <input type="text"
		id="@{fieldValue.id}.postcode"
		name="@{fieldValue.id}.postcode"
		value="@validationResult.map(_.getCurrentValue("postcode")).getOrElse("")"
		class="form-control form-control--block">
<commit_msg>Address template improvements<commit_after>@import uk.gov.hmrc.bforms.models.FieldValue
@import uk.gov.hmrc.bforms.models.FormFieldValidationResult
@import uk.gov.hmrc.play.views.html.helpers._

@(fieldValue: FieldValue, validationResult: Option[FormFieldValidationResult])

<div class="form-field-group @if(validationResult.map(_.isOk).contains(false)) { form-field-group--error }">
  <fieldset>
    <legend class="h3-heading">@localisation(fieldValue.label)</legend>
    @if(fieldValue.helpText) {
      <div class="form-field--hint">@localisation(fieldValue.helpText.getOrElse(""))</div>
    }

    @errorInline(fieldValue.id.value, "Please enter required data", Seq(""))

    @List(
      ("Street", "street1"),
      ("", "street2"),
      ("", "street2"),
      ("Town", "town"),
      ("County", "county"),
      ("Postcode", "postcode")
    ).map { case (label, suffix) =>

    @label <input type="text"
    	      id="@{fieldValue.id}.@suffix"
    	      name="@{fieldValue.id}.@suffix"
    	      value="@validationResult.map(_.getCurrentValue(suffix)).getOrElse("")"
    	      class="form-control form-control--block" >
    }
  </fieldset>
</div>

{'fraction_non_alphanumeric': 0.18935119887165022, 'fraction_numerical': 0.005289139633286318, 'mean_word_length': 4.292910447761194, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3512924', 'n_tokens_mistral': 970, 'n_tokens_neox': 923, 'n_words': 111}