-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add templates for Django OAuth Toolkit authorization views
- Loading branch information
1 parent
6c2bf62
commit 4c3a7ed
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% extends "oauth2_provider/base.html" %} | ||
|
||
{% load i18n %} | ||
{% block content %} | ||
<div class="block-center"> | ||
{% if not error %} | ||
<form id="authorizationForm" method="post"> | ||
<h3 class="block-center-heading">{% trans "Authorize" %} {{ application.name }}?</h3> | ||
{% csrf_token %} | ||
|
||
{% for field in form %} | ||
{% if field.is_hidden %} | ||
{{ field }} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
<p>{% trans "Application requires the following permissions" %}</p> | ||
<ul> | ||
{% for scope in scopes_descriptions %} | ||
<li>{{ scope }}</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{{ form.errors }} | ||
{{ form.non_field_errors }} | ||
|
||
<div class="control-group"> | ||
<div class="controls"> | ||
<input type="submit" class="btn btn-large" value="{% trans 'Cancel' %}"/> | ||
<input type="submit" class="btn btn-large btn-primary" name="allow" value="{% trans 'Authorize' %}"/> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
{% else %} | ||
<h2>Error: {{ error.error }}</h2> | ||
<p>{{ error.description }}</p> | ||
{% endif %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends "oauth2_provider/base.html" %} | ||
|
||
{% load i18n %} | ||
|
||
{% block title %} | ||
Success code={{code}} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="block-center"> | ||
{% if not error %} | ||
<h2>{% trans "Success" %}</h2> | ||
|
||
<p>{% trans "Please return to your application and enter this code:" %}</p> | ||
|
||
<p><code>{{ code }}</code></p> | ||
|
||
{% else %} | ||
<h2>Error: {{ error.error }}</h2> | ||
<p>{{ error.description }}</p> | ||
{% endif %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{% block title %}{% endblock title %}</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
|
||
{% block css %} | ||
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet"> | ||
{% endblock css %} | ||
|
||
<style> | ||
body { | ||
padding-top: 40px; | ||
padding-bottom: 40px; | ||
background-color: #f5f5f5; | ||
} | ||
.block-center { | ||
max-width: 500px; | ||
padding: 19px 29px 29px; | ||
margin: 0 auto 20px; | ||
background-color: #fff; | ||
border: 1px solid #e5e5e5; | ||
-webkit-border-radius: 5px; | ||
-moz-border-radius: 5px; | ||
border-radius: 5px; | ||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05); | ||
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05); | ||
box-shadow: 0 1px 2px rgba(0,0,0,.05); | ||
} | ||
.block-center .block-center-heading { | ||
margin-bottom: 10px; | ||
} | ||
|
||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div class="container"> | ||
{% block content %} | ||
{% endblock content %} | ||
</div> | ||
|
||
</body> | ||
</html> |