<commit_before>-# we need to break from the .container and
-# also surround everything in a form

- content_for(:header) do
  / header overridden
- content_for(:main_container_class) {'non-container'}

= semantic_form_for(@response_set, :as => :r, :url => surveyor.update_my_survey_path, :html => {:method => :put, :id => "survey_form"}) do |f|

  .affixed
    %header
      .container
        .row
          .span9
            %h1 New Certificate
            %h3{'data-bind-to-input' => @survey.dataset_title}= @response_set.title
          .span3
            - if user_signed_in?
              = f.submit t('surveyor.click_here_to_finish'), :name => :finish, :class => 'btn btn-primary btn-large'
            - else
              =link_to t('surveyor.click_here_to_finish'), '#save-and-finish-modal', :class => 'btn btn-primary btn-large', :role=>"button", 'data-toggle' => "modal"


  = render :partial => 'status_panel'
  = render :partial => 'shared/flashes'

  #surveyor{class: params[:highlight_mandatory] ? 'highlight-mandatory' : ''}
    = hidden_field_tag :surveyor_javascript_enabled, false

    .container
      .row
        .lead.span8= @survey.translation(I18n.locale)[:description].try(:html_safe)

    = render 'partials/dependents' unless @dependents.empty?

    -# If there were no responses by the user, the cache the blank survey for
    -# other new users
    - if @response_set.responses.empty?
      = cache("blank_survey_#{@response_set.survey_id}") do
        = render :partial => '/partials/section', :collection => @sections, :as => :section, :locals => {:f => f}
    - else # no cache
      = render :partial => '/partials/section', :collection => @sections, :as => :section, :locals => {:f => f}

:javascript
  $(document).ready(function() {
    $('fieldset.question-row').each(function(){
      var $question = $(this),
          $label = $question.find('label.question_label'),
          $requirements = $question.closest('li.container').find('fieldset.q_label'),
          text = '';
      if ($question.is('.mandatory') || $requirements.is('.requirement_basic')) {
        text = '#{t('requirement_label.requirement')}';
      } else if ($requirements.is('.requirement_pilot')) {
        text = '#{t('requirement_label.requirement_pilot')}';
      } else if ($requirements.is('.requirement_standard')) {
        text = '#{t('requirement_label.requirement_standard')}';
      } else if ($requirements.is('.requirement_exemplar')) {
        text = '#{t('requirement_label.requirement_exemplar')}';
      }
      
      if (text !== '') {
        $label.append(' <small>' + text + '</small>');
      }
    });
    
    // Resolve URLs

    $('input[type=url]').change(function () {
      var el = this
      var regex = new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_\+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?");
      if(regex.test(el.value)) {
        $(el).parent().spin({lines: 8, length: 4, width: 3, radius: 5, direction: 1, color: '#000', speed: 1, trail: 60, top: '70px', left: '750px'});
        $.getJSON('/resolve', { url: el.value } )
          .done(function(json) {
            $(el).parent().spin(false);
            if (json.status == 200) {
              $(el).attr('class', 'string')
              $(el).parent().next('.url_error').attr('class', 'span7 url_error hidden');
            } else {
              $(el).attr('class', 'string fail')
              $(el).parent().next('.url_error').attr('class', 'span7 url_error');
            }
          });
      }
    })
    <commit_msg>Change zIndex of spinner<commit_after>-# we need to break from the .container and
-# also surround everything in a form

- content_for(:header) do
  / header overridden
- content_for(:main_container_class) {'non-container'}

= semantic_form_for(@response_set, :as => :r, :url => surveyor.update_my_survey_path, :html => {:method => :put, :id => "survey_form"}) do |f|

  .affixed
    %header
      .container
        .row
          .span9
            %h1 New Certificate
            %h3{'data-bind-to-input' => @survey.dataset_title}= @response_set.title
          .span3
            - if user_signed_in?
              = f.submit t('surveyor.click_here_to_finish'), :name => :finish, :class => 'btn btn-primary btn-large'
            - else
              =link_to t('surveyor.click_here_to_finish'), '#save-and-finish-modal', :class => 'btn btn-primary btn-large', :role=>"button", 'data-toggle' => "modal"


  = render :partial => 'status_panel'
  = render :partial => 'shared/flashes'

  #surveyor{class: params[:highlight_mandatory] ? 'highlight-mandatory' : ''}
    = hidden_field_tag :surveyor_javascript_enabled, false

    .container
      .row
        .lead.span8= @survey.translation(I18n.locale)[:description].try(:html_safe)

    = render 'partials/dependents' unless @dependents.empty?

    -# If there were no responses by the user, the cache the blank survey for
    -# other new users
    - if @response_set.responses.empty?
      = cache("blank_survey_#{@response_set.survey_id}") do
        = render :partial => '/partials/section', :collection => @sections, :as => :section, :locals => {:f => f}
    - else # no cache
      = render :partial => '/partials/section', :collection => @sections, :as => :section, :locals => {:f => f}

:javascript
  $(document).ready(function() {
    $('fieldset.question-row').each(function(){
      var $question = $(this),
          $label = $question.find('label.question_label'),
          $requirements = $question.closest('li.container').find('fieldset.q_label'),
          text = '';
      if ($question.is('.mandatory') || $requirements.is('.requirement_basic')) {
        text = '#{t('requirement_label.requirement')}';
      } else if ($requirements.is('.requirement_pilot')) {
        text = '#{t('requirement_label.requirement_pilot')}';
      } else if ($requirements.is('.requirement_standard')) {
        text = '#{t('requirement_label.requirement_standard')}';
      } else if ($requirements.is('.requirement_exemplar')) {
        text = '#{t('requirement_label.requirement_exemplar')}';
      }
      
      if (text !== '') {
        $label.append(' <small>' + text + '</small>');
      }
    });
    
    // Resolve URLs

    $('input[type=url]').change(function () {
      var el = this
      var regex = new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_\+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?");
      if(regex.test(el.value)) {
        $(el).parent().spin({lines: 8, length: 4, width: 3, radius: 5, direction: 1, color: '#000', speed: 1, trail: 60, top: '70px', left: '750px', zIndex: 9});
        $.getJSON('/resolve', { url: el.value } )
          .done(function(json) {
            $(el).parent().spin(false);
            if (json.status == 200) {
              $(el).attr('class', 'string')
              $(el).parent().next('.url_error').attr('class', 'span7 url_error hidden');
            } else {
              $(el).attr('class', 'string fail')
              $(el).parent().next('.url_error').attr('class', 'span7 url_error');
            }
          });
      }
    })
    
{'fraction_non_alphanumeric': 0.19972144846796658, 'fraction_numerical': 0.009331476323119777, 'mean_word_length': 2.7015463917525775, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '4605042', 'n_tokens_mistral': 2407, 'n_tokens_neox': 2319, 'n_words': 443}