{% extends "base.html" %}

{% load static %}
{% load tags %}

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

{% block css %}
  <link rel="stylesheet" href="{% static 'lib/maplibre-gl/dist/maplibre-gl.css' %}">
{% endblock css %}

{% block body-class %}class="home"{% endblock %}

{% block prenav-content %}
  <div id="map" data-mapboxid="{{ mapbox_id }}" data-mapboxtoken="{{ mapbox_token }}" data-stations="{% url 'base:stations_all' %}"></div>
{% endblock prenav-content %}

{% block content %}
  {% if request.user.is_anonymous %}
    <div class="call2action">
      <div class="card">
        <div class="card-body">
          <h2 class="text-center">
            Crowd-sourced satellite operations
            <button type="button"
                    class="btn btn-primary"
                    data-toggle="modal"
                    data-target="#joinModal">
              Join us!
            </button>
          </h2>
        </div>
      </div>
    </div>
  {% endif %}

  <!-- Join Modal -->
  <div class="modal fade" id="joinModal" tabindex="-1" role="dialog" aria-labelledby="JoinModalTitle" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h3 class="modal-title" id="JoinModalTitle">Join SatNGOS Network</h3>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <h3>SatNOGS Network</h3>
          SatNOGS Network is a global management interface to facilitate multiple ground station
          operations remotely. An observer is able to take advantage of the full network of
          SatNOGS ground stations around the world.
          <h3>Observations</h3>
          The network is open to anyone. Any observer is able to utilize all available Ground Stations
          and communicate with Satellites. All observations results are public
          and all data are distributed freely under the
          <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons Atribution-Share Alike</a> license.
          <h3>Ground Stations</h3>
          Whether you own satellite ground station equipment or you want
          to build one you can head to
          <a href="https://satnogs.org" target="_blank">SatNOGS Project site</a> or our
          <a href="https://wiki.satnogs.org" target="_blank">wiki</a>
          to get up to date documentation and info on how to build a SatNOGS ground station (still under development).
          <h3>Coding</h3>
          Fluent in Python and/or JS? We need you to help with satnogs-network web application. Take a look to our
          <a href="https://gitlab.com/librespacefoundation/satnogs/satnogs-network" target="_blank">source code</a> or visit
          our <a href="https://gitlab.com/librespacefoundation/satnogs/satnogs-network/issues" target="_blank">issues tracker</a>
          to start filling bugs, feature requests or code fixes for existing ones.
          Detailed contribution and development documentation is also availble at
          <a href="https://docs.satnogs.org/projects/satnogs-network/en/stable/" target="_blank">docs.satnogs.org</a>.
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-outline-dark" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
{% endblock content %}

{% block footer %}{% endblock %}

{% block javascript %}
  <script src="{% static 'lib/maplibre-gl/dist/maplibre-gl.js' %}"></script>
  <script src="{% static 'js/map.js' %}"></script>
{% endblock %}
