<commit_before>- is_comparison_area = search_id.n > 0
- selected_search_term = @preferences.selected_location_name( search_id )

%section.area-selection
  %h3
    = title
    - if is_comparison_area
      %a.btn.btn-sm.action.action-remove-comparison{ title: "Remove comparison", href: @preferences.as_path( :hpi, {}, [:compare, :loc_1, :loc_uri_1] )}
        %i.fa.fa-times-circle.fa-2x
  .col-sm-9
    .form-group
      = text_field_tag( preferences.attribute_with_search_id( "search", search_id ), selected_search_term, class: "form-control" )
      %span.form-control-feedback.js.clear-selection
        %a.action.action-remove-selection.btn{ href: '#', data: {"search-id" => search_id.n}, class: (selected_search_term ? "" : "hidden")}
          %i.fa.fa-times-circle.fa-lg

  .col-sm-3
    %button#action_search.btn{ type: "submit" }
      %i.fa.fa-search
    %span.js.map-button{ data: {search_id: search_id.n}}

  .col-sm-12
    - search_command = @search_commands[search_id.sym] if @search_commands
    = render( partial: "hpi/search_results", locals: {search_command: search_command} ) if search_command && search_command.locations?
    = render partial: "hpi/selected_search_term", locals: {search_id: search_id}

  - unless is_comparison_area
    .row
      %p.col-sm-12.help-block.small.text-muted
        Enter a region, county or local authority by name, or from the map<commit_msg>Fixes for issue #81 - make the second area selection more clearly removable<commit_after>- is_comparison_area = search_id.n > 0
- selected_search_term = @preferences.selected_location_name( search_id )

%section.area-selection
  %h3
    = title
    - if is_comparison_area
      %a.btn.btn-sm.action.action-remove-comparison{ title: "Remove comparison", href: @preferences.as_path( :hpi, {}, [:compare, :loc_1, :loc_uri_1] )}
        %i.fa.fa-minus-circle.fa-2x
  .col-sm-9
    .form-group
      = text_field_tag( preferences.attribute_with_search_id( "search", search_id ), selected_search_term, class: "form-control" )
      %span.form-control-feedback.js.clear-selection
        %a.action.action-remove-selection.btn{ href: '#', data: {"search-id" => search_id.n}, class: (selected_search_term ? "" : "hidden")}
          %i.fa.fa-times-circle.fa-lg

  .col-sm-3
    %button#action_search.btn{ type: "submit" }
      %i.fa.fa-search
    %span.js.map-button{ data: {search_id: search_id.n}}

  .col-sm-12
    - search_command = @search_commands[search_id.sym] if @search_commands
    = render( partial: "hpi/search_results", locals: {search_command: search_command} ) if search_command && search_command.locations?
    = render partial: "hpi/selected_search_term", locals: {search_id: search_id}

  - unless is_comparison_area
    .row
      %p.col-sm-12.help-block.small.text-muted
        Enter a region, county or local authority by name, or from the map
  - else
    .row
      %p.col-sm-12.help-block.small.text-muted
        Enter a second area to compare against. Click the
        %i.fa.fa-minus-circle
        button to remove.
{'fraction_non_alphanumeric': 0.1370675453047776, 'fraction_numerical': 0.0085667215815486, 'mean_word_length': 3.4192139737991267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7377121', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1041, 'n_words': 202}