<commit_before><%
  # Partial locals: `content` to ask a question about
  categories_for_this_type = AttributeCategory.where(
    user:        current_user,
    entity_type: content.class.name.downcase,
    hidden:      [nil, false]
  )

  fields_for_these_categories = AttributeField.where(
    user:        current_user,
    field_type:  ["textarea", "text_area", "textearea"],
    hidden:      [nil, false],
    attribute_category_id: categories_for_this_type.pluck(:id)
  )

  empty_attribute_value = Attribute.find_by(
    entity_type: content.class.name,
    entity_id:   content.id,
    value:       ["", nil],
    attribute_field_id: fields_for_these_categories.pluck(:id)
  )

  associated_attribute_field = empty_attribute_value.attribute_field if empty_attribute_value.present?
%>

<% if empty_attribute_value.present? %>
  <div class="content-question card">
    <div class="card-content light-blue darken-1 white-text">
      <i class="material-icons <%= content.class.color %>-text circle right circle white"><%= content.class.icon %></i>
      <strong>
        <%=
          t(
            "serendipitous_questions.attributes.#{content.class.name.downcase}.#{associated_attribute_field.label.downcase}",
            name:    content.name_field_value,
            default: "What is #{content.name_field_value}'s #{associated_attribute_field.label.downcase}?"
          )
        %>
      </strong>
    </div>
    <div class="card-tabs">
      <ul class="tabs tabs-fixed-width">
        <li class="tab"><a class="active" href="#tristan-answer">Quick Answer</a></li>
        <li class="tab"><a href="#tristan-reference">Quick Reference</a></li>
      </ul>
    </div>
    <div class="card-content lighten-4">
      <div id="tristan-answer">
        <%= form_for content do |f| %>
          <%= hidden_field(:override, :redirect_path, value: redirect_path) if defined?(redirect_path) %>

          <%=
            render 'content/form/text_input',
              f: f,
              content: content,
              field: associated_attribute_field
          %>

          <%= button_tag(type: 'submit', class: "content-question-submit waves-effect waves-light btn #{content.class.color} right") do %>
            Update <%= content.name.downcase %>
          <% end %>
          <div style="clear: both;"></div>
        <% end %>
      </div>
      <div id="tristan-reference">
        <div class="row">
          <div class="col hide-on-small-only m3 underlap">
            <%= image_tag 'tristan/small',
              class: 'tooltipped tristan',
              data: {
                position: 'right',
                enterDelay: '500',
                tooltip: "Hey, I'm Tristan! I'm happy to look up relevant information like this for you."
              } %>
          </div>
          <div class="col s12 m9">
            <%= render partial: 'content/display/quick_reference', locals: { content: content } %>
          </div>
        </div>
      </div>
    </div>
  </div>
<% elsif defined?(show_empty_prompt) && show_empty_prompt %>
  <div class="row">
    <div class="col s12 m9">
      <h5>Hey! It looks like I don't have any more prompts for you right now. I'll get to work coming up with some!</h5>
      <p>In the meantime, I'll get a big boost of prompts if you create more pages I can think about! You can also check back later and I might have more prompts for your current pages.</p><commit_msg>ditto serendipitous cards<commit_after><%
  # Partial locals: `content` to ask a question about
  categories_for_this_type = AttributeCategory.where(
    user:        current_user,
    entity_type: content.class.name.downcase,
    hidden:      [nil, false]
  )

  fields_for_these_categories = AttributeField.where(
    user:        current_user,
    field_type:  ["textarea", "text_area", "textearea"],
    hidden:      [nil, false],
    attribute_category_id: categories_for_this_type.pluck(:id)
  )

  empty_attribute_value = Attribute.find_by(
    entity_type: content.class.name,
    entity_id:   content.id,
    value:       ["", nil],
    attribute_field_id: fields_for_these_categories.pluck(:id)
  )

  associated_attribute_field = empty_attribute_value.attribute_field if empty_attribute_value.present?
%>

<% if empty_attribute_value.present? %>
  <div class="content-question card">
    <div class="card-content light-blue darken-1 white-text">
      <i class="material-icons <%= content.class.color %>-text circle right circle white"><%= content.class.icon %></i>
      <strong>
        <%=
          t(
            "serendipitous_questions.attributes.#{content.class.name.downcase}.#{associated_attribute_field.label.downcase}",
            name:    content.name_field_value,
            default: "What is #{content.name_field_value}'s #{associated_attribute_field.label.downcase}?"
          )
        %>
      </strong>
    </div>
    <div class="card-tabs">
      <ul class="tabs tabs-fixed-width">
        <li class="tab"><a class="active" href="#tristan-answer">Quick Answer</a></li>
        <li class="tab"><a href="#tristan-reference">Quick Reference</a></li>
      </ul>
    </div>
    <div class="card-content lighten-4">
      <div id="tristan-answer">
        <%= form_for content do |f| %>
          <%= hidden_field(:override, :redirect_path, value: redirect_path) if defined?(redirect_path) %>

          <%=
            render 'content/form/text_input',
              f: f,
              content: content,
              field: associated_attribute_field
          %>

          <%= button_tag(type: 'submit', class: "content-question-submit waves-effect waves-light btn #{content.class.color} right") do %>
            Update <%= content.name_field_value.downcase %>
          <% end %>
          <div style="clear: both;"></div>
        <% end %>
      </div>
      <div id="tristan-reference">
        <div class="row">
          <div class="col hide-on-small-only m3 underlap">
            <%= image_tag 'tristan/small',
              class: 'tooltipped tristan',
              data: {
                position: 'right',
                enterDelay: '500',
                tooltip: "Hey, I'm Tristan! I'm happy to look up relevant information like this for you."
              } %>
          </div>
          <div class="col s12 m9">
            <%= render partial: 'content/display/quick_reference', locals: { content: content } %>
          </div>
        </div>
      </div>
    </div>
  </div>
<% elsif defined?(show_empty_prompt) && show_empty_prompt %>
  <div class="row">
    <div class="col s12 m9">
      <h5>Hey! It looks like I don't have any more prompts for you right now. I'll get to work coming up with some!</h5>
      <p>In the meantime, I'll get a big boost of prompts if you create more pages I can think about! You can also check back later and I might have more prompts for your current pages.</p>
{'fraction_non_alphanumeric': 0.13412860052371253, 'fraction_numerical': 0.004073319755600814, 'mean_word_length': 2.516624040920716, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, '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': '4623765', 'n_tokens_mistral': 2135, 'n_tokens_neox': 2028, 'n_words': 501}