~xibo-maintainers/xibo/tempel

454.1.138 by Dan Garner
Added the client_credentials grant to the API and improved the applications user interface.
1
{#
2
/*
3
 * Spring Signage Ltd - http://www.springsignage.com
4
 * Copyright (C) 2015 Spring Signage Ltd
5
 * (${FILE_NAME})
6
 */
7
8
#}
9
10
{% extends "form-base.twig" %}
11
{% import "forms.twig" as forms %}
12
13
{% block formTitle %}
14
    {% trans "Edit Application" %}
15
{% endblock %}
16
17
{% block formButtons %}
18
    {% trans "Help" %}, XiboHelpRender("{{ help }}")
19
    {% trans "Cancel" %}, XiboDialogClose()
20
    {% trans "Save" %}, $("#applicationFormSubmit").submit()
21
{% endblock %}
22
23
{% block formHtml %}
24
    <div class="row">
25
        <div class="col-md-12">
502.1.7 by Dan Garner
API scopes for client_credentials grant types
26
            <ul class="nav nav-tabs" role="tablist">
27
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
28
                <li><a href="#scopes" role="tab" data-toggle="tab"><span>{% trans "Permissions" %}</span></a></li>
29
            </ul>
454.1.138 by Dan Garner
Added the client_credentials grant to the API and improved the applications user interface.
30
            <form id="applicationFormSubmit" class="XiboForm form-horizontal" method="put" action="{{ urlFor("application.edit", {id: client.key}) }}">
502.1.7 by Dan Garner
API scopes for client_credentials grant types
31
                <div class="tab-content">
32
                    <div class="tab-pane active" id="general">
33
                        {% set title %}{% trans "Application Name" %}{% endset %}
34
                        {{ forms.input("name", title, client.name) }}
35
36
                        {% set title %}{% trans "Client Id" %}{% endset %}
37
                        {{ forms.disabled("clientId", title, client.key, "", "", "disabled") }}
38
39
                        {% set title %}{% trans "Client Secret" %}{% endset %}
40
                        {{ forms.input("clientSecret", title, client.secret, "", "", "disabled") }}
41
42
                        {% set title %}{% trans "Reset Secret?" %}{% endset %}
43
                        {% set helpText %}{% trans "Reset your client secret to prevent access from any existing application." %}{% endset %}
44
                        {{ forms.checkbox("resetKeys", title, 0, helpText) }}
45
46
                        {% set title %}{% trans "Authorization Code?" %}{% endset %}
47
                        {% set helpText %}{% trans "Allow the Authorization Code Grant for this Client?" %}{% endset %}
48
                        {{ forms.checkbox("authCode", title, client.authCode, helpText) }}
49
50
                        {% set title %}{% trans "Client Credentials?" %}{% endset %}
51
                        {% set helpText %}{% trans "Allow the Client Credentials Grant for this Client?" %}{% endset %}
52
                        {{ forms.checkbox("clientCredentials", title, client.clientCredentials, helpText) }}
53
54
                        {% set title %}{% trans "Redirect URI" %}{% endset %}
55
                        {% set helpText %}{% trans "White listed redirect URI's that will be allowed, only application for Authorization Code Grants" %}{% endset %}
56
                        {{ forms.input("redirectUri[]", title, "", helpText) }}
57
                    </div>
58
                    <div class="tab-pane" id="scopes">
59
                        {% set message %}{% trans "Select permissions to grant to this application (scopes)." %}{% endset %}
60
                        {{ forms.message(message) }}
61
62
                        {% for url in client.redirectUris %}
63
                            {% set title %}{% trans "Redirect URI" %}{% endset %}
64
                            {{ forms.input("redirectUri[]", title, url.redirectUri) }}
65
                        {% endfor %}
66
67
                        {% for scope in scopes %}
68
                            {% set title %}{{ scope.description }}{% endset %}
69
                            {% set id %}scope_{{ scope.id }}{% endset %}
70
                            {{ forms.checkbox(id, title, scope.selected) }}
71
                        {% endfor %}
72
                    </div>
73
                </div>
454.1.138 by Dan Garner
Added the client_credentials grant to the API and improved the applications user interface.
74
            </form>
75
        </div>
76
    </div>
77
{% endblock %}