{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load staticfiles %}
{% block title %}{% trans "Device configuration" %}{% endblock %}
{% block content %}
    {% if config.app == "pretixdroid" %}
        <h1>
            {% trans "pretixdroid configuration" %}
            <a href="{% url "plugins:pretixdroid:config" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default">
                {% trans "Back to overview" %}
            </a>
        </h1>
        <h2>{% trans "1. Download app" %}</h2>
        <p>
            <a href="http://play.google.com/store/apps/details?id=eu.pretix.pretixdroid">
                <img src="{% static "pretixplugins/pretixdroid/play_store_en.png" %}" alt="
    {% trans "Download the app from the Google Play Store" %}" height="70">
            </a>
        </p>
        <p>
            <small>
                {% blocktrans trimmed %}
                    Android, Google Play and the Google Play logo are trademarks of Google Inc.
                {% endblocktrans %}
            </small>
        </p>
        <h2>{% trans "2. Scan code" %}</h2>
        <div id="qrcodeCanvas"></div>
        <script type="text/json" id="qrdata">
            {{ qrdata|safe }}

        </script>
        <h2>{% trans "3. Start scanning tickets" %}</h2>
        <script type="text/javascript" src="{% static "pretixplugins/pretixdroid/pretixdroid.js" %}"></script>
    {% else %}
        <h1>
            {% trans "pretixdesk configuration" %}
            <a href="{% url "plugins:pretixdroid:config" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default">
                {% trans "Back to overview" %}
            </a>
        </h1>
        <h2>{% trans "1. Download pretixdesk" %}</h2>
        <p>
            <a href="https://pretix.eu/about/en/desk" class="btn btn-lg btn-primary" target="_blank">
                {% trans "Open download page" %}
            </a>
        </p>
        <h2>{% trans "2. Connect device" %}</h2>
        <p>
            <a href="pretixdesk://setup?{{ query }}" class="btn btn-lg btn-primary">
                {% trans "Connect with pretixdesk" %}
            </a>
        </p>
        <p>
            {% blocktrans trimmed %}
                If this link does not open the pretixdesk application or if you want to set the application up on a
                seperate device, copy the following code and paste it into the application:
            {% endblocktrans %}
        </p>
        <p>
            <input type="text" class="form-control" value="pretixdesk://setup?{{ query }}" readonly>
        </p>
        <h2>{% trans "3. Start scanning tickets" %}</h2>
        <script type="text/javascript" src="{% static "pretixplugins/pretixdroid/pretixdroid.js" %}"></script>
    {% endif %}
{% endblock %}

