<commit_before><p id="notice"><%= notice %></p>

<h1>All Events</h1>
<div class="well">
  <div class="bg-warning">
    <div class="lead text-danger"><b>Important Note:</b></div>
    <div>Registering for the application will not register you for any events. This application can and will support
      many events, so you will need to register for the specific event (convention/game day/etc) that you wish to
      attend.
      <br/><br/>
      This is done by clicking the <span class="btn btn-warning">Register</span> button next to the event on the events
      listing.
    </div>
  </div>
</div>
<ul class="list-group">
  <li class="row list-group-item">
    <div class="col-md-2 list"><b>Name</b></div>
    <div class="col-md-4"><b>Dates</b></div>
    <div class="col-md-2"><b>Location</b></div>
    <div class="col-md-1">
      <% unless @my_events.nil? %><b>Attending</b>
      <% end %></div>
    <div class="col-md-2">&nbsp;</div>
  </li>
  <% @events.each do |event| %>
      <li class="row list-group-item">
        <div class="col-md-2"><%= link_to "#{event.name}", event, :class => 'btn btn-sm btn-info' %></div>
        <div class="col-md-4">
          <small><%= event.start.to_formatted_s(:long) %> - <%= event.end.to_formatted_s(:long) %></small>
        </div>
        <div class="col-md-2"><%= event.location %></div>
        <div class="col-md-1">
          <% if @my_events.include? event %>
              <%= link_to "Attending", event, :class => 'btn btn-sm btn-primary' %>
          <% else %>
              <% unless event.closed? %>
                  <%= link_to "Register", new_event_user_event_path(event), :class => 'btn  btn-sm  btn-warning' %>
              <% end %>
          <% end %>
        </div>
        <% if current_user.admin? %>
            <div class="col-md-2">
              <%= link_to 'Edit', edit_event_path(event), :class => 'btn btn-sm  btn-primary' %>
              <%= link_to 'Destroy', event, method: :delete, data: {confirm: 'Are you sure?'}, :class => 'btn btn-sm btn-danger' %>
            </div>
        <% end %>
      </li>
  <% end %>
</ul>
<hr>

<h2>Events that you are registered for:</h2>
<div class="text-info bg-info" style="padding: 5px">To see the sessions you are attending in an event, please click on
  the name of the event below.
</div>
<div class="panel-group" id="accordian">
  <% current_user.user_events.each do |registration| %>
      <div class="panel panel-default">
        <div class="panel-heading">
          <div class="row">
            <div class="col-sm-4">
              <a data-toggle="collapse" data-parent="#accordian" href="#collapse<%= registration.event_id %>"><%= registration.event.name %> <%= registration.event.start.to_formatted_s(:short) %>
                to <%= registration.event.end.to_formatted_s(:short) %></a>
            </div>
            <div class="col-sm-2">
              <%= button_to "Manage RSVP", registration.event, method: :get, :class => 'btn btn-primary' %>
            </div>
          </div>

        </div>
        <% # Add in their tables %>
        <div id="collapse<%= registration.event_id %>" class="panel-collapse collapse">
          <% if registration.registration_tables.nil? or registration.registration_tables.empty? %>
              <div class="bg-warning">You are not yet registered for any tables.</div>
          <% else %>
              <ul class="list-group">
                <li class="list-group-item list-group-item-heading">Player Tables</li>
                <% sorted = registration.registration_tables.sort { |a, b| a.start <=> b.start } %>
                <% sorted.each do |reg_table| %>
                    <li class="row list-group-item"><%= reg_table.table.session.name %>
                      : <%= link_to "#{reg_table.table.scenario.long_name}", reg_table.table.scenario %></li>
                <% end %>
              </ul>
          <% end %>
          <% if registration.gamemaster? %>
              <ul class="list-group">
                <li class="list-group-item list-group-item-heading">Game Master Tables</li>

                <% registration.game_masters.sort.each do |gm| %>
                    <li class="row list-group-item"><%= gm.table.session.name %>
                      : <%= link_to "#{gm.table.scenario.long_name}", gm.table.scenario %></li>
                <% end %>
              </ul>
        <% end %>
        </div>
      </div>
  <% end %>
</div>

<hr>

<% if current_user.admin? %>
    <%= link_to 'New Event', new_event_path, :class => 'btn btn-warning' %>
    <br>
<% end %>
<commit_msg>Correct to use `@my_events` for now<commit_after><p id="notice"><%= notice %></p>

<h1>All Events</h1>
<div class="well">
  <div class="bg-warning">
    <div class="lead text-danger"><b>Important Note:</b></div>
    <div>Registering for the application will not register you for any events. This application can and will support
      many events, so you will need to register for the specific event (convention/game day/etc) that you wish to
      attend.
      <br/><br/>
      This is done by clicking the <span class="btn btn-warning">Register</span> button next to the event on the events
      listing.
    </div>
  </div>
</div>
<ul class="list-group">
  <li class="row list-group-item">
    <div class="col-md-2 list"><b>Name</b></div>
    <div class="col-md-4"><b>Dates</b></div>
    <div class="col-md-2"><b>Location</b></div>
    <div class="col-md-1">
      <% unless @my_events.nil? %><b>Attending</b>
      <% end %></div>
    <div class="col-md-2">&nbsp;</div>
  </li>
  <% @events.each do |event| %>
      <li class="row list-group-item">
        <div class="col-md-2"><%= link_to "#{event.name}", event, :class => 'btn btn-sm btn-info' %></div>
        <div class="col-md-4">
          <small><%= event.start.to_formatted_s(:long) %> - <%= event.end.to_formatted_s(:long) %></small>
        </div>
        <div class="col-md-2"><%= event.location %></div>
        <div class="col-md-1">
          <% if @my_events.include? event %>
              <%= link_to "Attending", event, :class => 'btn btn-sm btn-primary' %>
          <% else %>
              <% unless event.closed? %>
                  <%= link_to "Register", new_event_user_event_path(event), :class => 'btn  btn-sm  btn-warning' %>
              <% end %>
          <% end %>
        </div>
        <% if current_user.admin? %>
            <div class="col-md-2">
              <%= link_to 'Edit', edit_event_path(event), :class => 'btn btn-sm  btn-primary' %>
              <%= link_to 'Destroy', event, method: :delete, data: {confirm: 'Are you sure?'}, :class => 'btn btn-sm btn-danger' %>
            </div>
        <% end %>
      </li>
  <% end %>
</ul>
<hr>

<h2>Events that you are registered for:</h2>
<div class="text-info bg-info" style="padding: 5px">To see the sessions you are attending in an event, please click on
  the name of the event below.
</div>
<div class="panel-group" id="accordian">
  <% @my_events.each do |registration| %>
      <div class="panel panel-default">
        <div class="panel-heading">
          <div class="row">
            <div class="col-sm-4">
              <a data-toggle="collapse" data-parent="#accordian" href="#collapse<%= registration.event_id %>"><%= registration.event.name %> <%= registration.event.start.to_formatted_s(:short) %>
                to <%= registration.event.end.to_formatted_s(:short) %></a>
            </div>
            <div class="col-sm-2">
              <%= button_to "Manage RSVP", registration.event, method: :get, :class => 'btn btn-primary' %>
            </div>
          </div>

        </div>
        <% # Add in their tables %>
        <div id="collapse<%= registration.event_id %>" class="panel-collapse collapse">
          <% if registration.registration_tables.nil? or registration.registration_tables.empty? %>
              <div class="bg-warning">You are not yet registered for any tables.</div>
          <% else %>
              <ul class="list-group">
                <li class="list-group-item list-group-item-heading">Player Tables</li>
                <% sorted = registration.registration_tables.sort { |a, b| a.start <=> b.start } %>
                <% sorted.each do |reg_table| %>
                    <li class="row list-group-item"><%= reg_table.table.session.name %>
                      : <%= link_to "#{reg_table.table.scenario.long_name}", reg_table.table.scenario %></li>
                <% end %>
              </ul>
          <% end %>
          <% if registration.gamemaster? %>
              <ul class="list-group">
                <li class="list-group-item list-group-item-heading">Game Master Tables</li>

                <% registration.game_masters.sort.each do |gm| %>
                    <li class="row list-group-item"><%= gm.table.session.name %>
                      : <%= link_to "#{gm.table.scenario.long_name}", gm.table.scenario %></li>
                <% end %>
              </ul>
        <% end %>
        </div>
      </div>
  <% end %>
</div>

<hr>

<% if current_user.admin? %>
    <%= link_to 'New Event', new_event_path, :class => 'btn btn-warning' %>
    <br>
<% end %>

{'fraction_non_alphanumeric': 0.1819868995633188, 'fraction_numerical': 0.0037117903930131003, 'mean_word_length': 2.231393298059965, 'pattern_counts': {'":': 0, '<': 279, '<?xml version=': 0, '>': 293, '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': '1186188', 'n_tokens_mistral': 3073, 'n_tokens_neox': 2839, 'n_words': 675}