{% extends "minecraft_manager/dashboard.html" %}
{% load csrf_html %}
{% block section %}
<div id="content">
  <h2 class="sub-header">Player Info ({{ player.username }})</h2>
  <div class="row">
      <div class="col-xs-9 col-md-6">
          <p>UUID: {{ player.uuid }}</p>
          {% if player.auth_user %}
              <p>Connected User: {{ player.auth_user.username }}</p>
          {% endif %}
          {% if player.application %}
              <p>Application: <a href="{% url "application" %}{{ player.application.id }}">Here</a></p>
          {% endif %}
          <p>Donor Status: {{ player.donor_status }}</p>
          <p>First Seen: {{ player.first_seen }}</p>
          <p>Last Seen: {{ player.last_seen }}</p>
          <p>Banned: {% if player.is_banned %}<span class="label label-danger">Yes</span>{% else %}<span class="label label-success">No</span>{% endif %}</p>
      </div>
      <div class="col-xs-9 col-md-6">
          <h4>Tickets</h4>
          <table class="table table-hover link-table">
              <tbody>
              {% if form.tickets %}
                  {% for ticket in form.tickets %}
                      <tr {% if ticket.resolved is True %}class="success"{% else %}class="danger"{% endif %} data-id="{{ ticket.id }}" data-url="{% url "ticket" %}">
                          <td>{{ ticket.id }}</td>
                          <td>{{ ticket.snippet }}</td>
                          <td>{{ ticket.resolved }}</td>
                      </tr>
                  {% endfor %}
              {% else %}
                  <tr><td colspan="3">No Tickets Found</td></tr>
              {% endif %}
              </tbody>
          </table>
          <br/>
          <table class="table table-hover link-table">
              <h4>Warnings</h4>
              <tbody>
              {% if form.warnings %}
                  {% for warning in form.warnings %}
                      <tr {% if warning.severity == 'L' %}class="info"{% endif %}{% if warning.severity == 'M' %}class="warning"{% endif %}{% if warning.severity == 'H' %}class="danger"{% endif %} data-id="{{ warning.id }}" data-url="{% url "warning" %}">
                          <!-- {{ warning.id }} -->
                          <td>{{ warning.snippet }}</td>
                          <td>{{ warning.severity_display }}</td>
                      </tr>
                  {% endfor %}
              {% else %}
                  <tr><td colspan="3">No Warnings Found</td></tr>
              {% endif %}
              </tbody>
          </table>
          <br/>
          <table class="table table-striped">
              <h4>IPs</h4>
              <tbody>
              {% if form.ips %}
                  {% for ip in form.ips %}
                      <tr class="default">
                          <!-- {{ ip.id }} -->
                          <td>{{ ip.ip }}</td>
                          {% if ip.associated %}
                              <td>
                              {% for assoc in ip.associated %}
                                  <a href="{% url "player" %}{{ assoc.id }}">{{ assoc.username }}</a>{% if assoc.is_banned %} <span class="label label-danger">Banned</span>{% endif %}<br/>
                              {% endfor %}
                              </td>
                          {% else %}
                              <td>None</td>
                          {% endif %}
                      </tr>
                  {% endfor %}
              {% else %}
                  <tr><td colspan="3">No IPs Found</td></tr>
              {% endif %}
              </tbody>
          </table>
      </div>
  </div>
<div class="row">
    <div class="col-xs-6 col-md-4">
          
      </div>
      <div class="col-xs-12 col-md-8">

      </div>
</div>
</div>
{% endblock section %}
