<commit_before><%= render :partial => 'shared/form_errors', :locals => {:object => @reading} %>

<div class="form-group">
  <%= f.label :label, class: 'control-label' %><br>
  <%= f.text_field :label, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :grade, class: 'control-label' %><br>
  <%= f.text_field :grade, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :color, class: 'control-label' %><br>
  <div class="input-append" id="color_div">
    <%= f.text_field :color, class: 'form-control' %>
    <input type="button" class="btn btn-info" id="pickcolor_button" value="Pick color"></input>
  </div>
</div>

<script>
  options = {
    trigger_event: "click",
    color: {
      r: 0,
      g: 0,
      b: 0
    },
    onChange: function(colorHSB) {
      // Get first children "eq(0)" of #color_div with type "input"
      $("#color_div").children("input").eq(0).val(colorHSB.toHex());
    }
  }
  new ColorPicker($("#pickcolor_button"), options);
</script>

<%= f.submit 'Save', class: 'btn btn-primary' %><commit_msg>Fix Pick color button size<commit_after><%= render :partial => 'shared/form_errors', :locals => {:object => @reading} %>

<div class="form-group">
  <%= f.label :label, class: 'control-label' %><br>
  <%= f.text_field :label, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :grade, class: 'control-label' %><br>
  <%= f.text_field :grade, class: 'form-control' %>
</div>

<div class="form-group">
  <%= f.label :color, class: 'control-label' %><br>
  <div class="input-append" id="color_div">
    <%= f.text_field :color, class: 'form-control' %>
    <input type="button" class="btn btn-info" style="padding: 5px" id="pickcolor_button" value="Pick color"></input>
  </div>
</div>

<script>
  options = {
    trigger_event: "click",
    color: {
      r: 0,
      g: 0,
      b: 0
    },
    onChange: function(colorHSB) {
      // Get first children "eq(0)" of #color_div with type "input"
      $("#color_div").children("input").eq(0).val(colorHSB.toHex());
    }
  }
  new ColorPicker($("#pickcolor_button"), options);
</script>

<%= f.submit 'Save', class: 'btn btn-primary' %>

{'fraction_non_alphanumeric': 0.2206896551724138, 'fraction_numerical': 0.005057471264367816, 'mean_word_length': 3.79295154185022, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 55, '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': '6698089', 'n_tokens_mistral': 829, 'n_tokens_neox': 794, 'n_words': 178}