2014-03-14 22:57:28 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block title %}
|
2015-11-02 19:16:04 +00:00
|
|
|
<title>Authorize {{ application.name }} · Quay</title>
|
2014-03-14 22:57:28 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block body_content %}
|
2014-03-19 18:27:33 +00:00
|
|
|
<div class="container" ng-if="user.anonymous">
|
|
|
|
<div class="col-sm-6 col-sm-offset-3">
|
|
|
|
<div class="user-setup"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container auth-container" ng-if="!user.anonymous">
|
2014-03-14 22:57:28 +00:00
|
|
|
<div class="auth-header">
|
2015-04-24 20:42:31 +00:00
|
|
|
<span class="avatar" size="48" data="{{ application.avatar }}"></span>
|
2016-04-28 18:38:22 +00:00
|
|
|
<h2><a href="{{ application.url }}" ng-safenewtab>{{ application.name }}</a></h2>
|
2014-03-14 22:57:28 +00:00
|
|
|
<h4>
|
2015-04-24 20:42:31 +00:00
|
|
|
<span class="avatar" size="24" data="{{ application.organization.avatar }}"
|
2014-11-25 00:25:13 +00:00
|
|
|
style="vertical-align: middle; margin-right: 4px;"></span>
|
2014-03-24 22:30:22 +00:00
|
|
|
<span style="vertical-align: middle">{{ application.organization.name }}</span>
|
2014-03-14 22:57:28 +00:00
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="auth-scopes">
|
|
|
|
<div class="reason">This application would like permission to:</div>
|
|
|
|
<div class="panel-group">
|
|
|
|
{% for index, scope in enumerate(scopes) %}
|
2014-08-06 01:21:22 +00:00
|
|
|
<div class="scope panel panel-default {% if scope.dangerous %} dangerous {% endif %}">
|
2014-03-14 22:57:28 +00:00
|
|
|
<div class="panel-heading">
|
|
|
|
<h4 class="panel-title">
|
|
|
|
<div class="title-container">
|
2014-08-06 01:21:22 +00:00
|
|
|
<div class="title {% if not scope.dangerous %}collapsed{% endif %}" data-toggle="collapse"
|
|
|
|
data-parent="#scopeGroup" data-target="#description-{{ index }}">
|
2014-03-18 21:55:52 +00:00
|
|
|
<i class="fa arrow"></i>
|
|
|
|
<i class="fa {{ scope.icon }} fa-lg"></i>
|
2014-03-14 22:57:28 +00:00
|
|
|
<a data-toggle="collapse" href="#collapseOne">
|
2014-11-24 21:07:38 +00:00
|
|
|
{{ scope.title }}
|
2014-03-14 22:57:28 +00:00
|
|
|
</a>
|
2014-08-06 01:21:22 +00:00
|
|
|
|
|
|
|
{% if scope.dangerous %}
|
|
|
|
<i class="fa fa-lg fa-exclamation-triangle"
|
2014-08-06 20:39:32 +00:00
|
|
|
data-title="This scope grants permissions which are potentially dangerous. Be careful when authorizing it!"
|
2014-08-06 01:21:22 +00:00
|
|
|
data-container="body" bs-tooltip></i>
|
|
|
|
{% endif %}
|
2014-03-14 22:57:28 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</h4>
|
|
|
|
</div>
|
2014-08-06 01:21:22 +00:00
|
|
|
<div id="description-{{ index }}" class="panel-collapse {% if not scope.dangerous %} collapse {% else %} in {% endif %}">
|
2014-03-14 22:57:28 +00:00
|
|
|
<div class="panel-body">
|
2014-08-06 01:21:22 +00:00
|
|
|
{% if scope.dangerous %}
|
2014-08-06 20:39:32 +00:00
|
|
|
<div class="alert alert-warning">This scope grants permissions which are potentially dangerous. Be careful when authorizing it!</div>
|
2014-08-06 01:21:22 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2014-03-14 22:57:28 +00:00
|
|
|
{{ scope.description }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="button-bar">
|
2014-08-06 01:21:22 +00:00
|
|
|
{% if has_dangerous_scopes %}
|
|
|
|
<button type="button" class="btn btn-warning" onclick="$('#confirmAuthorizeModal').modal()">Authorize Application</button>
|
|
|
|
{% else %}
|
2014-03-14 22:57:28 +00:00
|
|
|
<form method="post" action="/oauth/authorizeapp">
|
|
|
|
<input type="hidden" name="client_id" value="{{ client_id }}">
|
|
|
|
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
|
|
|
|
<input type="hidden" name="scope" value="{{ scope }}">
|
2014-03-25 18:32:26 +00:00
|
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token_val }}">
|
2014-03-14 22:57:28 +00:00
|
|
|
<button type="submit" class="btn btn-success">Authorize Application</button>
|
2014-08-06 01:21:22 +00:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
<form method="post" action="/oauth/denyapp">
|
2014-03-24 22:30:22 +00:00
|
|
|
<input type="hidden" name="client_id" value="{{ client_id }}">
|
|
|
|
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
|
|
|
|
<input type="hidden" name="scope" value="{{ scope }}">
|
2014-03-25 18:32:26 +00:00
|
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token_val }}">
|
2014-03-24 22:30:22 +00:00
|
|
|
<button type="submit" class="btn btn-default">Cancel</button>
|
2014-03-14 22:57:28 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2014-08-06 01:21:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- Modal message dialog -->
|
|
|
|
<div class="modal fade" id="confirmAuthorizeModal">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Confirm Authorization</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2014-08-06 20:39:32 +00:00
|
|
|
The application <strong>{{ application.name }}</strong> is requesting permission to perform actions which are potentially dangerous.
|
2014-08-06 01:21:22 +00:00
|
|
|
<br><br>
|
2014-08-06 20:39:32 +00:00
|
|
|
Are you sure you want to authorize this application?
|
2014-08-06 01:21:22 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<form method="post" action="/oauth/authorizeapp" style="display: inline-block">
|
|
|
|
<input type="hidden" name="client_id" value="{{ client_id }}">
|
|
|
|
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
|
|
|
|
<input type="hidden" name="scope" value="{{ scope }}">
|
|
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token_val }}">
|
|
|
|
<button type="submit" class="btn btn-success">Authorize Application</button>
|
|
|
|
</form>
|
|
|
|
<form method="post" action="/oauth/denyapp" style="display: inline-block">
|
|
|
|
<input type="hidden" name="client_id" value="{{ client_id }}">
|
|
|
|
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
|
|
|
|
<input type="hidden" name="scope" value="{{ scope }}">
|
|
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token_val }}">
|
|
|
|
<button type="submit" class="btn btn-default">Deny</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div><!-- /.modal-content -->
|
|
|
|
</div><!-- /.modal-dialog -->
|
|
|
|
</div><!-- /.modal -->
|
|
|
|
|
|
|
|
|
2014-03-14 22:57:28 +00:00
|
|
|
{% endblock %}
|