<commit_before><%
  models = RailsAdmin::Config.visible_models.select { |model| authorized?(:list, model.abstract_model) }
  root_models = models.select { |model| model.parent == :root }
  max_visible_tabs = (root_models.length == models.length ? RailsAdmin::Config::Sections::Navigation.max_visible_tabs : root_models.length)
%>
<ul id="nav">
  <li class="<%= "active" if @page_type == "dashboard" %>">
    <%= link_to(t("admin.dashboard.name"), rails_admin_dashboard_path) %>
  </li>
  <% root_models[0..max_visible_tabs-1].each do |model| %>
    <% 
      children = models.select { |m| m.parent.to_s == model.abstract_model.model.to_s }
     %>
    <li class="<%= "active" if @page_type == model.abstract_model.pretty_name.downcase %> <%= "more" unless children.empty? %>">
      <% unless model.dropdown %>
        <%= link_to(model.label, rails_admin_list_path(:model_name => model.abstract_model.to_param)) %>
      <% else %>
        <a href="#"><%= t(model.dropdown.to_s, :default => model.dropdown.to_s) %></a>
        <% children = [model] + children %>
      <% end %>
      <ul>
        <% children.each do |child| %>
          <li <%if @page_type == child.abstract_model.pretty_name.downcase %>class="active"<% end %>>
            <%= link_to(child.label, rails_admin_list_path(:model_name => child.abstract_model.to_param)) %>
          </li>
        <% end %>
      </ul>
    </li>
  <% end %>
  <% if root_models.size > max_visible_tabs %>
    <li class="more plus">
      <a href="#">&raquo;</a>
      <ul>
      <% root_models[max_visible_tabs..root_models.size].each do |model| %>
        <li <%if @page_type == model.abstract_model.pretty_name.downcase %>class="active"<% end %>>
          <%= link_to(model.label, rails_admin_list_path(:model_name => model.abstract_model.to_param)) %>
        </li>
      <% end %>
      </ul>
    </li>
  <% end %>
</ul><commit_msg>Added sdrew commit (parent tab active when child selected)<commit_after><%
  models = RailsAdmin::Config.visible_models.select { |model| authorized?(:list, model.abstract_model) }
  root_models = models.select { |model| model.parent == :root }
  max_visible_tabs = (root_models.length == models.length ? RailsAdmin::Config::Sections::Navigation.max_visible_tabs : root_models.length)
%>
      <ul id="nav">
        <li class="<%= "active" if @page_type == "dashboard" %>">
          <%= link_to(t("admin.dashboard.name"), rails_admin_dashboard_path) %>
        </li>
        <% root_models[0..max_visible_tabs-1].each do |model| %>
          <%
            tab_titles = [model.abstract_model.pretty_name.downcase]
            children = models.select { |m| m.parent.to_s == model.abstract_model.model.to_s }
            children.each { |child| tab_titles << child.abstract_model.pretty_name.downcase } 
          %>
          <li class="<%= "active" if tab_titles.include? @page_type %> <%= "more" unless children.empty? %>">
            <% unless model.dropdown %>
              <%= link_to(model.label, rails_admin_list_path(:model_name => model.abstract_model.to_param)) %>
            <% else %>
              <a href="#"><%= t(model.dropdown.to_s, :default => model.dropdown.to_s) %></a>
              <% children = [model] + children %>
            <% end %>
            <ul>
              <% children.each do |child| %>
                <li class="<%= "active" if @page_type == child.abstract_model.pretty_name.downcase %>">
                  <%= link_to(child.label, rails_admin_list_path(:model_name => child.abstract_model.to_param)) %>
                </li>
              <% end %>
            </ul>
          </li>
        <% end %>
        <% if root_models.size > max_visible_tabs %>
          <li class="more plus">
            <a href="#">&raquo;</a>
            <ul>
            <% models[max_visible_tabs..root_models.size].each do |model| %>
              <li <%if @page_type == model.abstract_model.pretty_name.downcase %>class="active"<% end %>>
                <%= link_to(model.label, rails_admin_list_path(:model_name => model.abstract_model.to_param)) %>
              </li>
            <% end %>
            </ul>
          </li>
        <% end %>
      </ul>
{'fraction_non_alphanumeric': 0.17445482866043613, 'fraction_numerical': 0.000958543014617781, 'mean_word_length': 2.610726643598616, 'pattern_counts': {'":': 0, '<': 96, '<?xml version=': 0, '>': 104, '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': '3946649', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1323, 'n_words': 223}