<commit_before><%= javascript_include_tag "camaleon_cms/admin/custom_fields_form" %>
<div class="page-title">
    <h2><span class="fa fa-cog"></span> <%= @field_group.new_record? ? t('camaleon_cms.admin.settings.new_custom_field_group') : "#{t('camaleon_cms.admin.settings.new_custom_field_group')}: #{@field_group.name} "%> </h2>
</div>

<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap" id="cama_custom_field_form" data-group_class_name="<%= @field_group.object_class %>,<%= @field_group.objectid %>">
    <div class="row">
        <%= form_for @field_group, as: "custom_field_group", url:{action: @field_group.new_record? ? :create : :update}, html: {class: 'validate-custom-field cama_ajax_request'} do |f| %>
            <div class="col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><%= t('camaleon_cms.admin.settings.details_custom_field_group') %></h3>
                    </div>
                    <div class="panel-body">
                        <%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @field_group} %>
                        <div class="form-group">
                            <%= f.label t('camaleon_cms.admin.table.name') %><br>
                            <%= f.text_field :name, :class => "form-control required" %>
                        </div>
                        <div class="form-group">
                            <%= f.label t('camaleon_cms.admin.table.description') %><br>
                            <%= f.text_area :description, :class => "form-control" %>
                        </div>
                        <div class="form-group">
                            <%= f.label t('camaleon_cms.admin.settings.where_display_group') %><br>
                            <select id="select_assign_group" name="custom_field_group[assign_group]" class="form-control required">
                                <option value="">&nbsp;</option>
                                <optgroup label="<%= t('camaleon_cms.admin.settings.posts_in') %>">
                                    <% current_site.post_types.each do |pt| pt = pt.decorate; value = "PostType_Post,#{pt.id}" %>
                                        <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_posts')}"+ pt.the_title %>"><%= pt.the_title %></option>
                                    <% end  %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.settings.categories_in') %>">
                                    <% current_site.post_types.each do |pt| pt = pt.decorate; value = "PostType_Category,#{pt.id}" %>
                                        <% if pt.manage_categories? %>
                                            <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_categories')}"+ pt.the_title %>"><%= pt.the_title %></option>
                                        <% end %>
                                    <% end  %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.settings.post_tags_in', default: 'Post Tags In') %>">
                                    <% current_site.post_types.each do |pt| pt = pt.decorate; value = "PostType_PostTag,#{pt.id}" %>
                                        <% if pt.manage_tags? %>
                                            <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_tags', default: 'Add Custom Field in Post Tags of ')}"+ pt.the_title %>"><%= pt.the_title %></option>
                                        <% end %>
                                    <% end  %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.settings.others') %>">
                                    <% value = "User,#{current_site.id}" %>
                                    <option value="<%= value %>" data-help="<%= t('camaleon_cms.admin.settings.tooltip.add_custom_field_users') %>"><%= t('camaleon_cms.admin.sidebar.users') %></option>
                                    <% value = "Site,#{current_site.id}" %>
                                    <option value="<%= value %>" data-help="<%= t('camaleon_cms.admin.settings.tooltip.add_custom_field_sites') %>"><%= t('camaleon_cms.admin.sidebar.site_settings') %></option>
                                    <% @_extra_models_for_fields.each do |model| %>
                                        <% value = "#{model.name},#{current_site.id}" %>
                                        <option value="<%= value %>" data-help=""><%= model.name %></option><%= model.name %>
                                    <% end %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.sidebar.themes') %>">
                                    <option value="Theme,<%= current_theme.id %>" data-help=""><%= current_theme.name %></option>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.sidebar.menus') %>">
                                    <% current_site.nav_menus.each do |menu| %>
                                        <option value="NavMenu,<%= menu.id %>" data-help=""><%= menu.name %></option>
                                    <% end %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.sidebar.widgets') %>">
                                    <% current_site.widgets.each do |widget| %>
                                        <% value = "#{widget.class.name},#{widget.id}" %>
                                        <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_widget')}"+ widget.name %>"><%= widget.name %></option>
                                    <% end %>
                                </optgroup>
                                <option value="_post_simple" >Select Post Simple</option>
                            </select>
                            <select id="select_post_simple" name="custom_field_group[assign_group]" class="form-control required" style="display: none" disabled>
                                <% current_site.post_types.each do |pt| pt = pt.decorate %>
                                    <optgroup label="<%= pt.the_title %>">
                                        <% pt.posts.visible_frontend.each do |post| value = "#{post.class.name},#{post.id}".parseCamaClass; post = post.decorate %>
                                            <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_posts')}"+ post.the_title %>"><%= post.the_title %></option>
                                        <% end %>
                                    </optgroup>
                                <% end %>
                            </select>
                            <input id="select_assign_group_caption" type="hidden" name="custom_field_group[caption]"/>
                            <div id="select_assign_group_help"></div>
                        </div>
                    </div>
                    <div class="panel-footer">
                        <a class="btn btn-default" role="back" href="<%= url_for action: :index %>"><%= t('camaleon_cms.admin.button.back') %></a>
                        <button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit') %></button>
                    </div>
                </div>
            </div>
            <div class="col-md-5">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><%= t('camaleon_cms.admin.settings.fields') %></h3>
                    </div>
                    <div class="panel-body padding-0">
                        <% fields =  @field_group.new_record? ? [] : @field_group.fields %>
                        <ul id="sortable-fields" class="clear"><commit_msg>removed widget from custom field group select options<commit_after><%= javascript_include_tag "camaleon_cms/admin/custom_fields_form" %>
<div class="page-title">
    <h2><span class="fa fa-cog"></span> <%= @field_group.new_record? ? t('camaleon_cms.admin.settings.new_custom_field_group') : "#{t('camaleon_cms.admin.settings.new_custom_field_group')}: #{@field_group.name} "%> </h2>
</div>

<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap" id="cama_custom_field_form" data-group_class_name="<%= @field_group.object_class %>,<%= @field_group.objectid %>">
    <div class="row">
        <%= form_for @field_group, as: "custom_field_group", url:{action: @field_group.new_record? ? :create : :update}, html: {class: 'validate-custom-field cama_ajax_request'} do |f| %>
            <div class="col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><%= t('camaleon_cms.admin.settings.details_custom_field_group') %></h3>
                    </div>
                    <div class="panel-body">
                        <%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @field_group} %>
                        <div class="form-group">
                            <%= f.label t('camaleon_cms.admin.table.name') %><br>
                            <%= f.text_field :name, :class => "form-control required" %>
                        </div>
                        <div class="form-group">
                            <%= f.label t('camaleon_cms.admin.table.description') %><br>
                            <%= f.text_area :description, :class => "form-control" %>
                        </div>
                        <div class="form-group">
                            <%= f.label t('camaleon_cms.admin.settings.where_display_group') %><br>
                            <select id="select_assign_group" name="custom_field_group[assign_group]" class="form-control required">
                                <option value="">&nbsp;</option>
                                <optgroup label="<%= t('camaleon_cms.admin.settings.posts_in') %>">
                                    <% current_site.post_types.each do |pt| pt = pt.decorate; value = "PostType_Post,#{pt.id}" %>
                                        <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_posts')}"+ pt.the_title %>"><%= pt.the_title %></option>
                                    <% end  %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.settings.categories_in') %>">
                                    <% current_site.post_types.each do |pt| pt = pt.decorate; value = "PostType_Category,#{pt.id}" %>
                                        <% if pt.manage_categories? %>
                                            <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_categories')}"+ pt.the_title %>"><%= pt.the_title %></option>
                                        <% end %>
                                    <% end  %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.settings.post_tags_in', default: 'Post Tags In') %>">
                                    <% current_site.post_types.each do |pt| pt = pt.decorate; value = "PostType_PostTag,#{pt.id}" %>
                                        <% if pt.manage_tags? %>
                                            <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_tags', default: 'Add Custom Field in Post Tags of ')}"+ pt.the_title %>"><%= pt.the_title %></option>
                                        <% end %>
                                    <% end  %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.settings.others') %>">
                                    <% value = "User,#{current_site.id}" %>
                                    <option value="<%= value %>" data-help="<%= t('camaleon_cms.admin.settings.tooltip.add_custom_field_users') %>"><%= t('camaleon_cms.admin.sidebar.users') %></option>
                                    <% value = "Site,#{current_site.id}" %>
                                    <option value="<%= value %>" data-help="<%= t('camaleon_cms.admin.settings.tooltip.add_custom_field_sites') %>"><%= t('camaleon_cms.admin.sidebar.site_settings') %></option>
                                    <% @_extra_models_for_fields.each do |model| %>
                                        <% value = "#{model.name},#{current_site.id}" %>
                                        <option value="<%= value %>" data-help=""><%= model.name %></option><%= model.name %>
                                    <% end %>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.sidebar.themes') %>">
                                    <option value="Theme,<%= current_theme.id %>" data-help=""><%= current_theme.name %></option>
                                </optgroup>

                                <optgroup label="<%= t('camaleon_cms.admin.sidebar.menus') %>">
                                    <% current_site.nav_menus.each do |menu| %>
                                        <option value="NavMenu,<%= menu.id %>" data-help=""><%= menu.name %></option>
                                    <% end %>
                                </optgroup>

                                <!--optgroup label="<%#= t('camaleon_cms.admin.sidebar.widgets') %>">
                                    <%# current_site.widgets.each do |widget| %>
                                        <%# value = "#{widget.class.name},#{widget.id}" %>
                                        <option value="<%#= value %>" data-help="<%#= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_widget')}"+ widget.name %>"><%#= widget.name %></option>
                                    <%# end %>
                                </optgroup -->
                                <option value="_post_simple" >Select Post Simple</option>
                            </select>
                            <select id="select_post_simple" name="custom_field_group[assign_group]" class="form-control required" style="display: none" disabled>
                                <% current_site.post_types.each do |pt| pt = pt.decorate %>
                                    <optgroup label="<%= pt.the_title %>">
                                        <% pt.posts.visible_frontend.each do |post| value = "#{post.class.name},#{post.id}".parseCamaClass; post = post.decorate %>
                                            <option value="<%= value %>" data-help="<%= "#{t('camaleon_cms.admin.settings.tooltip.add_custom_field_posts')}"+ post.the_title %>"><%= post.the_title %></option>
                                        <% end %>
                                    </optgroup>
                                <% end %>
                            </select>
                            <input id="select_assign_group_caption" type="hidden" name="custom_field_group[caption]"/>
                            <div id="select_assign_group_help"></div>
                        </div>
                    </div>
                    <div class="panel-footer">
                        <a class="btn btn-default" role="back" href="<%= url_for action: :index %>"><%= t('camaleon_cms.admin.button.back') %></a>
                        <button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit') %></button>
                    </div>
                </div>
            </div>
            <div class="col-md-5">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><%= t('camaleon_cms.admin.settings.fields') %></h3>
                    </div>
                    <div class="panel-body padding-0">
                        <% fields =  @field_group.new_record? ? [] : @field_group.fields %>
                        <ul id="sortable-fields" class="clear">
{'fraction_non_alphanumeric': 0.15695201581501228, 'fraction_numerical': 0.001078296291858863, 'mean_word_length': 1.3947783675225935, 'pattern_counts': {'":': 0, '<': 335, '<?xml version=': 0, '>': 339, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 94, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4939730', 'n_tokens_mistral': 4728, 'n_tokens_neox': 4295, 'n_words': 684}