<% if (meta.user !== "") { %>
  <% if (_.size(grouped) > 0) { %>
    <table class="stats">
      <thead>
      <tr>
        <th><%= gettext('Project / Language') %></th>
        <th class="number"><%= gettext('Suggested') %></th>
        <th class="number"><%= gettext('Translated') %></th>
        <th class="number"><%= gettext('Reviewed') %></th>
        <th class="number"><%= gettext('Score Change') %></th>
      </tr>
      </thead>
      <tbody>
      <% _.each(grouped, function (row) { %>
        <tr class="item">
          <td><a href="<%= row.tp_browse_url %>"><%- row.translation_project %></a></td>
          <td class="number<% if (row.suggested == 0) { %> zero<% } %>">
            <% if (row.suggested > 0) { %>
              <a href="<%= row.tp_suggestions_translate_url %>">
              <%= interpolate(ngettext('%s word', '%s words', row.suggested),
                              [row.suggested]) %>
              </a>
            <% } else { %>
              <%= interpolate(ngettext('%s word', '%s words', row.suggested),
                              [row.suggested]) %>
            <% } %>
          </td>
          <td class="number<% if (row.translated == 0) { %> zero<% } %>">
            <% if (row.translated > 0) { %>
              <a href="<%= row.tp_submissions_translate_url %>">
              <%= interpolate(ngettext('%s word', '%s words', row.translated),
                              [row.translated]) %>
              </a>
            <% } else { %>
              <%= interpolate(ngettext('%s word', '%s words', row.translated),
                              [row.translated]) %>
            <% } %>
          </td>
          <td class="number<% if (row.reviewed == 0) { %> zero<% } %>">
            <%= interpolate(ngettext('%s word', '%s words', row.reviewed),
                            [row.reviewed]) %>
          </td>
          <td class="number<% if (row.score_delta == 0) { %> zero<% } %>">
            <% if (row.score_delta > 0) { %>+<% } %><%= row.score_delta.toFixed(2) %>
          </td>
        </tr>
      <% }); %>
        <tr class="total">
          <td>&nbsp;</td>
          <td class="number<% if (groupedSuggestedTotal == 0) { %> zero<% } %>">
            <%= interpolate(ngettext('%s word', '%s words', groupedSuggestedTotal),
                            [groupedSuggestedTotal]) %>
          </td>
          <td class="number<% if (groupedTranslatedTotal == 0) { %> zero<% } %>">
            <%= interpolate(ngettext('%s word', '%s words', groupedTranslatedTotal),
                            [groupedTranslatedTotal]) %>
          </td>
          <td class="number<% if (groupedReviewedTotal == 0) { %> zero<% } %>">
            <%= interpolate(ngettext('%s word', '%s words', groupedReviewedTotal),
                            [groupedReviewedTotal]) %>
          </td>
          <td class="number<% if (groupedScoreDeltaTotal == 0) { %> zero<% } %>">
            <% if (groupedScoreDeltaTotal > 0) { %>+<% } %><%= groupedScoreDeltaTotal.toFixed(2) %>
          </td>
        </tr>
      </tbody>
    </table>
  <% } else { %>
    <p class="noresults"><%= gettext('No activity recorded in a given period') %></p>
  <% } %>
<% } else { %>
  <p class="noresults"><%= gettext('Please select a valid user.') %></p>
<% } %>
