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

Use Django admin base_site templates #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
33 changes: 13 additions & 20 deletions sp/templates/sp/error.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
{% extends "admin/base_site.html" %}
{% load i18n %}

<html>
<head>
<title>{% trans "SSO Error" %} - {{ idp }}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1 class="mt-2 mb-4 pb-2 border-bottom">{% trans "SSO Error" %}</h1>
<p>{{ reason }}</p>
<p>{% trans "State" %}: <code>{{ state }}</code></p>
{% if errors %}
<ul>
{% for err in errors %}
<li>{{ err }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
</body>
</html>
{% block content %}
<h1>{% trans "SSO Error" %}</h1>
<p>{{ reason }}</p>
<p>{% trans "State" %}: <code>{{ state }}</code></p>
{% if errors %}
<ul>
{% for err in errors %}
<li>{{ err }}</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
73 changes: 30 additions & 43 deletions sp/templates/sp/test.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,33 @@
{% extends "admin/base_site.html" %}
{% load i18n %}

<html>
<head>
<title>{% trans "IdP Test" %} - {{ idp }}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="pb-1 mt-4 mb-4 border-bottom">
<h1>{{ idp }}</h1>
</div>
{% block content %}
<h1>{% trans "IdP Test" %} - {{ idp }}</h1>
<dl>
<dt>{% trans "Name ID Format" %}</dt>
<dd>{{ nameid_format }}</dd>

<dl class="mb-4">
<dt>{% trans "Name ID Format" %}</dt>
<dd>{{ nameid_format }}</dd>

<dt>{% trans "Name ID" %}</dt>
<dd>{{ nameid }}</dd>
</dl>

<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>{% trans "SAML Attribute" %}</th>
<th>{% trans "Mapped Name" %}</th>
<th>{% trans "NameID" %}</th>
<th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
{% for attr, value in attrs %}
<tr>
<td>{{ attr.saml_attribute }}</td>
<td>{{ attr.mapped_name }}</td>
<td>{% if attr.is_nameid %}&#10004;{% endif %}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</body>
</html>
<dt>{% trans "Name ID" %}</dt>
<dd>{{ nameid }}</dd>
</dl>
<table>
<thead>
<tr>
<th>{% trans "SAML Attribute" %}</th>
<th>{% trans "Mapped Name" %}</th>
<th>{% trans "NameID" %}</th>
<th>{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
{% for attr, value in attrs %}
<tr>
<td>{{ attr.saml_attribute }}</td>
<td>{{ attr.mapped_name }}</td>
<td>{% if attr.is_nameid %}&#10004;{% endif %}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
20 changes: 7 additions & 13 deletions sp/templates/sp/unauth.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{% extends "admin/base_site.html" %}
{% load i18n %}

<html>
<head>
<title>{% trans "Authentication Error" %} - {{ idp }}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1 class="mt-2 mb-4 pb-2 border-bottom">{% if verify %}{% trans "Verification Error" %}{% else %}{% trans "Authentication Error" %}{% endif %}</h1>
<p>{% blocktrans with nameid=nameid %}Could not authenticate user "{{ nameid }}".{% endblocktrans %}</p>
{% if verify %}<p>{% blocktrans with user=user %}Expected verification credentials for "{{ user }}".{% endblocktrans %}</p>{% endif %}
</div>
</body>
</html>
{% block content %}
<h1>{% if verify %}{% trans "Verification Error" %}{% else %}{% trans "Authentication Error" %}{% endif %}</h1>
<p>{% blocktrans with nameid=nameid %}Could not authenticate user "{{ nameid }}".{% endblocktrans %}</p>
{% if verify %}<p>{% blocktrans with user=user %}Expected verification credentials for "{{ user }}".{% endblocktrans %}</p>{% endif %}
{% endblock %}
{% load i18n %}