<commit_before><%# this partial requires plan_id, requirement_id to be passed in as a local variable %>
<%= form_for(@response,  html: { :class => 'form-horizontal' }) do |f| %>

  <%= f.hidden_field :lock_version %>

  <%= render partial: "shared/errors", locals: {model: @response} %>
  <div class="control-group">
      <%= f.hidden_field :requirement_id, value: requirement_id %>
      <%= f.hidden_field :plan_id, value: plan_id %>
      <%= f.hidden_field :label_id %>
      <%= hidden_field_tag :next_requirement_id, @next_requirement_id %>
  </div>
  <% if requirement(requirement_id).requirement_type == :text %>
    <div class="control-group">
    		<%= f.cktext_area :text_value, placeholder: 'response', :class => "input-block-level" %>
    </div>
  <% end %>

  <% if requirement(requirement_id).requirement_type == :numeric %>
    <div class="control-group">
      <%= f.label :numeric_value, 'Value', :class => 'control-label' %>
      <div class="controls">
        <%= f.number_field :numeric_value %>
      </div>
    </div>
    <div class="control-group">
      <%= f.label :label_id, 'Unit of Measure', :class => 'control-label' %>
      <div class="controls">
        <%= f.select(:label_id, requirement(requirement_id).labels.collect {|l| [ l.desc, l.id ] }) %>
      </div>
    </div>
  <% end %>

  <% if requirement(requirement_id).requirement_type == :date %>
    <div class="control-group">
      <%= f.label :date_value, :class => "control-label" %>
      <div class="controls">
        <%= f.text_field :date_value, value: @response.date_value.blank? ? " " : @response.date_value.strftime('%m/%d/%Y'), :class => 'datepicker', id:'response_date_value' %>
      </div>
    </div>
  <% end %>

  <% if requirement(requirement_id).requirement_type == :enum %>
    <div class="control-group">
      <%= f.label :enumeration_id, 'Please Select One', :class => 'control-label' %>
      <div class="controls">
        <%= f.select(:enumeration_id, requirement(requirement_id).enumerations.collect {|e| [ e.value, e.id ]} ) %>
      </div>
    </div>
  <% end %>

  <br/>
  <% if requirement(requirement_id).obligation == :mandatory %>
      <%= f.submit "Save and Next", name: 'save_and_next', :class => 'btn btn-success pull-right', method: 'post', id: 'save_and_next', remote: true %>
      <%= f.submit "Save Response", name: 'save_only', :class => 'btn btn-success pull-right', method: 'post', id: 'save_only', remote: true %>
      <%= link_to 'Cancel Changes', details_plan_path(@plan), :class => "btn btn-green" %>
    <% else %>
      <%= f.submit "Save and Next", name: 'save_and_next', :class => 'btn btn-success pull-right', method: 'post' %>
      <%= f.submit "Save Response", name: 'save_only', :class => 'btn btn-success pull-right', method: 'post'%>
      <%= link_to 'Cancel Changes', details_plan_path(@plan), :class => "btn btn-green" %>
    <% end %>
  </div>
<% end %>

<div id="alert_message" title="Please Enter a Valid Response.">
  Cannot save an empty Response. Please enter a valid Response before continuing.
</div>
<commit_msg>gray out Cancel Changes button on DMP Details page<commit_after><%# this partial requires plan_id, requirement_id to be passed in as a local variable %>
<%= form_for(@response,  html: { :class => 'form-horizontal' }) do |f| %>

  <%= f.hidden_field :lock_version %>

  <%= render partial: "shared/errors", locals: {model: @response} %>
  <div class="control-group">
      <%= f.hidden_field :requirement_id, value: requirement_id %>
      <%= f.hidden_field :plan_id, value: plan_id %>
      <%= f.hidden_field :label_id %>
      <%= hidden_field_tag :next_requirement_id, @next_requirement_id %>
  </div>
  <% if requirement(requirement_id).requirement_type == :text %>
    <div class="control-group">
    		<%= f.cktext_area :text_value, placeholder: 'response', :class => "input-block-level" %>
    </div>
  <% end %>

  <% if requirement(requirement_id).requirement_type == :numeric %>
    <div class="control-group">
      <%= f.label :numeric_value, 'Value', :class => 'control-label' %>
      <div class="controls">
        <%= f.number_field :numeric_value %>
      </div>
    </div>
    <div class="control-group">
      <%= f.label :label_id, 'Unit of Measure', :class => 'control-label' %>
      <div class="controls">
        <%= f.select(:label_id, requirement(requirement_id).labels.collect {|l| [ l.desc, l.id ] }) %>
      </div>
    </div>
  <% end %>

  <% if requirement(requirement_id).requirement_type == :date %>
    <div class="control-group">
      <%= f.label :date_value, :class => "control-label" %>
      <div class="controls">
        <%= f.text_field :date_value, value: @response.date_value.blank? ? " " : @response.date_value.strftime('%m/%d/%Y'), :class => 'datepicker', id:'response_date_value' %>
      </div>
    </div>
  <% end %>

  <% if requirement(requirement_id).requirement_type == :enum %>
    <div class="control-group">
      <%= f.label :enumeration_id, 'Please Select One', :class => 'control-label' %>
      <div class="controls">
        <%= f.select(:enumeration_id, requirement(requirement_id).enumerations.collect {|e| [ e.value, e.id ]} ) %>
      </div>
    </div>
  <% end %>

  <br/>
  <% if requirement(requirement_id).obligation == :mandatory %>
      <%= f.submit "Save and Next", name: 'save_and_next', :class => 'btn btn-success pull-right', method: 'post', id: 'save_and_next', remote: true %>
      <%= f.submit "Save Response", name: 'save_only', :class => 'btn btn-success pull-right', method: 'post', id: 'save_only', remote: true %>
      <%= link_to 'Cancel Changes', details_plan_path(@plan), :class => "btn" %>
    <% else %>
      <%= f.submit "Save and Next", name: 'save_and_next', :class => 'btn btn-success pull-right', method: 'post' %>
      <%= f.submit "Save Response", name: 'save_only', :class => 'btn btn-success pull-right', method: 'post'%>
      <%= link_to 'Cancel Changes', details_plan_path(@plan), :class => "btn" %>
    <% end %>
  </div>
<% end %>

<div id="alert_message" title="Please Enter a Valid Response.">
  Cannot save an empty Response. Please enter a valid Response before continuing.
</div>

{'fraction_non_alphanumeric': 0.19024469291848972, 'fraction_numerical': 0.0, 'mean_word_length': 3.630157539384846, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 147, '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': '227648', 'n_tokens_mistral': 2179, 'n_tokens_neox': 2018, 'n_words': 472}