<commit_before><%
  description ||= "image"
  thumbnail ||= "medium"
  toggle_image_display ||= false
  randomiser = rand(Time.now.yesterday.to_i * Time.now.to_i)
-%>
<%= link_to "Show", "", :id => "current_image_toggler_#{randomiser}" if toggle_image_display -%>
<%= f.hidden_field field, :id => "current_image_id_#{randomiser}" -%>

<div id='current_image_container_<%= randomiser %>'<%= " style='display: none'" if toggle_image_display %> style="margin-top: 10px;">
  <a id='current_image_link_<%= randomiser %>' href="<%= insert_admin_images_url %>?thickbox=true&amp;modal=true&amp;titlebar=true&amp;callback=image_picker_<%= randomiser %>_changed&amp;KeepThis=true&amp;TB_iframe=true&amp;width=958&amp;height=510" style='border: 0px' title='Change <%= description.titleize %>' name='Change <%= description.titleize %>' class='thickbox'>
    <% unless image.nil? -%>
      <%= image_fu image, nil, {:class => "brown_border", :id => "current_picked_image"} %>
    <% else -%>
      <img id="current_picked_image_<%= randomiser %>" class="" src="" alt="" style='display: none' />
    <% end -%>
    <p id='no_picked_image_selected_<%= randomiser %>' <%= "style='display: none;'" if image.present? %>>
      There is currently no <%= description %> selected, please click here to add one.
    </p>
  </a>
  <br/>
  <%= link_to "Remove current #{description}", "#", :id => "remove_picked_image_#{randomiser}", :style => "#{"display:none;" if image.nil?}" %>
</div>

<% content_for :head do -%>
  <script type='text/javascript'>
    // We're so un-object-oriented here. We need to rewrite the jQuery admin.js file to use OO.
    var image_picker_<%= randomiser %>_options = {
      thumbnail: '<%= thumbnail %>'
      , image_toggler: '<%= toggle_image_display ? "#current_image_toggler_#{randomiser}" : "null" %>'
      , description: '<%= description %>'
      , field: '#current_image_id_<%= randomiser %>'
      , image_display: '#current_picked_image_<%= randomiser %>'
      , no_image_message: '#no_picked_image_selected_<%= randomiser %>'
      , remove_image_button: '#remove_picked_image_<%= randomiser %>'
      , image_container: '#current_image_container_<%= randomiser %>'
    };

    $(document).ready(function(e) {
      image_picker.init(image_picker_<%= randomiser %>_options);
    });

    image_picker_<%= randomiser %>_changed = function(args) {
      image_picker.init(image_picker_<%= randomiser %>_options);
      image_picker.changed(args);
    }
  </script>
<% end %>
<commit_msg>fix id<commit_after><%
  description ||= "image"
  thumbnail ||= "medium"
  toggle_image_display ||= false
  randomiser = rand(Time.now.yesterday.to_i * Time.now.to_i)
-%>
<%= link_to "Show", "", :id => "current_image_toggler_#{randomiser}" if toggle_image_display -%>
<%= f.hidden_field field, :id => "current_image_id_#{randomiser}" -%>

<div id='current_image_container_<%= randomiser %>'<%= " style='display: none'" if toggle_image_display %> style="margin-top: 10px;">
  <a id='current_image_link_<%= randomiser %>' href="<%= insert_admin_images_url %>?thickbox=true&amp;modal=true&amp;titlebar=true&amp;callback=image_picker_<%= randomiser %>_changed&amp;KeepThis=true&amp;TB_iframe=true&amp;width=958&amp;height=510" style='border: 0px' title='Change <%= description.titleize %>' name='Change <%= description.titleize %>' class='thickbox'>
    <% unless image.nil? -%>
      <%= image_fu image, nil, {:class => "brown_border", :id => "current_picked_image_#{randomiser}"} %>
    <% else -%>
      <img id="current_picked_image_<%= randomiser %>" class="" src="" alt="" style='display: none' />
    <% end -%>
    <p id='no_picked_image_selected_<%= randomiser %>' <%= "style='display: none;'" if image.present? %>>
      There is currently no <%= description %> selected, please click here to add one.
    </p>
  </a>
  <br/>
  <%= link_to "Remove current #{description}", "#", :id => "remove_picked_image_#{randomiser}", :style => "#{"display:none;" if image.nil?}" %>
</div>

<% content_for :head do -%>
  <script type='text/javascript'>
    // We're so un-object-oriented here. We need to rewrite the jQuery admin.js file to use OO.
    var image_picker_<%= randomiser %>_options = {
      thumbnail: '<%= thumbnail %>'
      , image_toggler: '<%= toggle_image_display ? "#current_image_toggler_#{randomiser}" : "null" %>'
      , description: '<%= description %>'
      , field: '#current_image_id_<%= randomiser %>'
      , image_display: '#current_picked_image_<%= randomiser %>'
      , no_image_message: '#no_picked_image_selected_<%= randomiser %>'
      , remove_image_button: '#remove_picked_image_<%= randomiser %>'
      , image_container: '#current_image_container_<%= randomiser %>'
    };

    $(document).ready(function(e) {
      image_picker.init(image_picker_<%= randomiser %>_options);
    });

    image_picker_<%= randomiser %>_changed = function(args) {
      image_picker.init(image_picker_<%= randomiser %>_options);
      image_picker.changed(args);
    }
  </script>
<% end %>

{'fraction_non_alphanumeric': 0.18835957743671516, 'fraction_numerical': 0.0035878014749850507, 'mean_word_length': 4.86214953271028, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 101, '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': '3316982', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1681, 'n_words': 315}