<commit_before>- if @view.controls? and params[:all].nil?
  %div{:load_block => send("header_#{@topic.class.name.underscore}_view_url",@topic,@view,:tutorgroup => @tutorgroup)}= image_tag "ajax-loader.gif"
- if @view.controls? and params[:all] and @view.controls.include? "intervention"
  %form
    %input{:name => 'all', :value => 'true', :style => 'display:none'}
    %input{:name => 'date', :value => params[:date], :style => 'display:none'}
    %input{:name => 'filter', :value => 'true', :style => 'display:none'}
    %div.row
      %div.event-header
        %h2 Filter Results
        .span2
          %h4 Intervention Type
          = select_tag :pi_type, options_for_select(Intervention.intervention_types.keys.map{|k| [k,k.gsub(/\W+/,"_")]}, params[:pi_type]), :class => 'span2'
        .span3
          %h4 Category
          - Intervention.intervention_types.each_with_index do |cat, index|
            = select_tag :pint_category, options_for_select(cat.last, params[:pint_category]), :id => "intervention_referral_category_#{cat.first.gsub(/\W+/,"_")}", :style => "display:none"
        .span3
          %h4 Intervention Text
          %textarea{:name => 'int_text', :placeholder => 'Intervention text'}
            = params[:int_text]
        .span1
          %h4{:style => "color: #eee"} Fitler
          %input{:type => 'submit', :value => 'Filter'}
= render @events
- if @events.empty?
  .alert.row.alert-block.no-fade
    There are currently no #{@view.label.pluralize} to view.
- else
  #more_events_div{:style => "text-align:center"}
    = link_to view_url(@view,{:all => params[:all], :filter => params[:filter], :date => @events.last.event_date, :pi_type => params[:pi_type], :pint_category => params[:pint_category]}.merge(@topic.as_param)), :remote => true, :id => "more_events", :class => "btn" do
      %i.icon-arrow-down
      Load more events
      %i.icon-arrow-down
#more_events_loading{:style => "display:none"}= image_tag "ajax-loader.gif" 

- if @view.controls? and params[:all] and @view.controls.include? "intervention"
  :coffeescript
    $('#pi_type').change (e) ->
      $('select[name="pint_category"]').attr("disabled","disabled").hide()
      $('.intervention_note').hide()
      $('#alert_'  + $('#pi_type').val()).show()
      $("#intervention_referral_category_" + $('#pi_type').val()).removeAttr("disabled").show()
    $('#pi_type').change()<commit_msg>correction on int_text<commit_after>- if @view.controls? and params[:all].nil?
  %div{:load_block => send("header_#{@topic.class.name.underscore}_view_url",@topic,@view,:tutorgroup => @tutorgroup)}= image_tag "ajax-loader.gif"
- if @view.controls? and params[:all] and @view.controls.include? "intervention"
  %form
    %input{:name => 'all', :value => 'true', :style => 'display:none'}
    %input{:name => 'date', :value => params[:date], :style => 'display:none'}
    %input{:name => 'filter', :value => 'true', :style => 'display:none'}
    %div.row
      %div.event-header
        %h2 Filter Results
        .span2
          %h4 Intervention Type
          = select_tag :pi_type, options_for_select(Intervention.intervention_types.keys.map{|k| [k,k.gsub(/\W+/,"_")]}, params[:pi_type]), :class => 'span2'
        .span3
          %h4 Category
          - Intervention.intervention_types.each_with_index do |cat, index|
            = select_tag :pint_category, options_for_select(cat.last, params[:pint_category]), :id => "intervention_referral_category_#{cat.first.gsub(/\W+/,"_")}", :style => "display:none"
        .span3
          %h4 Intervention Text
          %textarea{:name => 'int_text', :placeholder => 'Intervention text'}
            = params[:int_text]
        .span1
          %h4{:style => "color: #eee"} Fitler
          %input{:type => 'submit', :value => 'Filter'}
= render @events
- if @events.empty?
  .alert.row.alert-block.no-fade
    There are currently no #{@view.label.pluralize} to view.
- else
  #more_events_div{:style => "text-align:center"}
    = link_to view_url(@view,{:all => params[:all], :filter => params[:filter], :date => @events.last.event_date, :pi_type => params[:pi_type], :pint_category => params[:pint_category], :int_text => params[:int_text]}.merge(@topic.as_param)), :remote => true, :id => "more_events", :class => "btn" do
      %i.icon-arrow-down
      Load more events
      %i.icon-arrow-down
#more_events_loading{:style => "display:none"}= image_tag "ajax-loader.gif" 

- if @view.controls? and params[:all] and @view.controls.include? "intervention"
  :coffeescript
    $('#pi_type').change (e) ->
      $('select[name="pint_category"]').attr("disabled","disabled").hide()
      $('.intervention_note').hide()
      $('#alert_'  + $('#pi_type').val()).show()
      $("#intervention_referral_category_" + $('#pi_type').val()).removeAttr("disabled").show()
    $('#pi_type').change()
{'fraction_non_alphanumeric': 0.1978499069671284, 'fraction_numerical': 0.004134794293983874, 'mean_word_length': 3.818725099601594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 64, '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': '4600881', 'n_tokens_mistral': 1635, 'n_tokens_neox': 1604, 'n_words': 293}