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

<style type="text/css">
  dt, dd {
    font-size: 16px;
  }
</style>

<h1><strong><%= @event.name %></strong></h1>
<div>
  <h2>Event Details</h2>
  <dl class="dl-horizontal">
    <dt>Location:</dt>
    <dd class=" text-info"><%= @event.location %></dd>
    <dt>Dates:</dt>
    <dd class=" text-info"><%= @event.start.to_formatted_s(:long) %> to <%= @event.end.to_formatted_s(:long) %></dd>
    <% if @event.event_number? %>
        <dt>Event Number:</dt>
        <dd class=" text-info"><%= @event.event_number %></dd>
    <% end %>
  </dl>
</div>


<div>
  <h2>Online Registration</h2>
  <% if @event.closed? %>
      <div class="alert-danger lead">Online Registration is closed!</div>
  <% else %>
      <% unless @event.rsvp_close.nil? %>
          <div class="lead text-warning">Online Registation closes: <%= @event.rsvp_close.to_formatted_s(:long) %></div>
      <% end %>
  <% end %>
</div>

<div class="detailsBlock" style="border: solid thin black;">
  <h3>Registration Details</h3>

  <div class="well">
    <div class="bg-warning text-primary" style="margin-top: 0;white-space: pre-wrap"><%= @event.info %></div>
  </div>
  <div class="well">
    <% if @event.charity? %>
        <div class="row">
          <div class="col-md-4 text-info">
            <strong>This is a charity event.</strong>
          </div>
        </div>
    <% end %>
    <% if !@event.price.nil? && @event.price > 0 %>
        <div class="row">
          <div class="col-md-2">
            <strong>Cost:</strong>
          </div>
          <div class="col-md-2">
            <%= number_to_currency(@event.price) %>
          </div>
        </div>
    <% end %>

    <div class="row">
      <div class="col-md-2">
        <b>Registered? </b>
      </div>
      <div class="col-md-2">
        <% if @registration %>
            Yes
        <% else %>
            No
        <% end %>
      </div>
    </div>
    <% if !@event.external_url.blank? %>
        <div class="row">
          <div class="col-md-12">
            <div class="bg-warning text-danger">
              Registering for this event here does NOT register you for the
              convention. To do that, you will need to register at the URL below. You will not be able to play or GM
              without a paid registration to the convention itself!
            </div>
            <div class="bg-warning text-info">However, registration for individual tables is handled here.</div>
          </div>
        </div>
        <div class="row">
          <div class="col-md-2">
            <strong>Register for convention at:</strong>
          </div>

          <div class="col-md-4">
            <a target="_blank" href="<%= @event.external_url %>"><%= @event.external_url %></a>
          </div>
        </div>
    <% end %>

    <% if @registration && @registration.event.price&.nonzero? %>
        <div class="row">
          <div class="col-md-2"><b>Paid?</b></div>
          <% if @registration.payment_ok? %>
              <div class="col-md-6">
                Yes (<%= number_to_currency (@registration.payment_amount / 100) %><% if @registration.payment_date %>
                    on <%= @registration.payment_date.to_formatted_s(:long) %>
                <% end %>)
              </div>
          <% else %>
              <div class="col-md-2">
                <% # This has to be dynamic for future events. %>
                No:
              </div>
              <div class="col-md-6">
                <%= render partial: "registration_payment/registration_payment", locals: {event: @event, user_event: @registration} %>
              </div>
          <% end %>
        </div>
    <% end %>

  </div>
</div>

<div class="sessionsOffered" style="border: solid thin black;">
  <h3>Sessions/Scenarios Offered</h3>

  <% if @event.closed? %>
      <div class="well">
        <div class="bg-warning text-danger lead" style="margin-bottom: 0">
          <strong>Online registration is closed</strong>
        </div>
        <div class="bg-warning text-primary" style="margin-top: 0">In order to make any changes to your
          registrations
          and signups, you will need to see HQ at the event.
        </div>
      </div>
  <% else %>
      <div class="well">
        <div class="bg-warning text-danger lead" style="margin-bottom: 0"><strong>Attention GMs!</strong></div>
        <div class="bg-warning text-primary" style="margin-top: 0">If you are planning on GMing in a slot,
          please do not sign up to play in that slot. <br>The hosts of <%= @event.name %> will assign you to your GM
          slot once you have registered and paid for <%= @event.name %>.
        </div>
      </div>
  <% end %>

  <% sessionList = @event.sessions.sort {|a, b| a.start <=> b.start} %>
  <!-- header -->
  <div class="row list-group-item no-pad">
    <div class="col-md-4 no-pad">
      <div class="row no-pad">
        <div class="col-md-6 header">Session:</div>
        <div class="col-md-6 header">Start/End Time:</div>
      </div>
    </div>
    <div class="col-md-8 no-pad">
      <div class="row no-pad">
        <div class="col-md-5 header no-pad">Scenarios Offered:</div>
        <div class="col-md-1 header no-pad">Details</div>
        <div class="col-md-2 header no-pad">Seats Remaining</div>
        <div class="col-md-2 header no-pad" style="padding-left: 1em;">RSVP</div>
        <div class="col-md-2 header no-pad text-right" style="padding-right: 2px;">GMs Needed</div>
      </div>
    </div>
  </div>

  <% sessionList.each do |session| %>
      <div class="row no-pad striped-outer">
        <div class="col-md-4 no-pad">
          <div class="row no-pad">
            <div class="col-md-6 no-pad">
              <%= link_to "#{session.name}", [@event, session] %>
            </div>
            <div class="col-md-6 no-pad">
              <%= session.start.strftime("%a %H:%M") %> - <%= session.end.strftime("%a %H:%M") %>
            </div>
          </div>
        </div>
        <div class="col-md-8 no-pad">
          <!-- scenarios here -->
          <% session.tables.sort {|a, b| a <=> b}.each do |table| %>
              <div class="row no-pad striped-inner">
                <div class="col-md-5 no-pad ">
                  <%# TODO make this a reusable partial %>
                  <% scenario = table.scenario %>
                  <%= scenario.long_name %>
                  <span class="badge"><%= table.scenario.tier %></span>
                  <% if table.scenario.pregen_only? %>
                      <span class="badge badge-pregen">Pregen</span>
                  <% end %>
                  <% if table.scenario.evergreen? %>
                      <span class="badge badge-evergreen">Evergreen</span>
                  <% end %>
                  <% if table.scenario.hard_mode? %>
                      <span class="badge badge-hardmode"><small>Hard Mode</small></span>
                  <% end %>
                  <% if table.scenario.retired? %>
                      <span class="badge badge-retired">Retired</span><commit_msg>Add GM to premium table display in events.<commit_after><p id="notice"><%= notice %></p>

<style type="text/css">
  dt, dd {
    font-size: 16px;
  }
</style>

<h1><strong><%= @event.name %></strong></h1>
<div>
  <h2>Event Details</h2>
  <dl class="dl-horizontal">
    <dt>Location:</dt>
    <dd class=" text-info"><%= @event.location %></dd>
    <dt>Dates:</dt>
    <dd class=" text-info"><%= @event.start.to_formatted_s(:long) %> to <%= @event.end.to_formatted_s(:long) %></dd>
    <% if @event.event_number? %>
        <dt>Event Number:</dt>
        <dd class=" text-info"><%= @event.event_number %></dd>
    <% end %>
  </dl>
</div>


<div>
  <h2>Online Registration</h2>
  <% if @event.closed? %>
      <div class="alert-danger lead">Online Registration is closed!</div>
  <% else %>
      <% unless @event.rsvp_close.nil? %>
          <div class="lead text-warning">Online Registation closes: <%= @event.rsvp_close.to_formatted_s(:long) %></div>
      <% end %>
  <% end %>
</div>

<div class="detailsBlock" style="border: solid thin black;">
  <h3>Registration Details</h3>

  <div class="well">
    <div class="bg-warning text-primary" style="margin-top: 0;white-space: pre-wrap"><%= @event.info %></div>
  </div>
  <div class="well">
    <% if @event.charity? %>
        <div class="row">
          <div class="col-md-4 text-info">
            <strong>This is a charity event.</strong>
          </div>
        </div>
    <% end %>
    <% if !@event.price.nil? && @event.price > 0 %>
        <div class="row">
          <div class="col-md-2">
            <strong>Cost:</strong>
          </div>
          <div class="col-md-2">
            <%= number_to_currency(@event.price) %>
          </div>
        </div>
    <% end %>

    <div class="row">
      <div class="col-md-2">
        <b>Registered? </b>
      </div>
      <div class="col-md-2">
        <% if @registration %>
            Yes
        <% else %>
            No
        <% end %>
      </div>
    </div>
    <% if !@event.external_url.blank? %>
        <div class="row">
          <div class="col-md-12">
            <div class="bg-warning text-danger">
              Registering for this event here does NOT register you for the
              convention. To do that, you will need to register at the URL below. You will not be able to play or GM
              without a paid registration to the convention itself!
            </div>
            <div class="bg-warning text-info">However, registration for individual tables is handled here.</div>
          </div>
        </div>
        <div class="row">
          <div class="col-md-2">
            <strong>Register for convention at:</strong>
          </div>

          <div class="col-md-4">
            <a target="_blank" href="<%= @event.external_url %>"><%= @event.external_url %></a>
          </div>
        </div>
    <% end %>

    <% if @registration && @registration.event.price&.nonzero? %>
        <div class="row">
          <div class="col-md-2"><b>Paid?</b></div>
          <% if @registration.payment_ok? %>
              <div class="col-md-6">
                Yes (<%= number_to_currency (@registration.payment_amount / 100) %>
                <% if @registration.payment_date %>
                    on <%= @registration.payment_date.to_formatted_s(:long) %>
                <% end %>)
              </div>
          <% else %>
              <div class="col-md-2">
                <% # This has to be dynamic for future events. %>
                No:
              </div>
              <div class="col-md-6">
                <%= render partial: "registration_payment/registration_payment", locals: {event: @event, user_event: @registration} %>
              </div>
          <% end %>
        </div>
    <% end %>

  </div>
</div>

<div class="sessionsOffered" style="border: solid thin black;">
  <h3>Sessions/Scenarios Offered</h3>

  <% if @event.closed? %>
      <div class="well">
        <div class="bg-warning text-danger lead" style="margin-bottom: 0">
          <strong>Online registration is closed</strong>
        </div>
        <div class="bg-warning text-primary" style="margin-top: 0">In order to make any changes to your
          registrations
          and signups, you will need to see HQ at the event.
        </div>
      </div>
  <% else %>
      <div class="well">
        <div class="bg-warning text-danger lead" style="margin-bottom: 0"><strong>Attention GMs!</strong></div>
        <div class="bg-warning text-primary" style="margin-top: 0">If you are planning on GMing in a slot,
          please do not sign up to play in that slot. <br>The hosts of <%= @event.name %> will assign you to your GM
          slot once you have registered and paid for <%= @event.name %>.
        </div>
      </div>
  <% end %>

  <% sessionList = @event.sessions.sort {|a, b| a.start <=> b.start} %>
  <!-- header -->
  <div class="row list-group-item no-pad">
    <div class="col-md-4 no-pad">
      <div class="row no-pad">
        <div class="col-md-6 header">Session:</div>
        <div class="col-md-6 header">Start/End Time:</div>
      </div>
    </div>
    <div class="col-md-8 no-pad">
      <div class="row no-pad">
        <div class="col-md-5 header no-pad">Scenarios Offered:</div>
        <div class="col-md-1 header no-pad">Details</div>
        <div class="col-md-2 header no-pad">Seats Remaining</div>
        <div class="col-md-2 header no-pad" style="padding-left: 1em;">RSVP</div>
        <div class="col-md-2 header no-pad text-right" style="padding-right: 2px;">GMs Needed</div>
      </div>
    </div>
  </div>

  <% sessionList.each do |session| %>
      <div class="row no-pad striped-outer">
        <div class="col-md-4 no-pad">
          <div class="row no-pad">
            <div class="col-md-6 no-pad">
              <%= link_to "#{session.name}", [@event, session] %>
            </div>
            <div class="col-md-6 no-pad">
              <%= session.start.strftime("%a %H:%M") %> - <%= session.end.strftime("%a %H:%M") %>
            </div>
          </div>
        </div>
        <div class="col-md-8 no-pad">
          <!-- scenarios here -->
          <% session.tables.sort {|a, b| a <=> b}.each do |table| %>
              <div class="row no-pad striped-inner">
                <div class="col-md-5 no-pad ">
                  <%# TODO make this a reusable partial %>
                  <% scenario = table.scenario %>
                  <%= scenario.long_name %>
                  <% if table.premium? && !table.game_masters[0].nil? %>
                  with <%= table.game_masters[0].user_event.user.formal_name %>
                  <% end %>
                  <span class="badge"><%= table.scenario.tier %></span>
                  <% if table.scenario.pregen_only? %>
                      <span class="badge badge-pregen">Pregen</span>
                  <% end %>
                  <% if table.scenario.evergreen? %>
                      <span class="badge badge-evergreen">Evergreen</span>
                  <% end %>
                  <% if table.scenario.hard_mode? %>
                      <span class="badge badge-hardmode"><small>Hard Mode</small></span>
                  <% end %>
                  <% if table.scenario.retired? %>
                      <span class="badge badge-retired">Retired</span>
{'fraction_non_alphanumeric': 0.1772837790899618, 'fraction_numerical': 0.007085793678360542, 'mean_word_length': 1.9165316045380876, 'pattern_counts': {'":': 0, '<': 462, '<?xml version=': 0, '>': 464, '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': '901463', 'n_tokens_mistral': 4852, 'n_tokens_neox': 4438, 'n_words': 1062}