<commit_before>- if flash[:error]
  .highlight--box.highlight--caution__soft
    %p= flash[:error]

= form_tag(path, method: :post) do
  .form-group
    = hidden_field_tag('previous_controller', params[:controller])
    = hidden_field_tag('previous_action', params[:action])
    = hidden_field_tag('constituency_id', @constituency.graph_id) if @constituency
    = hidden_field_tag('person_id', @person.graph_id) if @person
    = label_tag 'postcode', t('.search_by_postcode')
    = text_field_tag('postcode', @postcode, value: flash[:postcode], maxlength: 8, pattern:'[0-9a-zA-Z ]{5,}')
    - submit_text = @person.nil? && @constituency.nil? ? "Find" : "Check"
    = submit_tag(submit_text, class: 'btn--secondary')

%p= t('.do_not_know_postcode', link: link_to(t('.do_not_know_postcode_link'), 'http://www.royalmail.com/find-a-postcode', target: '_blank', title: t('open_new_window'))).html_safe<commit_msg>[WEBSITE-1320] Apply enhancements to postcode search<commit_after>- if flash[:error]
  .highlight--box.highlight--caution__soft
    %p= flash[:error]

= form_tag(path, method: :post) do
  .form-group
    = hidden_field_tag('previous_controller', params[:controller])
    = hidden_field_tag('previous_action', params[:action])
    = hidden_field_tag('constituency_id', @constituency.graph_id) if @constituency
    = hidden_field_tag('person_id', @person.graph_id) if @person
    = label_tag 'input', t('.search_by_postcode')
    = text_field_tag(:postcode, @postcode, value: flash[:postcode], maxlength: 8, pattern:'[0-9a-zA-Z ]{5,}', id:'input')
    - button_text = @person.nil? && @constituency.nil? ? "Find" : "Check"
    %button{:id => 'btn_loading', :class => 'btn--secondary', :value => button_text, :type => 'submit'}
      %span{:class => 'btn--loading__text'}= button_text
      %span{:class => 'btn--loading__icon'}
        %object{:data => 'https://s3-eu-west-1.amazonaws.com/web1devci.pugin-website/1.4.4/icons/loading.svg', :type => 'image/svg+xml'}

%p= t('.do_not_know_postcode', link: link_to(t('.do_not_know_postcode_link'), 'http://www.royalmail.com/find-a-postcode', target: '_blank', title: t('open_new_window'))).html_safe
{'fraction_non_alphanumeric': 0.18465116279069768, 'fraction_numerical': 0.008372093023255815, 'mean_word_length': 5.326470588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, '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': '5554950', 'n_tokens_mistral': 786, 'n_tokens_neox': 776, 'n_words': 121}