{% extends 'base_rigs.html' %}
{% load humanize %}
{% load static %}

{% block title %}RIGS{% endblock %}

{% block content %}
<div class="row">
    <h1 class="col-sm-12 pb-3">R<small class="text-muted">ig</small> I<small class="text-muted">nformation</small> G<small class="text-muted">athering</small> S<small class="text-muted">ystem</small></h1>
    <h2 class="col-sm-12 pb-3">Welcome back {{ user.get_full_name }}, there {%if rig_count == 1 %}is one rig coming up{%else%}are {{ rig_count|apnumber }} rigs coming up.{%endif%}</h2>
    {% if now %}
    <div class="col-sm-12">
    {% for event in now %}
    <div class="alert alert-primary rounded-0">
    Event <a href="{% url 'event_detail' event.pk %}" class="text-danger">{{ event }}</a> is happening today! <a href="{% url 'event_checkin' event.pk %}" class="btn btn-success btn-sm modal-href align-baseline {% if request.user.current_event %}disabled{%endif%}"><span class="fas fa-user-clock"></span> <span class="d-none d-sm-inline">Check In</span></a><br/>
    </div>
    {% endfor %}
    </div>
    {% endif %}
    <div class="col-sm-4 mb-3">
        <div class="card">
            <img class="card-img-top d-none d-sm-block" src="{% static 'imgs/rigs.jpg' %}" alt="Some lights and haze, very purple" style="height: 150px; object-fit: cover;">
            <h4 class="card-header">Rigboard</h4>
            <div class="list-group list-group-flush">
                <a class="list-group-item list-group-item-action" href="{% url 'rigboard' %}"><span class="fas fa-list align-middle"></span><span class="align-middle"> Rigboard</span></a>
                <a class="list-group-item list-group-item-action" href="{% url 'web_calendar' %}"><span class="fas fa-calendar align-middle"></span><span class="align-middle"> Calendar</span></a>
                {% if perms.RIGS.add_event %}
                    <a class="list-group-item list-group-item-action" href="{% url 'event_create' %}"><span class="fas fa-plus align-middle text-success"></span><span class="align-middle"> New Event</span></a>
                {% endif %}
                <a class="list-group-item list-group-item-action" href="{% url 'event_archive' %}"><span class="fas fa-book align-middle"></span><span class="align-middle"> Event Archive</span></a>
            </div>
        </div>
    </div>
    <div class="col-sm-4 mb-3">
        <div class="card">
            <img class="card-img-top d-none d-sm-block" src="{% if todays_date == '04-01' %}{% static 'imgs/tappytaptap.gif' %}{%else%}{% static 'imgs/assets.jpg' %}{%endif%}" alt="M32 sound desk close up of the faders" style="height: 150px; object-fit: cover;">
            <h4 class="card-header">Asset Database</h4>
            <div class="list-group list-group-flush">
                <a class="list-group-item list-group-item-action" href="{% url 'asset_index' %}"><span class="fas fa-tag align-middle"></span><span class="align-middle"> Asset List</span></a>
                {% if perms.assets.add_asset %}
                    <a class="list-group-item list-group-item-action" href="{% url 'asset_create' %}"><span class="fas fa-plus align-middle text-success"></span><span class="align-middle"> New Asset</span></a>
                {% endif %}
                <a class="list-group-item list-group-item-action" href="{% url 'supplier_list' %}"><span class="fas fa-parachute-box align-middle"></span><span class="align-middle"> Supplier List</span></a>
                {% if perms.assets.add_supplier %}
                    <a class="list-group-item list-group-item-action" href="{% url 'supplier_create' %}"><span class="fas fa-plus align-middle text-success"></span><span class="align-middle"> New Supplier</span></a>
                {% endif %}
            </div>
        </div>
    </div>
    <div class="col-sm-4 mb-3">
        <div class="card">
            <img class="card-img-top d-none d-sm-block" src="{% static 'imgs/training.jpg' %}" alt="People watching a presentation" style="height: 150px; object-fit: cover;">
            <h4 class="card-header">Training Database</h4>
            <div class="list-group list-group-flush">
                <a class="list-group-item list-group-item-action" href="{% url 'trainee_detail' request.user.pk %}"><span class="fas fa-file-signature align-middle text-info"></span><span class="align-middle"> My Training Record</span></a>
                <a class="list-group-item list-group-item-action" href="{% url 'trainee_list' %}"><span class="fas fa-users"></span><span class="align-middle"> Trainee List</span></a>
                <a class="list-group-item list-group-item-action" href="{% url 'level_list' %}"><span class="fas fa-layer-group"></span> <span class="align-middle">Level List</span></a>
                <a class="list-group-item list-group-item-action" href="{% url 'item_list' %}"><span class="fas fa-sitemap"></span> <span class="align-middle">Item List</span></a>
                {% if request.user.is_supervisor %}
                    <a class="list-group-item list-group-item-action" href="{% url 'session_log' %}"><span class="fas fa-users"></span> <span class="align-middle">Log Session</span></a>
                {% endif %}
            </div>
        </div>
    </div>
    <div class="col-sm mb-3">
        <div class="card">
            <h4 class="card-header">Quick Links</h4>
            <div class="list-group list-group-flush">
                    <a class="list-group-item list-group-item-action" href="https://forum.nottinghamtec.co.uk" target="_blank" rel="noopener noreferrer"><span class="fas fa-comment-alt text-primary align-middle"></span><span class="align-middle"> TEC Forum</span></a>
                    <a class="list-group-item list-group-item-action" href="//nottinghamtec.sharepoint.com" target="_blank" rel="noopener noreferrer"><span class="fas fa-folder text-info align-middle"></span><span class="align-middle"> TEC Sharepoint</span></a>
                    <a class="list-group-item list-group-item-action" href="//wiki.nottinghamtec.co.uk" target="_blank" rel="noopener noreferrer"><span class="fas fa-pen-square align-middle"></span><span class="align-middle"> TEC Wiki</span></a>
                    <a class="list-group-item list-group-item-action" href="https://secure.jotformeu.com/UoNSU/accident_report_form?studentGroup=Media+or+Service+Group&mediaserviceGroup=TEC" target="_blank" rel="noopener noreferrer"><span class="fas fa-heartbeat  align-middle text-danger"></span><span class="align-middle"> H&S Report Form</span></a>
                    {% if perms.RIGS.change_event %}
                        <a class="list-group-item list-group-item-action" href="//members.nottinghamtec.co.uk/price" target="_blank" rel="noopener noreferrer"><span class="fas fa-pound-sign text-warning align-middle"></span><span class="align-middle"> Price List</span></a>
                    {% endif %}
            </div>
        </div>
    </div>
    {% if perms.RIGS.view_event %}
    <div class="col-sm">
        {% include 'activity_feed.html' %}
    </div>
    {% endif %}
</div><!---end row--->
{% endblock %}
