Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add templates for Django OAuth Toolkit authorization views #59

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions auth_style/templates/oauth2_provider/authorize.html
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 %}
23 changes: 23 additions & 0 deletions auth_style/templates/oauth2_provider/authorized-oob.html
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 %}
48 changes: 48 additions & 0 deletions auth_style/templates/oauth2_provider/base.html
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>