<commit_before><%# todo extract "sidebar" and call it with @content, then also do the same in documents/components/smart_sidebar %>
<% serialized_entity = ContentSerializer.new(content) %>

<ul id="quick-reference-<%= content.class.name %>-<%= content.id %>" class="sidenav quick-reference-sidenav">
  <li>
    <div class="user-view">
      <div class="background">
        <%= image_tag "card-headers/#{content.class.name.downcase.pluralize}.jpg", width: '100%' %>
      </div>
      <a href="#name">
        <h1 class="white-text name bordered-text">
          <i class="material-icons <%= content.class.color %>-text left">
            <%= content.class.icon %>
          </i>
          <%= content.name %>
        </h1>
      </a>
      <a href="#email">
        <span class="white-text description bordered-text">
          <%= truncate content.description %>
        </span>
      </a>
    </div>
  </li>

  <li><a href="#" class="subheader">Quick-reference</a></li>

  <% serialized_entity.data[:categories].each do |serialized_category| %>
    <% next if serialized_category[:label].downcase == 'gallery' %>
    <% next if serialized_category[:label].downcase == 'contributors' %>
    <li class="no-padding">
      <ul class="collapsible collapsible-accordion">
        <li class="bold waves-effect">
          <a class="collapsible-header" tabindex="0">
            <i class="material-icons left"><%= serialized_category[:icon] %></i>
            <%= serialized_category[:label] %>
            <i class="material-icons chevron">chevron_right</i>
          </a>
          <div class="collapsible-body reference-fields-container">
            <ul class="reference-fields-list selectable">
              <% any_filled_in_fields = false %>
              <% serialized_category[:fields].each do |serialized_field| %>
                <% next unless serialized_field[:value].present? %>
                <% any_filled_in_fields = true %>
                <li>
                  <a href="#" class="subheader"><%= serialized_field[:label] %></a>
                </li>

                <% if serialized_field[:type] == "text_area" %>
                  <li><%= serialized_field[:value] %></li>
                <% elsif serialized_field[:type] == "link" %>
                  <% serialized_field[:value].each do |related_page| %>
                    <li>
                      <%= link_to related_page do %>
                        <i class="material-icons <%= related_page.class.color %>-text left">
                          <%= related_page.class.icon %>
                        </i>
                        <%= related_page.name %>
                      <% end %>
                    </li>
                  <% end %>
                <% elsif serialized_field[:type] == "name" %>
                  <li><%= serialized_field[:value] %></li>

                <% elsif serialized_field[:type] == "universe" %>
                  <% if serialized_entity.universe.present? %><commit_msg>use new link display style on smart sidebar<commit_after><%# todo extract "sidebar" and call it with @content, then also do the same in documents/components/smart_sidebar %>
<% serialized_entity = ContentSerializer.new(content) %>

<ul id="quick-reference-<%= content.class.name %>-<%= content.id %>" class="sidenav quick-reference-sidenav">
  <li>
    <div class="user-view">
      <div class="background">
        <%= image_tag "card-headers/#{content.class.name.downcase.pluralize}.jpg", width: '100%' %>
      </div>
      <a href="#name">
        <h1 class="white-text name bordered-text">
          <i class="material-icons <%= content.class.color %>-text left">
            <%= content.class.icon %>
          </i>
          <%= content.name %>
        </h1>
      </a>
      <a href="#email">
        <span class="white-text description bordered-text">
          <%= truncate content.description %>
        </span>
      </a>
    </div>
  </li>

  <li><a href="#" class="subheader">Quick-reference</a></li>

  <% serialized_entity.data[:categories].each do |serialized_category| %>
    <% next if serialized_category[:label].downcase == 'gallery' %>
    <% next if serialized_category[:label].downcase == 'contributors' %>
    <li class="no-padding">
      <ul class="collapsible collapsible-accordion">
        <li class="bold waves-effect">
          <a class="collapsible-header" tabindex="0">
            <i class="material-icons left"><%= serialized_category[:icon] %></i>
            <%= serialized_category[:label] %>
            <i class="material-icons chevron">chevron_right</i>
          </a>
          <div class="collapsible-body reference-fields-container">
            <ul class="reference-fields-list selectable">
              <% any_filled_in_fields = false %>
              <% serialized_category[:fields].each do |serialized_field| %>
                <% next unless serialized_field[:value].present? %>
                <% any_filled_in_fields = true %>
                <li>
                  <a href="#" class="subheader"><%= serialized_field[:label] %></a>
                </li>

                <% if serialized_field[:type] == "text_area" %>
                  <li><%= serialized_field[:value] %></li>
                <% elsif serialized_field[:type] == "link" %>
                  <%=
                    render partial: "content/display/attribute_value/link", 
                      locals: { value: serialized_field[:value], content: content }
                  %>
                <% elsif serialized_field[:type] == "name" %>
                  <li><%= serialized_field[:value] %></li>

                <% elsif serialized_field[:type] == "universe" %>
                  <% if serialized_entity.universe.present? %>
{'fraction_non_alphanumeric': 0.16363953894516242, 'fraction_numerical': 0.00209570380719525, 'mean_word_length': 2.1209809264305175, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 147, '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': '4811246', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1570, 'n_words': 313}