<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 id="color_div">
  	<%= f.text_field :color, class: 'form-control' %>
    <!-- We should use the glyph from bootstrap instead of loading a custom img -->
    <input type="image" id="colorpicker_button" src="/assets/colorpicker.png"</input>
  </div>
  
  <script>
	options = {
		trigger_event: "click",
		color: {
		    r: 0,
		    g: 0,
		    b: 0
		},
		onChange: function(colorHSB) {
			//$("#reading_color").val(colorHSB.toHex());
			$("#color_div").children().val(colorHSB.toHex());
		}
	}
	new ColorPicker($("#colorpicker_button"), options);
  </script>

</div>

<%= f.submit 'Save', class: 'btn btn-primary' %><commit_msg>Fix indentation and cleaned code<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 id="color_div">
    <%= f.text_field :color, class: 'form-control' %>
    <!-- We should use the glyph from bootstrap instead of loading a custom img -->
    <input type="image" id="colorpicker_button" src="/assets/colorpicker.png"</input>
  </div>
  <script>
    options = {
      trigger_event: "click",
      color: {
        r: 0,
        g: 0,
        b: 0
      },
      onChange: function(colorHSB) {
        $("#color_div").children().val(colorHSB.toHex());
      }
    }
    new ColorPicker($("#colorpicker_button"), options);
  </script>
</div>

<%= f.submit 'Save', class: 'btn btn-primary' %>
{'fraction_non_alphanumeric': 0.21408839779005526, 'fraction_numerical': 0.0027624309392265192, 'mean_word_length': 3.5460251046025104, 'pattern_counts': {'":': 0, '<': 51, '<?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': '798469', 'n_tokens_mistral': 827, 'n_tokens_neox': 773, 'n_words': 177}