<%inherit file="master.html"/>

<script src="${request.static_url('bodhi:server/static/js/newsfeed.js')}"></script>
<div class="container p-t-2">
<div class="row">
  <div id="newsfeed" class="col-md-6">
    <img src="${request.static_url('bodhi:server/static/img/spinner.gif')}"
         alt="Loading..."
         id="loader" />
    <div id="datagrepper-widget"></div>
    <script>
        $(document).ready(function() {
          generate_newsfeed(
            "${request.registry.settings.get('datagrepper_url', 'https://apps.fedoraproject.org/datagrepper')}",
            ${str([idx.strip() for idx in request.registry.settings.get('badge_ids', '').split('|') if idx.strip()]) | n});
        });
    </script>
  </div>

  <div class="col-md-6">
          <div class="card">
            <div class="card-header">
              <span><strong>This week's top testers</strong></span>
            </div>
            <div class="list-group list-group-flush">
                % for tester, count in top_testers:
                <div class="list-group-item">
                    <strong>#${str(loop.index + 1)}</strong>
                    <a href="${request.route_url('user', name=tester['name'])}">
                      <img class="img-circle" src="${self.util.avatar(tester['name'], size=24)}"/>
                      ${tester['name']}
                    </a>
                  <div class="label label-default pull-xs-right">${str(count)}</div>
                </div>
                % endfor
            </div>
      </div>

      % if critpath_updates:
          <div class="card">
            <div class="card-header clearfix">
              <span><strong><a href="${request.route_url('updates')}?status=testing" title="View All">Latest Critical Path Updates in Need of Testing</a></strong></span>
              <span class="pull-xs-right">
                <a class="btn btn-sm btn-secondary" href="${request.route_url('updates_rss')}?status=testing" title="RSS Feed">
                  <span class="fa fa-rss"></span>
                </a>
              </span>
            </div>
            <div class="card-block p-a-0">
              ${self.tables.updates(critpath_updates)}
            </div>
          </div>
      % endif

      % if security_updates:
          <div class="card">
            <div class="card-header clearfix">
              <span><strong><a href="${request.route_url('updates')}?type=security&status=testing">Latest Security Updates in Need of Testing</a></strong></span>
              <span class="pull-xs-right">
                <a class="btn btn-sm btn-secondary" href="${request.route_url('updates_rss')}?type=security&status=testing" title="RSS Feed">
                  <span class="fa fa-rss"></span>
                </a>
              </span>
            </div>
            <div class="card-block p-a-0">
              ${self.tables.updates(security_updates)}
            </div>
          </div>
      %endif
  </div>
</div>
</div>
