<commit_before><%#
# Variables:
# - @proposal: Proposal record
# - @comment: Comment record, may be a new_record or one with error
# - @focus_comment: Focus on comment? E.g., because it has an error
# - @display_comment_form: Display the comment?
%>
<% page_title h(@proposal.title) %>
<% focus :comment_message if @focus_comment %>

<%= render :partial => "/proposals/admin_controls" %>

<% cache_if(!logged_in?, "proposals_#{@proposal.id}") do %>
  <% unless multiple_presenters? %>
    <div class="standard-form">
      <table>
        <tr>
          <td colspan="2">
            <h4>Speaker</h4>
          </td>
        </tr>
        <tr>
          <td class="label-cell"><label>Speaker</label ></td>
            <td class="data-cell"><p>
              <% if user_profiles? %>
                <%= link_to(h(@proposal.user.fullname), user_path(@proposal.user)) %>
              <% else %>
                <%=h @proposal.presenter %>
              <% end %>
            </p></td>
        </tr>
        <% unless @profile.affiliation.blank? %>
          <tr>
            <td class="label-cell"><label>Affiliation</label ></td>
            <td class="data-cell"><p><%=h @profile.affiliation %></p></td>
          </tr>
        <% end %>
        <% if can_edit? %>
          <tr>
            <td class="label-cell"><label>Email (private)</label ></td>
            <% email = @profile.email %>
            <td class="data-cell"><p><%=link_to h(email), "mailto:"+h(email) %></p></td>
          </tr>
        <% end %>
        <% unless @profile.website.blank? %>
          <tr>
            <td class="label-cell"><label>URL</label ></td>
            <td class="data-cell"><p><%= display_link_to @profile.website %></p></td>
          </tr>
        <% end %>
        <tr>
          <td class="label-cell"><label>Biography</label ></td>
          <td class="data-cell"><%= preserve_formatting_of @profile.biography %></td>
        </tr>
      </table>
    </div>
  <% end %>

  <div class='show-proposal'>


  <div class='proposal-meta'>
  <% if event_tracks? %>
      <div class='track block <%= track_css_class(@proposal.track) unless @proposal.track.ergo.title.blank? %>'>
        <%= link_to(h(@proposal.track.ergo.title), event_track_path(@proposal.event, @proposal.track)) || "- N/A -" %>
      </div>
  <% end %>  
  <% if event_session_types? && ! @proposal.session_type.ergo.title.blank? %>
      <%= link_to(h(@proposal.session_type.ergo.title), event_session_type_path(@proposal.event, @proposal.session_type), :class=>'session_type') || "- N/A -" %>
  <% end %>
    <div class='proposal-slug'>
      <%= @proposal.slug %>
    </div>
    <% if proposal_statuses? && @event.proposal_status_published? && @proposal.confirmed? %>
      <div class='proposal-status <%= @proposal.status %>'>
        Accepted
      </div>
    <% end %>
  </div>


  <% if proposal_excerpts? %>
    <h3>Excerpt</h3>
    <%= preserve_formatting_of @proposal.excerpt %>
  <% end %>
  
    <h3>Description</h3>
    <%= display_textile_for @proposal.description %>

  <% unless @proposal.tags.empty? %>
    <h3>Tags</h3>
    <p><%= @proposal.tag_list %></p>
  <% end %>

  <% if event_rooms? && @proposal.room %>
    <h3>Room</h3>
    <p><%= link_to h(@proposal.room.name), @proposal.room %>
  <% end %>

  <% if can_edit? && ! @proposal.note_to_organizers.blank?%>
    <h3>Private Note to Organizers</h3>
    <%= preserve_formatting_of @proposal.note_to_organizers %>
  <% end %>

  <% if multiple_presenters? %>
    <h3><%= @proposal.users.count == 1 ? "Speaker" : "Speakers" %></h3>

    <ul class='speakers'>
    <% @proposal.users.each do |user| %>
      <li class='vcard'>
        <%= link_to "<span class='n fn'>#{user.fullname}</span>", user_path(user) %>
        <%= "- <span class='org'>#{user.affiliation}</span>" unless user.affiliation.blank?%>
        <% unless user.website.blank? %>
          (<%= display_link_to(user.website, :class => 'url') %>)
        <% end %>        
        <div class='note'>
          <%= display_textile_for user.biography %>
        </div>
      </li>
    <% end %>
    </ul>
    
  <% end %>

  <div class="record-controls">
    <% if can_edit? %>
      <%= link_to 'Edit', edit_proposal_path(@proposal), :class => "editable" %>
      <%= link_to 'Destroy', @proposal, :confirm => 'Are you sure?', :method => :delete, :class => "deletable" %>
    <% end %>
      <%= link_to 'Back', event_proposals_path(@event), :class => "cancelable" %>
  </div>

<% end %>

<% if admin? %>
  <h3>Comments</h3>
  <%= render :partial => 'comments/list', :locals => { :comments => @proposal.comments }%>
<% end %>

<% if @display_comment_form %>
  <% form_for(@comment, :url => proposal_comments_path(@proposal), :html => {:class => "standard-form"}) do |f| %>
    <%= f.hidden_field :proposal_id %>
    <h4>Leave a private comment to organizers about this proposal</h4>
    <table class="standard-form">
      <% unless error_messages_for(:comment).blank? %>
        <tr>
          <td class="label-cell">&nbsp;</td>
          <td class="data-cell">
            <%= error_messages_for :comment %>
          </td>
        </tr>
      <% end %>
      <tr>
        <td class="label-cell">
          <%= f.label :email, "Email address" %>
        </td>
        <td class="data-cell">
          <%= f.text_field :email %>
        </td><commit_msg>Improved proposals#show, added a "#comment-form' id.<commit_after><%#
# Variables:
# - @proposal: Proposal record
# - @comment: Comment record, may be a new_record or one with error
# - @focus_comment: Focus on comment? E.g., because it has an error
# - @display_comment_form: Display the comment?
%>
<% page_title h(@proposal.title) %>
<% focus :comment_message if @focus_comment %>

<%= render :partial => "/proposals/admin_controls" %>

<% cache_if(!logged_in?, "proposals_#{@proposal.id}") do %>
  <% unless multiple_presenters? %>
    <div class="standard-form">
      <table>
        <tr>
          <td colspan="2">
            <h4>Speaker</h4>
          </td>
        </tr>
        <tr>
          <td class="label-cell"><label>Speaker</label ></td>
            <td class="data-cell"><p>
              <% if user_profiles? %>
                <%= link_to(h(@proposal.user.fullname), user_path(@proposal.user)) %>
              <% else %>
                <%=h @proposal.presenter %>
              <% end %>
            </p></td>
        </tr>
        <% unless @profile.affiliation.blank? %>
          <tr>
            <td class="label-cell"><label>Affiliation</label ></td>
            <td class="data-cell"><p><%=h @profile.affiliation %></p></td>
          </tr>
        <% end %>
        <% if can_edit? %>
          <tr>
            <td class="label-cell"><label>Email (private)</label ></td>
            <% email = @profile.email %>
            <td class="data-cell"><p><%=link_to h(email), "mailto:"+h(email) %></p></td>
          </tr>
        <% end %>
        <% unless @profile.website.blank? %>
          <tr>
            <td class="label-cell"><label>URL</label ></td>
            <td class="data-cell"><p><%= display_link_to @profile.website %></p></td>
          </tr>
        <% end %>
        <tr>
          <td class="label-cell"><label>Biography</label ></td>
          <td class="data-cell"><%= preserve_formatting_of @profile.biography %></td>
        </tr>
      </table>
    </div>
  <% end %>

  <div class='show-proposal'>


  <div class='proposal-meta'>
  <% if event_tracks? %>
      <div class='track block <%= track_css_class(@proposal.track) unless @proposal.track.ergo.title.blank? %>'>
        <%= link_to(h(@proposal.track.ergo.title), event_track_path(@proposal.event, @proposal.track)) || "- N/A -" %>
      </div>
  <% end %>  
  <% if event_session_types? && ! @proposal.session_type.ergo.title.blank? %>
      <%= link_to(h(@proposal.session_type.ergo.title), event_session_type_path(@proposal.event, @proposal.session_type), :class=>'session_type') || "- N/A -" %>
  <% end %>
    <div class='proposal-slug'>
      <%= @proposal.slug %>
    </div>
    <% if proposal_statuses? && @event.proposal_status_published? && @proposal.confirmed? %>
      <div class='proposal-status <%= @proposal.status %>'>
        Accepted
      </div>
    <% end %>
  </div>


  <% if proposal_excerpts? %>
    <h3>Excerpt</h3>
    <%= preserve_formatting_of @proposal.excerpt %>
  <% end %>
  
    <h3>Description</h3>
    <%= display_textile_for @proposal.description %>

  <% unless @proposal.tags.empty? %>
    <h3>Tags</h3>
    <p><%= @proposal.tag_list %></p>
  <% end %>

  <% if event_rooms? && @proposal.room %>
    <h3>Room</h3>
    <p><%= link_to h(@proposal.room.name), @proposal.room %>
  <% end %>

  <% if can_edit? && ! @proposal.note_to_organizers.blank?%>
    <h3>Private Note to Organizers</h3>
    <%= preserve_formatting_of @proposal.note_to_organizers %>
  <% end %>

  <% if multiple_presenters? %>
    <h3><%= @proposal.users.count == 1 ? "Speaker" : "Speakers" %></h3>

    <ul class='speakers'>
    <% @proposal.users.each do |user| %>
      <li class='vcard'>
        <%= link_to "<span class='n fn'>#{user.fullname}</span>", user_path(user) %>
        <%= "- <span class='org'>#{user.affiliation}</span>" unless user.affiliation.blank?%>
        <% unless user.website.blank? %>
          (<%= display_link_to(user.website, :class => 'url') %>)
        <% end %>        
        <div class='note'>
          <%= display_textile_for user.biography %>
        </div>
      </li>
    <% end %>
    </ul>
    
  <% end %>

  <div class="record-controls">
    <% if can_edit? %>
      <%= link_to 'Edit', edit_proposal_path(@proposal), :class => "editable" %>
      <%= link_to 'Destroy', @proposal, :confirm => 'Are you sure?', :method => :delete, :class => "deletable" %>
    <% end %>
      <%= link_to 'Back', event_proposals_path(@event), :class => "cancelable" %>
  </div>

<% end %>

<% if admin? %>
  <h3>Comments</h3>
  <%= render :partial => 'comments/list', :locals => { :comments => @proposal.comments }%>
<% end %>

<% if @display_comment_form %>
  <% form_for(@comment, :url => proposal_comments_path(@proposal), :html => {:id => "comment-form", :class => "standard-form"}) do |f| %>
    <%= f.hidden_field :proposal_id %>
    <h4>Leave a private comment to organizers about this proposal</h4>
    <table class="standard-form">
      <% unless error_messages_for(:comment).blank? %>
        <tr>
          <td class="label-cell">&nbsp;</td>
          <td class="data-cell">
            <%= error_messages_for :comment %>
          </td>
        </tr>
      <% end %>
      <tr>
        <td class="label-cell">
          <%= f.label :email, "Email address" %>
        </td>
        <td class="data-cell">
          <%= f.text_field :email %>
        </td>
{'fraction_non_alphanumeric': 0.2030843552582683, 'fraction_numerical': 0.0037160906726124115, 'mean_word_length': 2.5019518542615486, 'pattern_counts': {'":': 0, '<': 373, '<?xml version=': 0, '>': 402, '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': '4605034', 'n_tokens_mistral': 3960, 'n_tokens_neox': 3630, 'n_words': 656}