<commit_before>
<% if @event.start.to_date == @event.finish.to_date %>
    <% date_str = "Em #{I18n.l @event.start.to_date}" %>
<% else %>
    <% date_str = "De #{I18n.l @event.start.to_date} a #{I18n.l @event.finish.to_date}" %>
<% end %>

<% title = "Evento <em>#{@event.name}</em>" %>
<% if @event.archived and policy(@event).archive? %>
    <% title += " <small><span class=\"label label-default\">Arquivado</span></small>"  %>
<% end %>

<%= render 'common/page_title',
           titulo: title.html_safe,
           sub_title: "#{date_str}, relacionado à atividade #{activity_link_display @event.activity}" %>

<% content_for :actions do %>
    <%= render 'btn_archive' %>
    <%= render 'btn_actions' %>
<% end %>

<br>
<div class="lead">
  <dd><%= @event.description %></dd>
</div>

<br>


<!-- Participantes -->
<% if policy(Participation).show? %>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">Participantes
          <div class="pull-right">
            <%= link_to '<i class="fa fa-envelope"></i> E-mails'.html_safe,
                        emails_event_path(@event), class: 'btn btn-xs btn-default' %>
            <% unless @event.archived %>
                <%= link_to '<i class="fa fa-users"></i> Gerar lista de presença'.html_safe,
                        attendance_event_path(@event, format: :pdf), class: 'btn btn-xs btn-default' %>
                <%= render 'common/btn_new', url: new_event_participation_path(@event.id, pstatus: Participation.statuses[:enrolled]),
                       btn_label: 'Nova participação', size: 'btn-xs', resource: @event %>
            <% end %>
          </div>
        </h3>
      </div>
      <div class="panel-body">

        <!--
            Equipe docente
        -->
        <% organizers = @event.enrolls.where(p_type: Participation::ORGANIZER_P_TYPES)  %>
        <h5>Equipe Docente <span class="badge"><%= organizers.count %></span></h5>
        <%= render 'list_participations',
                   participations: organizers,
                   msg_when_empty: 'Não existe equipe organizadora para este evento' %>
        <br/>


        <!--
            Alunos inscritos
        -->
        <% student_enrolls = @event.enrolls.where.not(p_type: Participation::ORGANIZER_P_TYPES) %>
        <h5>Alunos inscritos <span class="badge"><%= student_enrolls.count %></span></h5>
        <%= render 'list_participations',
                   participations: student_enrolls,
                   msg_when_empty: 'Não existem inscritos para este evento' %>
        <br/>


        <!--
            Pré-inscritos
        -->
        <% pre_enrolls = @event.pre_enrolls  %>
        <h5>Pré-inscritos <span class="badge"><%= pre_enrolls.count %></span></h5>
        <%= render 'list_participations',
                   participations: pre_enrolls,
                   msg_when_empty: 'Não existem pré-inscritos para este evento' %>


      </div>
    </div>

<% end %>



<!-- Pendências para fechamento dos participantes / Tabela de acompanhamento de contatos e divulgação -->
<% interested_count = @event.interested.count  %>
<% divulge_count = @event.divulge.count  %>
<% pending_count = interested_count + divulge_count %>
<% if policy(Participation).show? and !@event.archived and pending_count > 0 %>
    <div class="panel panel-danger">
      <div class="panel-heading">
        <h3 class="panel-title">Pendências <span class="badge"><%= pending_count %></span>
          <% unless @event.archived %>
              <div class="pull-right">
                <%= render 'common/btn_new', url: new_event_participation_path(@event.id, pstatus: Participation.statuses[:divulge]),
                           size: 'btn-xs', btn_label: 'Nova participação', resource: @event %>
              </div>
          <% end %>
        </h3>
      </div>
      <div class="panel-body">
        <br/>
        <%= render 'pending_participations', title: "Interessados <span class=\"badge\">#{@event.interested.count}</span>",
                   participations: @event.interested, color: 'warning' %>
        <br/>
        <%= render 'pending_participations', title: "Para divulgação <span class=\"badge\">#{@event.divulge.count}</span>",
                   participations: @event.divulge, color: 'info' %>
      </div><commit_msg>Ajuste display<commit_after>
<% if @event.start.to_date == @event.finish.to_date %>
    <% date_str = "Em #{I18n.l @event.start.to_date}" %>
<% else %>
    <% date_str = "De #{I18n.l @event.start.to_date} a #{I18n.l @event.finish.to_date}" %>
<% end %>

<% title = "Evento <em>#{@event.name}</em>" %>
<% if @event.archived and policy(@event).archive? %>
    <% title += " <small><span class=\"label label-default\">Arquivado</span></small>"  %>
<% end %>

<%= render 'common/page_title',
           titulo: title.html_safe,
           sub_title: "#{date_str}, relacionado à atividade #{activity_link_display @event.activity}" %>

<% content_for :actions do %>
    <%= render 'btn_archive' %>
    <%= render 'btn_actions' %>
<% end %>

<br>
<div class="lead">
  <dd><%= @event.description %></dd>
</div>

<br>


<!-- Participantes -->
<% if policy(Participation).show? %>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">Participantes
          <div class="pull-right">
            <%= link_to '<i class="fa fa-envelope"></i> E-mails'.html_safe,
                        emails_event_path(@event), class: 'btn btn-xs btn-default' %>
            <% unless @event.archived %>
                <%= link_to '<i class="fa fa-users"></i> Gerar lista de presença'.html_safe,
                        attendance_event_path(@event, format: :pdf), class: 'btn btn-xs btn-default' %>
                <%= render 'common/btn_new', url: new_event_participation_path(@event.id, pstatus: Participation.statuses[:enrolled]),
                       btn_label: 'Nova participação', size: 'btn-xs', resource: @event %>
            <% end %>
          </div>
        </h3>
      </div>
      <div class="panel-body">

        <!--
            Equipe docente
        -->
        <% organizers = @event.enrolls.where(p_type: Participation::ORGANIZER_P_TYPES)  %>
        <h5>Equipe Docente <span class="badge"><%= organizers.count %></span></h5>
        <%= render 'list_participations',
                   participations: organizers,
                   msg_when_empty: 'Não existe equipe organizadora para este evento' %>
        <br/>


        <!--
            Alunos inscritos
        -->
        <% student_enrolls = @event.enrolls.where.not(p_type: Participation::ORGANIZER_P_TYPES) %>
        <h5>Alunos inscritos <span class="badge"><%= student_enrolls.count %></span></h5>
        <%= render 'list_participations',
                   participations: student_enrolls,
                   msg_when_empty: 'Não existem inscritos para este evento' %>
        <br/>


        <!--
            Pré-inscritos
        -->
        <% pre_enrolls = @event.pre_enrolls  %>
        <h5>Pré-inscritos <span class="badge"><%= pre_enrolls.count %></span></h5>
        <%= render 'list_participations',
                   participations: pre_enrolls,
                   msg_when_empty: 'Não existem pré-inscritos para este evento' %>


      </div>
    </div>

<% end %>



<!-- Pendências para fechamento dos participantes / Tabela de acompanhamento de contatos e divulgação -->
<% interested_count = @event.interested.count  %>
<% divulge_count = @event.divulge.count  %>
<% pending_count = interested_count + divulge_count %>
<% if policy(Participation).show? and !@event.archived and pending_count > 0 %>
    <div class="panel panel-danger">
      <div class="panel-heading">
        <h3 class="panel-title">Pendências <span class="badge"><%= pending_count %></span>
          <% unless @event.archived %>
              <div class="pull-right">
                <%= render 'common/btn_new', url: new_event_participation_path(@event.id, pstatus: Participation.statuses[:divulge]),
                           size: 'btn-xs', btn_label: 'Nova participação', resource: @event %>
              </div>
          <% end %>
        </h3>
      </div>
      <div class="panel-body">
        <% if interested_count > 0 %>
            <br/>
            <%= render 'pending_participations', title: "Interessados <span class=\"badge\">#{@event.interested.count}</span>",
                   participations: @event.interested, color: 'warning' %>
        <% end %>
        <% if divulge_count > 0 %>
            <br/>
            <%= render 'pending_participations', title: "Para divulgação <span class=\"badge\">#{@event.divulge.count}</span>",
                   participations: @event.divulge, color: 'info' %>
        <% end %>
      </div>
{'fraction_non_alphanumeric': 0.1670084301663249, 'fraction_numerical': 0.004101161995898838, 'mean_word_length': 2.3948182521268366, 'pattern_counts': {'":': 0, '<': 213, '<?xml version=': 0, '>': 217, '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': '5083745', 'n_tokens_mistral': 2993, 'n_tokens_neox': 2756, 'n_words': 542}