{% extends "base.html" %}
{% load static %}

{% block title %} - Home{% endblock %}

{% block css %}
<link rel="stylesheet" href="{% static 'lib/admin-lte/plugins/flag-icon-css/css/flag-icon.min.css' %}" />
{% endblock css %}

{% block top-menu-left %}
<h5 class="mb-0 mr-3">Welcome to SatNOGS DB</h5>
{% endblock %}


{% block content %}
<div class="row px-2 pt-2 card-deck">
  <div class="col-md-6 col-xl-4">
    <h4 class="text-satnogs text-center mb-0">New Satellites</h4>

    {% for satellite in newest_sats %} 
    {% include 'includes/cards/satellite_card.html' with satellite=satellite %}
    {% endfor %}
  </div>

  <div class="col-md-6 col-xl-4">
    <h4 class="text-satnogs text-center mb-0">Latest Data</h4>

    {% for satellite in latest_data %}
    {% include 'includes/cards/satellite_card.html' with satellite=satellite %}
    {% endfor %}
  </div>

  <div class="col-xs-12 col-xl-4">
    <h4 class="text-satnogs text-center mb-0">Recent Contributors</h4>
    <div class="card shadow card-outline card-satnogs my-3">
      {% if latest_submitters.count %}
      <div class="card-header py-1">
        <div class="row">
          <div class="pl-1">
            <span class="card-title">Data - Last 24h</span><br />
          </div>
        </div>
      </div>
      <div class="card-body satellite-card-body contributor-list py-2 px-2">
        <div class="d-flex flex-row no-gutters text-nowrap align-items-center justify-content-between">
          <div class="flex-column text-wrap float-left align-self-center">
            {% for contributor in latest_submitters %}
            <div class="d-flex flex-row">
              <div class="d-flex satellite-card-body-row align-self-center justify-content-center flex-shrink-0">
                <i class="fas fa-user"></i>
              </div>
              <div class="d-inline-flex">
                {{ contributor.station }} - {{ contributor.c }} frames
              </div>
            </div>
            {% endfor %}
          </div>
        </div>
      </div>
      {% else %}
      <div class="card-body d-flex flex-row">
        <div class="d-inline-flex">
          <p class="text-wrap">
            It appears there have been no contributions in the past 24 hours.
            Please visit
            <a href="https://wiki.satnogs.org" target="_blank">wiki.satnogs.org</a>
            to learn how to contribute data!
          </p>
        </div>
      </div>
      {% endif %}
      <div class="card-footer">
        <span class="text-value-sm">Thank you to our contributors! Please visit
          <a href="https://wiki.satnogs.org" target="_blank">wiki.satnogs.org</a>
          to learn how to contribute data.</span>
      </div>
    </div>
  </div>
</div>

{% endblock %}
