Edit templates in example project.

This commit is contained in:
Ignacio 2016-04-07 19:41:50 -03:00
parent 559f90c5a6
commit 9adfa7e6bc
4 changed files with 26 additions and 24 deletions

View file

@ -87,5 +87,3 @@ LOGIN_REDIRECT_URL = '/'
# OIDC Provider settings
SITE_URL = 'http://localhost:8000'
LOGIN_URL = '/admin/login/'

View file

@ -22,9 +22,9 @@
{% if user.is_superuser %}
<a href="{% url 'admin:index' %}" class="item">Admin</a>
{% endif %}
<a href="{% url 'admin:logout' %}" class="item"><i class="remove icon"></i></a>
<a href="{% url 'logout' %}" class="item"><i class="remove icon"></i></a>
{% else %}
<a href="{% url 'admin:login' %}" class="item">Login</a>
<a href="{% url 'login' %}" class="item">Login</a>
{% endif %}
</div>
</div>

View file

@ -2,27 +2,29 @@
{% block content %}
<div class="ui page grid">
<div class="row">
<div class="six wide centered column">
{% if form.errors %}
<div class="ui negative message">
<p>Your username and password didn't match. Please try again.</p>
<div class="ui container" style="margin-top:100px">
<div class="ui stackable grid">
<div class="row">
<div class="eight wide centered column">
{% if form.errors %}
<div class="ui negative message">
<p>Your username and password didn't match. Please try again.</p>
</div>
{% endif %}
<form class="ui form segment" method="post" action="{% url 'login' %}">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}">
<div class="field">
<label>Username</label>
<input type="text" name="username">
</div>
<div class="field">
<label>Password</label>
<input type="password" name="password">
</div>
<input class="ui submit big primary fluid button" type="submit" value="Enter" />
</form>
</div>
{% endif %}
<form class="ui form segment" method="post" action="{% url 'login' %}">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}">
<div class="field">
<label>Username</label>
<input type="text" name="username">
</div>
<div class="field">
<label>Password</label>
<input type="password" name="password">
</div>
<input class="ui submit big primary fluid button" type="submit" value="Enter" />
</form>
</div>
</div>
</div>

View file

@ -6,6 +6,8 @@ from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'),
url(r'^accounts/login/$', auth_views.login, { 'template_name': 'login.html' }, name='login'),
url(r'^accounts/logout/$', auth_views.logout, { 'next_page': '/' }, name='logout'),
url(r'^', include('oidc_provider.urls', namespace='oidc_provider')),