<commit_before>- content_for :before_javascripts do
  = javascript_include_tag "http://maps.googleapis.com/maps/api/js?key=#{Settings.oz.gm_key}&sensor=false&libraries=places"
#direction_widget{ :"data-replace" => "#direction_widget" }
  .sidebar
    = link_to '/', :target => :_top do
      %h1.logo
    = semantic_form_for widget_search, :url => widgets_direction_path(widget.uid), :method => :get do |f|
      = f.hidden_field :bounding_box, value: widget_params.try(:[], 'bounding_box')
      = f.hidden_field :path, value: widget_params.try(:[], 'path')
      = f.hidden_field :polygon, value: widget_params.try(:[], 'polygon')
      %section.search
        %h2= t('views.widgets.show.direction.route_type').gsub(':', '')
        = f.input :route_type, as: :route_type_choice, collection: route_type_collection, selected: widget_params.try(:[], 'route_type')
        %h2= t('views.widgets.show.direction.relics_on_path').gsub(':', '')
        #waypoints
          .search-input
            - widget_params.try(:[], 'waypoints').try :each_with_index do |waypoint, index|
              .string.clearfix.optional.stringish{ id: "search_waypoints_#{index}_input" }
                .input
                  = text_field_tag 'search[waypoints[]]', waypoint, id: "search_waypoints_#{index}", class: 'waypoint'
                  - if index > 1
                    %span.remove.suffix &times;
          = link_to t('views.widgets.show.direction.add_place'), '#', class: 'add-place'
        %h2= t('views.widgets.show.direction.relics_within_radius').gsub(':', '')
        .search-input
          .string.clearfix.optional.stringish
            = f.text_field :radius, value: widget_params.try(:[], 'radius') || 2
            %span.suffix= t('views.widgets.show.direction.km_within_range')
        %section.categories
          %h2= t('views.widgets.show.direction.relics_from_categories').gsub(':', '')
          .search-input
            - Category.roots.sort_by(&:name).each do |category|
              - if category.name_key == 'sakralny'
                .category
                  = f.label :categories, value: category.name_key do
                    = f.check_box :categories, { multiple: true, class: 'sacral-options', checked: categories.include?(category.name_key) }, category.name_key, nil
                    %span.name= category.name
                .sacral-categories{ style: 'display: none;' }
                  - category.children.sort_by(&:name).each do |child|
                    .category
                      = f.label :categories, value: child.name_key do
                        = f.check_box :categories, { multiple: true, checked: categories.include?(category.name_key) }, child.name_key, nil
                        %span.name= child.name.gsub('/', ', ')
              - else
                .category
                  = f.label :categories, value: category.name_key do
                    = f.check_box :categories, { multiple: true, checked: categories.include?(category.name_key) }, category.name_key, nil
                    %span.name= category.name.gsub('/', ', ')
.map
  #map_canvas{ :style => "width: 100%; height: 100%;" }
:javascript
  config = #{widget.config.to_json};
= content_for :stylesheets do
  = stylesheet_link_tag "widgets/direction"
= content_for :javascripts do
  = javascript_include_tag "jsts", debug: false
  = javascript_include_tag "widgets/direction"<commit_msg>Fix the widget form headers when viewing as admin<commit_after>- content_for :before_javascripts do
  = javascript_include_tag "http://maps.googleapis.com/maps/api/js?key=#{Settings.oz.gm_key}&sensor=false&libraries=places"
#direction_widget{ :"data-replace" => "#direction_widget" }
  .sidebar
    = link_to '/', :target => :_top do
      %h1.logo
    = semantic_form_for widget_search, :url => widgets_direction_path(widget.uid), :method => :get do |f|
      = f.hidden_field :bounding_box, value: widget_params.try(:[], 'bounding_box')
      = f.hidden_field :path, value: widget_params.try(:[], 'path')
      = f.hidden_field :polygon, value: widget_params.try(:[], 'polygon')
      %section.search
        %h2= t('views.widgets.show.direction.route_type', editable: false).gsub(':', '')
        = f.input :route_type, as: :route_type_choice, collection: route_type_collection, selected: widget_params.try(:[], 'route_type')
        %h2= t('views.widgets.show.direction.relics_on_path', editable: false).gsub(':', '')
        #waypoints
          .search-input
            - widget_params.try(:[], 'waypoints').try :each_with_index do |waypoint, index|
              .string.clearfix.optional.stringish{ id: "search_waypoints_#{index}_input" }
                .input
                  = text_field_tag 'search[waypoints[]]', waypoint, id: "search_waypoints_#{index}", class: 'waypoint'
                  - if index > 1
                    %span.remove.suffix &times;
          = link_to t('views.widgets.show.direction.add_place'), '#', class: 'add-place'
        %h2= t('views.widgets.show.direction.relics_within_radius', editable: false).gsub(':', '')
        .search-input
          .string.clearfix.optional.stringish
            = f.text_field :radius, value: widget_params.try(:[], 'radius') || 2
            %span.suffix= t('views.widgets.show.direction.km_within_range')
        %section.categories
          %h2= t('views.widgets.show.direction.relics_from_categories', editable: false).gsub(':', '')
          .search-input
            - Category.roots.sort_by(&:name).each do |category|
              - if category.name_key == 'sakralny'
                .category
                  = f.label :categories, value: category.name_key do
                    = f.check_box :categories, { multiple: true, class: 'sacral-options', checked: categories.include?(category.name_key) }, category.name_key, nil
                    %span.name= category.name
                .sacral-categories{ style: 'display: none;' }
                  - category.children.sort_by(&:name).each do |child|
                    .category
                      = f.label :categories, value: child.name_key do
                        = f.check_box :categories, { multiple: true, checked: categories.include?(category.name_key) }, child.name_key, nil
                        %span.name= child.name.gsub('/', ', ')
              - else
                .category
                  = f.label :categories, value: category.name_key do
                    = f.check_box :categories, { multiple: true, checked: categories.include?(category.name_key) }, category.name_key, nil
                    %span.name= category.name.gsub('/', ', ')
.map
  #map_canvas{ :style => "width: 100%; height: 100%;" }
:javascript
  config = #{widget.config.to_json};
= content_for :stylesheets do
  = stylesheet_link_tag "widgets/direction"
= content_for :javascripts do
  = javascript_include_tag "jsts", debug: false
  = javascript_include_tag "widgets/direction"
{'fraction_non_alphanumeric': 0.14594750504759157, 'fraction_numerical': 0.0037496394577444477, 'mean_word_length': 2.5839793281653747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '241703', 'n_tokens_mistral': 2155, 'n_tokens_neox': 2070, 'n_words': 383}