<%= provide(:title, "ICLA Signatures") %>

<div class="page contribute"  data-equalizer>
  <div class="main" data-equalizer-watch>
    <%= render 'contributors_list_heading' %>

    <div class="tabs-content">
      <div class="content active">
        <table>
          <thead>
            <tr>
              <th>Contributor</th>
              <th>Date</th>
              <th>GitHub</th>
              <th>Jira</th>
            </tr>
          </thead>
          <tbody>
            <% @icla_signatures.each do |icla_signature| %>
              <tr class="contributor">
                <td><%= link_to "#{icla_signature.user.first_name} #{icla_signature.user.last_name}", icla_signature.user %></td>
                <td><%= icla_signature.signed_at.to_date.to_s(:long) %></td>
                <td>
                  <% icla_signature.user.accounts.for('github').each do |account| %>
                    <%= link_to account.username, "https://www.github.com/#{account.username}", target: :blank %>
                  <% end %>
                </td>
                <td><%= icla_signature.user.jira_username %></td>
              </tr>
            <% end %>
          </tbody>
        </table>
      </div>
    </div>
  </div>

  <%= render "contributors/sidebar" %>
</div>

<%= provide(:title, "ICLA Signatures") %>

<div class="page contribute"  data-equalizer>
  <div class="main" data-equalizer-watch>
    <%= render 'contributors_list_heading' %>

    <div class="tabs-content">
      <div class="content active">
        <table>
          <thead>
            <tr>
              <th>Contributor</th>
              <th>Date</th>
              <th>GitHub</th>
              <th>Jira</th>
            </tr>
          </thead>
          <tbody>
            <% @icla_signatures.each do |icla_signature| %>
              <tr class="contributor">
                <td><%= link_to "#{icla_signature.first_name} #{icla_signature.last_name}", icla_signature.user %></td>
                <td><%= icla_signature.signed_at.to_date.to_s(:long) %></td>
                <td>
                  <% icla_signature.user.accounts.for('github').each do |account| %>
                    <%= link_to account.username, "https://www.github.com/#{account.username}", target: :blank %>
                  <% end %>
                </td>
                <td><%= icla_signature.user.jira_username %></td>
              </tr>
            <% end %>
          </tbody>
        </table>
      </div>
    </div>
  </div>

  <%= render "contributors/sidebar" %>
</div>

Use the ICLA Signature record for names in table.
Use the ICLA Signature record for names in table.

A user may or may not have a first and last name in their user record. The ICLA
Signature record for that user should _always_ have a first and last name (as
it is required). This updates the ICLA signers table to use the first and last
name from the signature record instead of the user record.
