<commit_before><%= simple_form_for(view) do |f| %>
    <%= f.input :name %>
    <%= f.input :model, as: :select, collection: Riews::View.available_models %>
    <%= f.input :code %>
    <%= f.input :paginator_size %>

    <% if view.persisted? && view.model.present? %>
        <%= content_tag :h3, 'Relationships' %>
        <%= content_tag :div, class: 'form-inline' do %>
            <%= f.fields_for :relationships do |ff| %>
                <%= render 'relationship_fields', f: ff %>
            <% end %>
        <% end %>
        <%= content_tag :div do %>
            <%= link_to_add_association 'Add relationship', f, :relationships %>
        <% end %>

        <%= content_tag :h3, 'Columns' %>
        <%= content_tag :div, class: 'form-inline' do %>
            <%= f.fields_for :columns do |ff| %>
                <%= render 'column_fields', f: ff %>
            <% end %>
        <% end %>
        <%= content_tag :div do %>
            <%= link_to_add_association 'Add column', f, :columns %>
        <% end %>

        <%= content_tag :h3, 'Filters' %>
        <%= content_tag :div, class: 'form-inline' do %>
            <%= f.simple_fields_for :filter_criterias do |ff| %>
                <%= render 'filter_criteria_fields', f: ff %>
            <% end %>
        <% end %>
        <%= content_tag :div do %>
            <%= link_to_add_association 'Add filter', f, :filter_criterias %>
        <% end %>
    <% end %>

    <%= f.submit %>
<% end %>
<commit_msg>Use a tabbed interface in views form<commit_after><%= simple_form_for(view) do |f| %>

    <%= nav layout: :justified do %>
        <%= link_to 'Basic info', '#basic', data: { toggle: 'tab' } %>
        <% if view.persisted? && view.model.present? %>
            <%= link_to 'Relationships', '#relationships', data: { toggle: 'tab' } %>
            <%= link_to 'Columns', '#columns', data: { toggle: 'tab' } %>
            <%= link_to 'Filters', '#filters', data: { toggle: 'tab' } %>
        <% end %>
    <% end %>

    <div class="tab-content">
      <div id="basic" class="tab-pane fade in active">
        <%= f.input :name %>
        <%= f.input :model, as: :select, collection: Riews::View.available_models, include_blank: false %>
        <%= f.input :code %>
        <%= f.input :paginator_size %>
      </div>
      <% if view.persisted? && view.model.present? %>

          <div id="relationships" class="tab-pane fade">
            <%= content_tag :h3, 'Relationships' %>
            <%= content_tag :div, class: 'form-inline' do %>
                <%= f.fields_for :relationships do |ff| %>
                    <%= render 'relationship_fields', f: ff %>
                <% end %>
            <% end %>
            <%= content_tag :div do %>
                <%= link_to_add_association 'Add relationship', f, :relationships %>
            <% end %>
          </div>
          <div id="columns" class="tab-pane fade">
            <%= content_tag :h3, 'Columns' %>
            <%= content_tag :div, class: 'form-inline' do %>
                <%= f.fields_for :columns do |ff| %>
                    <%= render 'column_fields', f: ff %>
                <% end %>
            <% end %>
            <%= content_tag :div do %>
                <%= link_to_add_association 'Add column', f, :columns %>
            <% end %>
          </div>
          <div id="filters" class="tab-pane fade">
            <%= content_tag :h3, 'Filters' %>
            <%= content_tag :div, class: 'form-inline' do %>
                <%= f.simple_fields_for :filter_criterias do |ff| %>
                    <%= render 'filter_criteria_fields', f: ff %>
                <% end %>
            <% end %>
            <%= content_tag :div do %>
                <%= link_to_add_association 'Add filter', f, :filter_criterias %>
            <% end %>
          </div>
          </div>
      <% end %>

      <%= f.submit %>
<% end %>

{'fraction_non_alphanumeric': 0.17950693374422189, 'fraction_numerical': 0.0015408320493066256, 'mean_word_length': 1.8102453102453102, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 93, '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': '4635227', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1184, 'n_words': 273}