<commit_before><div data-role="collapsible"<%= defined?(expanded) && expanded ? raw(" data-collapsed=\"false\"") : "" %>>
  <h3><%= heading %></h3>
  <% random_name = SecureRandom.hex(10) %>
  <div id="itemswrapper<%= random_name %>" class="itemswrapper"<%= defined?(position_field) ? raw(" data-position-field=\"" + position_field.to_s + "\"") : "" %>>
    <% childproperties.each do |childproperty| %>
      <%= f.fields_for childpropertiesname, childproperty do |child_fields| %>
        <div class="itemwrapper itemswrapper<%= random_name %>" data-nameprefix="<%= child_fields.object_name %>">
          <%= yield child_fields, childproperty %>
          <% if defined?(position_field) %>
            <%= child_fields.hidden_field(position_field) %>
          <% end %>
          <div data-role="controlgroup" data-type="horizontal">
            <a href="#" onclick="return myplaceonline.formRemoveItem(this);" class="ui-btn ui-btn-icon-left ui-icon-delete ui-btn-inline"><%= deletebutton %></a>
            <% if defined?(position_field) %>
              <a href="#" onclick="return myplaceonline.formMoveItem(this, 1);" class="ui-btn ui-btn-icon-left ui-icon-arrow-d ui-btn-inline"><%= t("myplaceonline.general.movedown", name: itemname) %></a>
              <a href="#" onclick="return myplaceonline.formMoveItem(this, -1);" class="ui-btn ui-btn-icon-left ui-icon-arrow-u ui-btn-inline"><%= t("myplaceonline.general.moveup", name: itemname) %></a>
            <% end %>
          </div>
        </div>
      <% end %>
    <% end %>
    <script type="text/javascript">
    var x<%= random_name %> = <%= raw(formjson.to_json) %>;
    </script>
    <p><a href="#" onclick="return myplaceonline.formAddItem(this, '<%= f.object_name + "[" + childpropertiesname.to_s + "_attributes]" %>', '<%= single_quote_escape(deletebutton) %>', x<%= random_name %>);" class="ui-btn ui-btn-icon-left ui-icon-plus ui-btn-inline"><%= addbutton %></a></p>
  </div>
</div>
<commit_msg>Fix bug when editing picture list without a position field<commit_after><%
  position_field ||= nil
%>
<div data-role="collapsible"<%= defined?(expanded) && expanded ? raw(" data-collapsed=\"false\"") : "" %>>
  <h3><%= heading %></h3>
  <% random_name = SecureRandom.hex(10) %>
  <div id="itemswrapper<%= random_name %>" class="itemswrapper"<%= !position_field.nil? ? raw(" data-position-field=\"" + position_field.to_s + "\"") : "" %>>
    <% childproperties.each do |childproperty| %>
      <%= f.fields_for childpropertiesname, childproperty do |child_fields| %>
        <div class="itemwrapper itemswrapper<%= random_name %>" data-nameprefix="<%= child_fields.object_name %>">
          <%= yield child_fields, childproperty %>
          <% if !position_field.nil? %>
            <%= child_fields.hidden_field(position_field) %>
          <% end %>
          <div data-role="controlgroup" data-type="horizontal">
            <a href="#" onclick="return myplaceonline.formRemoveItem(this);" class="ui-btn ui-btn-icon-left ui-icon-delete ui-btn-inline"><%= deletebutton %></a>
            <% if !position_field.nil? %>
              <a href="#" onclick="return myplaceonline.formMoveItem(this, 1);" class="ui-btn ui-btn-icon-left ui-icon-arrow-d ui-btn-inline"><%= t("myplaceonline.general.movedown", name: itemname) %></a>
              <a href="#" onclick="return myplaceonline.formMoveItem(this, -1);" class="ui-btn ui-btn-icon-left ui-icon-arrow-u ui-btn-inline"><%= t("myplaceonline.general.moveup", name: itemname) %></a>
            <% end %>
          </div>
        </div>
      <% end %>
    <% end %>
    <script type="text/javascript">
    var x<%= random_name %> = <%= raw(formjson.to_json) %>;
    </script>
    <p><a href="#" onclick="return myplaceonline.formAddItem(this, '<%= f.object_name + "[" + childpropertiesname.to_s + "_attributes]" %>', '<%= single_quote_escape(deletebutton) %>', x<%= random_name %>);" class="ui-btn ui-btn-icon-left ui-icon-plus ui-btn-inline"><%= addbutton %></a></p>
  </div>
</div>

{'fraction_non_alphanumeric': 0.20514742628685656, 'fraction_numerical': 0.0029985007496251873, 'mean_word_length': 3.6224018475750577, 'pattern_counts': {'":': 0, '<': 100, '<?xml version=': 0, '>': 100, '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': '4885420', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1293, 'n_words': 234}