~xibo-maintainers/xibo/tempel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{#
/*
 * Spring Signage Ltd - http://www.springsignage.com
 * Copyright (C) 2015 Spring Signage Ltd
 * (${FILE_NAME})
 */

#}

{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}

{% block formTitle %}
    {% trans "Edit Application" %}
{% endblock %}

{% block formButtons %}
    {% trans "Help" %}, XiboHelpRender("{{ help }}")
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, $("#applicationFormSubmit").submit()
{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <ul class="nav nav-tabs" role="tablist">
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
                <li><a href="#scopes" role="tab" data-toggle="tab"><span>{% trans "Permissions" %}</span></a></li>
            </ul>
            <form id="applicationFormSubmit" class="XiboForm form-horizontal" method="put" action="{{ urlFor("application.edit", {id: client.key}) }}">
                <div class="tab-content">
                    <div class="tab-pane active" id="general">
                        {% set title %}{% trans "Application Name" %}{% endset %}
                        {{ forms.input("name", title, client.name) }}

                        {% set title %}{% trans "Client Id" %}{% endset %}
                        {{ forms.disabled("clientId", title, client.key, "", "", "disabled") }}

                        {% set title %}{% trans "Client Secret" %}{% endset %}
                        {{ forms.input("clientSecret", title, client.secret, "", "", "disabled") }}

                        {% set title %}{% trans "Reset Secret?" %}{% endset %}
                        {% set helpText %}{% trans "Reset your client secret to prevent access from any existing application." %}{% endset %}
                        {{ forms.checkbox("resetKeys", title, 0, helpText) }}

                        {% set title %}{% trans "Authorization Code?" %}{% endset %}
                        {% set helpText %}{% trans "Allow the Authorization Code Grant for this Client?" %}{% endset %}
                        {{ forms.checkbox("authCode", title, client.authCode, helpText) }}

                        {% set title %}{% trans "Client Credentials?" %}{% endset %}
                        {% set helpText %}{% trans "Allow the Client Credentials Grant for this Client?" %}{% endset %}
                        {{ forms.checkbox("clientCredentials", title, client.clientCredentials, helpText) }}

                        {% set title %}{% trans "Redirect URI" %}{% endset %}
                        {% set helpText %}{% trans "White listed redirect URI's that will be allowed, only application for Authorization Code Grants" %}{% endset %}
                        {{ forms.input("redirectUri[]", title, "", helpText) }}
                    </div>
                    <div class="tab-pane" id="scopes">
                        {% set message %}{% trans "Select permissions to grant to this application (scopes)." %}{% endset %}
                        {{ forms.message(message) }}

                        {% for url in client.redirectUris %}
                            {% set title %}{% trans "Redirect URI" %}{% endset %}
                            {{ forms.input("redirectUri[]", title, url.redirectUri) }}
                        {% endfor %}

                        {% for scope in scopes %}
                            {% set title %}{{ scope.description }}{% endset %}
                            {% set id %}scope_{{ scope.id }}{% endset %}
                            {{ forms.checkbox(id, title, scope.selected) }}
                        {% endfor %}
                    </div>
                </div>
            </form>
        </div>
    </div>
{% endblock %}