{% extends "django_mobile_app_distribution/base.html" %}
{% load i18n staticfiles %}
{% load url from future %}

{% block title %}{% trans "app list view" %}{% endblock %}

{% block extra_head %}
    <link rel="stylesheet" href="{% static 'django_mobile_app_distribution/css/app_list.css' %}">
{% endblock %}

{% block content %}

    <div class="row">
        <div class="small-12 text-right columns">
            <a href="{% url 'auth_logout' %}">{% trans 'logout' %}</a>
        </div>
    </div>

    {% for app in apps %}
        <div class="app">
            <div class="row">
                <div class="small-12 columns">
                    <h2>{{ app.name }}</h2>
                </div>
            </div>

            <div class="row panel">
                <div class="row">

                    <div class="small-12 medium-3 columns app_info">
                        <strong>{% trans 'operating system' %}:</strong>
                        <br />
                        {{ app.operating_system }}
                    </div>

                    <div class="small-12 medium-2 columns app_info">
                        <strong>{% trans 'version' %}:</strong>
                        <br />
                        {{ app.version }}
                    </div>

                    <div class="small-12 medium-4 columns app_info">
                        <strong>{% trans 'build date' %}:</strong>
                        <br />
                        {{ app.updatedAt|date:"d M Y H:i" }}
                    </div>

                    <div class="small-12 medium-3 columns app_info">
                        <strong>{% trans 'comment' %}:</strong>
                        <br />
                        {{ app.comment }}
                    </div>
                </div>
                <div class="row collapse">
                    <div class="small-12 columns">
                        {% if app.operating_system == ios_identifier %}
                            <a class="button expand" href="itms-services://?action=download-manifest&url={{ app.get_plist_url }}">
                                {% trans 'Install App' %}
                            </a>
                        {% else %}
                            <a class="button expand" href="{% url 'django_mobile_app_distribution_send_apk' app_id=app.id %}">
                                {% trans 'Install App' %}
                            </a>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    {% endfor %}

{% endblock %}