<commit_before><%
  Dir.glob(Rails.root.join('app/models/*')).each do |model_class|
    is_directory = File.directory? model_class
    next if is_directory

    require model_class
  end
%>

<div class="navbar navbar-<%= navbar_class %> navbar-fixed-top">

  <div class="container-fluid">

    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-inverse-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <%= link_to 'Julia Observer', root_path, class: "navbar-brand" %>
    </div>

    <div class="navbar-collapse collapse navbar-inverse-collapse">

      <%= form_tag root_path, class: "navbar-form navbar-left", method: :get do %>
        <div class="form-group">
          <%= autocomplete_field_tag :search, params[:search], autocomplete_package_name_packages_path, class: "form-control col-sm-8", placeholder: "Search" %>
        </div>
      <% end %>

      <ul class="nav navbar-nav navbar-right">

        <%
          is_package_path = controller_name == 'packages'
          is_root_path = is_package_path && action_name == 'index'
        %>

        <li class="<%= is_root_path ? 'active' : '' %>">
          <%= link_to 'Home', root_path %>
        </li>

        <% unless is_root_path %>

          <% unless is_package_path %>

            <li class="<%= (action_name == 'index') ? 'active' : '' %>">
              <%= link_to controller_name.titleize, send("#{controller_name}_path") %>
            </li>

          <% end %>

          <% unless action_name == 'index' %>

            <li class="active">
              <% params_id = params[:id] %>

              <%
                params_id = params_id.titleize \
                  if controller_name == 'logs'
              %>

              <% case action_name %>
              <% when 'show' %>
                <%= link_to truncate(params_id, length: 25), send("#{controller_name.singularize}_path"), @model %>
              <% when 'edit' %>
                <%= link_to truncate(params_id, length: 25), send("edit_#{controller_name.singularize}_path"), @model %>
              <% when 'new' %>
                <%= link_to 'New', send("new_#{controller_name.singularize}_path") %>
              <% else %>
                <a>ruh roh</a>
              <% end %>
            </li>

          <% end %>

        <% end %>

        <li class="dropdown">
          <a href="index.html" data-target="#" class="dropdown-toggle" data-toggle="dropdown">
            <b class="caret"></b></a>
          <ul class="dropdown-menu">

            <li>
              <a href="https://github.com/djsegal/julia_observer" target="_blank">
                Github Page
              </a>
            </li>

            <li class="divider"></li>

            <li class="dropdown-header">Models</li>
              <% ApplicationRecord.descendants.each do |model_class| %>

                <%<commit_msg>Change dropdown link to use javascript:void(0)<commit_after><%
  Dir.glob(Rails.root.join('app/models/*')).each do |model_class|
    is_directory = File.directory? model_class
    next if is_directory

    require model_class
  end
%>

<div class="navbar navbar-<%= navbar_class %> navbar-fixed-top">

  <div class="container-fluid">

    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-inverse-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <%= link_to 'Julia Observer', root_path, class: "navbar-brand" %>
    </div>

    <div class="navbar-collapse collapse navbar-inverse-collapse">

      <%= form_tag root_path, class: "navbar-form navbar-left", method: :get do %>
        <div class="form-group">
          <%= autocomplete_field_tag :search, params[:search], autocomplete_package_name_packages_path, class: "form-control col-sm-8", placeholder: "Search" %>
        </div>
      <% end %>

      <ul class="nav navbar-nav navbar-right">

        <%
          is_package_path = controller_name == 'packages'
          is_root_path = is_package_path && action_name == 'index'
        %>

        <li class="<%= is_root_path ? 'active' : '' %>">
          <%= link_to 'Home', root_path %>
        </li>

        <% unless is_root_path %>

          <% unless is_package_path %>

            <li class="<%= (action_name == 'index') ? 'active' : '' %>">
              <%= link_to controller_name.titleize, send("#{controller_name}_path") %>
            </li>

          <% end %>

          <% unless action_name == 'index' %>

            <li class="active">
              <% params_id = params[:id] %>

              <%
                params_id = params_id.titleize \
                  if controller_name == 'logs'
              %>

              <% case action_name %>
              <% when 'show' %>
                <%= link_to truncate(params_id, length: 25), send("#{controller_name.singularize}_path"), @model %>
              <% when 'edit' %>
                <%= link_to truncate(params_id, length: 25), send("edit_#{controller_name.singularize}_path"), @model %>
              <% when 'new' %>
                <%= link_to 'New', send("new_#{controller_name.singularize}_path") %>
              <% else %>
                <a>ruh roh</a>
              <% end %>
            </li>

          <% end %>

        <% end %>

        <li class="dropdown">
          <a href="javascript:void(0)" data-target="#" class="dropdown-toggle" data-toggle="dropdown">
            <b class="caret"></b></a>
          <ul class="dropdown-menu">

            <li>
              <a href="https://github.com/djsegal/julia_observer" target="_blank">
                Github Page
              </a>
            </li>

            <li class="divider"></li>

            <li class="dropdown-header">Models</li>
              <% ApplicationRecord.descendants.each do |model_class| %>

                <%
{'fraction_non_alphanumeric': 0.16434083073386965, 'fraction_numerical': 0.0019701198489574783, 'mean_word_length': 1.9995076317085179, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 137, 'https://': 2, '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': '107943', 'n_tokens_mistral': 1980, 'n_tokens_neox': 1759, 'n_words': 339}