<div class="card shadow card-outline {% if suggestion_card %}card-warning{% else %}card-satnogs{% endif %}">
  <div class="card-header align-items-center no-gutters py-1">
    <div class="row">
        <div class="col">
          <span class="card-title align-self-center">{% if suggestion_card %}Suggestion - {% endif %}{{ transmitter.description }}</span>
        </div>
        <div class="row ml-auto align-items-center">
          <i class="fas fa-satellite fa-lg align-self-center {% if satellite.status == 're-entered' %}text-satnogs-inactive{% elif transmitter.status == 'active' %}text-satnogs-active{% else %}text-satnogs-inactive{% endif %}"></i>
          <div class="btn-group" role="group">
            <btn class="btn btn-satnogs dropdown-toggle ml-3" data-toggle="dropdown" aria-expanded="false"
              id="dropdown-{{ transmitter.id }}"><i class="fas fa-bars"></i></btn>
            <div class="dropdown-menu" aria-labelledby="dropdown-{{ transmitter.id }}">
              {% if request.user.is_superuser and suggestion_card %}
              <form action="{% url 'transmitter_suggestion_handler' %}" method="post"
                id="transmitter_suggestion_handler-form">
                {% csrf_token %}
                <input type="hidden" name="uuid" value="{{ transmitter.uuid }}">
                <button type="submit" name="approve" class="btn btn-satnogs btn-outline-success dropdown-item">
                  <i class="fas fa-check-square mr-2"></i>
                  Approve Suggestion
                </button>
                <button type="submit" name="reject" class="btn btn-satnogs btn-outline-danger dropdown-item">
                  <i class="fas fa-minus-square mr-2"></i>
                  Reject Suggestion
                </button>
              </form>
              {% endif %}
              {% if request.user.is_authenticated %}
              <a class="dropdown-item update-transmitter-link" data-toggle="modal" href="#"
              data-form-url="{% url 'update_transmitter' transmitter.id %}">
                <i class="fas fa-edit mr-2"></i>
                Edit
              </a>
              {% endif %}
              <a class="dropdown-item transmitter-uuid js-copy" title="UUID: {{ transmitter.uuid }}" data-toggle="tooltip" data-placement="left" data-copy="{{ transmitter.uuid }}">
                <i class="far fa-copy mr-2"></i>
                Copy UUID
              </a>
              <a class="dropdown-item" data-toggle="modal" data-target="#TransmitterCitation-{{ transmitter.id }}">
                <i class="fas fa-quote-left mr-2"></i>
                Citation
              </a>
            </div>
          </div>
        </div>
    </div>
  </div>
  <div class="card-body">
    <dl class="row">
      <dt class="col-sm-6">Type</dt>
      <dd class="col-sm-6">{{ transmitter.type }}</dd>
      {% if transmitter.service and transmitter.service != 'Unknown' %}
      <dt class="col-sm-6">Service</dt>
      <dd class="col-sm-6">{{ transmitter.service }}</dd>
      {% endif %}
      {% if transmitter.downlink_mode %}
      <dt class="col-sm-6">Downlink Mode</dt>
      <dd class="col-sm-6">{{ transmitter.downlink_mode }}</dd>
      {% endif %}
      {% if transmitter.downlink_low %}
      <dt class="col-sm-6">Downlink Frequency</dt>
      <dd class="col-sm-6" data-toggle="tooltip" data-placement="bottom" title="{{ transmitter.downlink_low }} Hz">
        <span class="frequency">{{ transmitter.downlink_low }}</span></dd>
      {% endif %}
      {% if transmitter.downlink_drift %}
      <dt class="col-sm-6">Downlink Drifted</dt>
      <dd class="col-sm-6" data-toggle="tooltip" data-placement="bottom" title="{{ transmitter.downlink_drift }} ppb">
        <span class="frequency drifted" data-freq_or="{{ transmitter.downlink_low }}" data-drift="{{ transmitter.downlink_drift }}">{{ transmitter.downlink_drift }}</dd>
      {% endif %}
      {% if transmitter.baud %}
      <dt class="col-sm-6">Baud</dt>
      <dd class="col-sm-6">{{ transmitter.baud|floatformat:0 }}</dd>
      {% endif %}
      {% if transmitter.downlink_high %}
      <dt class="col-sm-6">Downlink High</dt>
      <dd class="col-sm-6" data-toggle="tooltip" data-placement="bottom" title="{{ transmitter.downlink_high }}">
        <span class="frequency">{{ transmitter.downlink_high }}</dd>
      {% endif %}
      {% if transmitter.uplink_low %}
      <dt class="col-sm-6">Uplink Frequency</dt>
      <dd class="col-sm-6" data-toggle="tooltip" data-placement="bottom" title="{{ transmitter.uplink_low }}">
        <span class="frequency">{{ transmitter.uplink_low }}</dd>
      {% endif %}
      {% if transmitter.uplink_drift %}
      <dt class="col-sm-6">Uplink Drift</dt>
      <dd class="col-sm-6" data-toggle="tooltip" data-placement="bottom" title="{{ transmitter.uplink_drift }} ppb">
        <span class="frequency drifted" data-freq_or="{{ transmitter.uplink_low }}" data-drift="{{ transmitter.uplink_drift }}">{{ transmitter.uplink_drift }}</dd>
      {% endif %}
      {% if transmitter.uplink_high %}
      <dt class="col-sm-6">Uplink High</dt>
      <dd class="col-sm-6" data-toggle="tooltip" data-placement="bottom" title="{{ transmitter.uplink_high }}">
        <span class="frequency">{{ transmitter.uplink_high }}</dd>
      {% endif %}
      {% if transmitter.invert %}
      <dt class="col-sm-6">Inverted</dt>
      <dd class="col-sm-6">Yes</dd>
      {% endif %}
    </dl>
  </div>
  <div class="card-footer align-items-baseline justify-content-between transmitter-card-footer">
    Updated on {{ transmitter.created|date:'Y-m-d H:i' }} by {{ transmitter.user }}
  </div>
</div>
</div>

<!-- Citation Modal -->
<div class="modal fade" id="TransmitterCitation-{{ transmitter.id }}" tabindex="-1" role="dialog"
aria-labelledby="CitationModalLabel" aria-hidden="true">
<div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
      <h4 class="modal-title" id="CitationModalLabel">Citation for {{ transmitter.uuid }}</h4>
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
          aria-hidden="true">×</span></button>
    </div>
    <div class="modal-body">
      {{ transmitter.citation }}
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button>
    </div>
  </div>
</div>

<!-- Edit Suggestion Modal -->
{% comment %}
<div class="modal fade transmitter_suggestion-modal" id="EditSuggestionModal-{{ transmitter.id }}" tabindex="-1"
  role="dialog" aria-labelledby="EditSuggestionModalLabel" aria-hidden="true">
  {% include 'includes/transmitter_suggestion_modal.html' with transmitter=transmitter %}
</div>
{% endcomment %}