[TASK] Beautify login form.

This commit is contained in:
Jan Philipp Timme 2014-07-27 23:54:55 +02:00
parent 134d7288a0
commit 26c8e43271
4 changed files with 19 additions and 12 deletions

View File

@ -84,6 +84,15 @@ PIPELINE_CSS = {
'media': 'screen,projection',
},
},
'frontend': {
'source_filenames': (
'css/frontend.css',
),
'output_filename': 'css/f.css',
'extra_context': {
'media': 'screen,projection',
},
},
}
PIPELINE_JS = {

View File

@ -10,9 +10,6 @@ from frontend.views import IndexView, RegisterView
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'citavi_mapper.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', IndexView.as_view(), name='frontend-index'),
url(r'^login/$', login_wrap, name='frontend-login'),
url(r'^logout/$', logout_wrap, name='frontend-logout'),

View File

@ -11,6 +11,7 @@
{% compressed_css 'bootstrap' %}
{% compressed_js 'bootstrap' %}
<!-- /Bootstrap -->
{% compressed_css 'frontend' %}
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">

View File

@ -1,15 +1,15 @@
{% extends "layout/base.html" %}
{% block content %}
{% if form.errors %}
<p>Your username and password did not match. Please try again.</p>
{% endif %}
<p>
<form method="POST" action="{% url 'frontend-login' %}">
<div id="frontend-loginform">
{% if form.errors %}
<p>Your username and password did not match. Please try again.</p>
{% endif %}
<form class="form" role="form" method="POST" action="{% url 'frontend-login' %}">
{% csrf_token %}
{{form.username.label_tag}} {{form.username}}<br>
{{form.password.label_tag}} {{form.password}}
<input type="submit" value="login" />
<input type="hidden" name="next" value="{{next}}" />
<input type="username" class="form-control" name="username" placeholder="Username" required autofocus>
<input type="password" class="form-control" name="password" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</p>
</div>
{% endblock %}