<% provide(:title, @title) %>

<% if !@user.anonymous? %>
<p>Hi <%= @user.first_name %>,</p>
<% end %>

<p>The following new sessions have been posted within the last 24 hours, and you have good or acceptable latency to the organizer of each session below. If a session looks interesting, click the Details link to see the session page. You can RSVP to a session from the session page, and you'll be notified if/when the session organizer approves your RSVP.</p>

<style>
  #scheduled-sessions {
    margin-top:15px;
    width:98%;
    font-size:11px;
    color:#fff;
    background-color:#262626;
    border-color:#cccccc;
    border-width:1px 0;
    border-style:solid;
  }

  #scheduled-sessions td {
    padding:10px 2px;
  }

  #scheduled-sessions th {
    padding:2px;
  }

  #scheduled-sessions thead {
    margin-bottom: 5px;
  }


  #scheduled-sessions thead th {

    border-width:0 0 1px 0;
    border-style:solid;
    border-color:#cccccc;
  }
  #scheduled-sessions tbody td {

    border-width:1px 0 0 0;
    border-style:solid;
    border-color:#4d4d4d;
    vertical-align:top;
  }

  #scheduled-sessions span.latency img {
    margin-top:2px;
  }


</style>

<table id="scheduled-sessions" cellspacing="0" cellpadding="0" border="0">
    <!-- header -->
  <thead>
    <tr>
        <th align="left" width="15%">GENRE</th>
        <th align="left" width="20%">NAME</th>
        <th align="left" width="45%">DESCRIPTION</th>
        <th width="20%" style="text-align:center">LATENCY</th>
    </tr>
  </thead>
  <tbody>
        <!-- session row goes here -->
    <% @sessions_and_latency.each do |sess| %>
      <tr>
      <td><%= sess.genre.description %></td>
      <td>
        <%= sess.name %><br/>
        <a style="color: #ffcc00;" href="<%= "https://www.jamkazam.com/sessions/#{sess.id}/details" %>">Details</a>
      </td>
      <td><%= sess.description %></td>
      <td style="text-align:center">
        <span class="latency">
        <span class="latency-value"><%= (sess.latency / 2).round %> ms</span>
        <% if sess.latency <= (APP_CONFIG.max_good_full_score / 2) %>
          <%= image_tag("https://www.jamkazam.com/assets/content/icon_green_score.png", alt: 'good score icon') %>
        <% else %>
          <%= image_tag("https://www.jamkazam.com/assets/content/icon_yellow_score.png", alt: 'fair score icon') %>
        <% end %>
        </span>
      </td>
      </tr>
    <% end %>
  </tbody>
</table>

<p>To see ALL the scheduled sessions that you might be interested in joining, view our <a style="color: #ffcc00;" href="https://www.jamkazam.com/client#/findSession">Find Session page</a>.</p>

<p>Best Regards,</p>

Team JamKazam 
