<commit_before><%
# Variables:
## Kind of records to list, e.g, :sessions or :proposals. REQUIRED.
kind      = local_assigns[:kind]
## ActiveRecord instance that has #proposals, e.g., a User. REQUIRED.
container = local_assigns[:container]
## Title of the container, e.g., "user". Optional, leave blank to guess based on container's class.
title     = local_assigns[:title]
## Prefix to add to the sub-list headers.
head_prefix = local_assigns[:head_prefix]
## Display the sort toolbar? Optional, defaults to false.
sorter    = local_assigns[:sorter]
## Archive the content and hide it behind a link? Optional, defaults to false.
archive      = local_assigns[:archive]

# Display all proposals if :all
inclusive = kind == :all
kind = :proposals if kind == :all
%>

<% cache "proposals,sub_list_for_kind,kind_#{kind},container_#{container.class.name}_#{container.id},title_#{title.hash},head_prefix_#{head_prefix.hash},sorter_#{sorter.hash},admin_#{admin?}" do %>
  <%
    records = \
      if inclusive
        container.proposals.all
      else
        case kind
        when :proposals then container.proposals.unconfirmed
        when :sessions then container.proposals.confirmed
        else raise TypeError, "Unknown kind: #{kind}"
        end
      end
  %>

  <% unless records.blank? %>
    <div class="proposals_sub_list" id="proposals_sub_list_for_kind_<%= kind %>">
      <div class="proposals_sub_list_toggle" style="display: none">
        <a href="#" onclick="$(this).hide(); $(this).parent().parent().find('.proposals_sub_list_content').show(); return false;">Display <%= kind %>...</a>
      </div>
      <div class="proposals_sub_list_content">
        <h3><%= "#{head_prefix} #{kind.to_s.titleize} for this #{title || container.class.name.singularize}".humanize %></h3>
        <%= render :partial => "proposals/list", :locals => {:kind => kind, :records => records, :sorter => sorter} %>
      </div>
    </div><commit_msg>Fixed proposals#_sub_list_for_kind's title, it now capitalizes the first letter even if there's no head_prefix.<commit_after><%
# Variables:
## Kind of records to list, e.g, :sessions or :proposals. REQUIRED.
kind      = local_assigns[:kind]
## ActiveRecord instance that has #proposals, e.g., a User. REQUIRED.
container = local_assigns[:container]
## Title of the container, e.g., "user". Optional, leave blank to guess based on container's class.
title     = local_assigns[:title]
## Prefix to add to the sub-list headers.
head_prefix = local_assigns[:head_prefix]
## Display the sort toolbar? Optional, defaults to false.
sorter    = local_assigns[:sorter]
## Archive the content and hide it behind a link? Optional, defaults to false.
archive      = local_assigns[:archive]

# Display all proposals if :all
inclusive = kind == :all
kind = :proposals if kind == :all
%>

<% cache "proposals,sub_list_for_kind,kind_#{kind},container_#{container.class.name}_#{container.id},title_#{title.hash},head_prefix_#{head_prefix.hash},sorter_#{sorter.hash},admin_#{admin?}" do %>
  <%
    records = \
      if inclusive
        container.proposals.all
      else
        case kind
        when :proposals then container.proposals.unconfirmed
        when :sessions then container.proposals.confirmed
        else raise TypeError, "Unknown kind: #{kind}"
        end
      end
  %>

  <% unless records.blank? %>
    <div class="proposals_sub_list" id="proposals_sub_list_for_kind_<%= kind %>">
      <div class="proposals_sub_list_toggle" style="display: none">
        <a href="#" onclick="$(this).hide(); $(this).parent().parent().find('.proposals_sub_list_content').show(); return false;">Display <%= kind %>...</a>
      </div>
      <div class="proposals_sub_list_content">
        <h3><%= "#{head_prefix} #{kind.to_s.titleize} for this #{title || container.class.name.singularize}".strip.humanize %></h3>
        <%= render :partial => "proposals/list", :locals => {:kind => kind, :records => records, :sorter => sorter} %>
      </div>
    </div>
{'fraction_non_alphanumeric': 0.14994984954864593, 'fraction_numerical': 0.0010030090270812437, 'mean_word_length': 3.961442786069652, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 49, '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': '1077316', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1259, 'n_words': 324}