[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', 'media': 'screen,projection',
}, },
}, },
'frontend': {
'source_filenames': (
'css/frontend.css',
),
'output_filename': 'css/f.css',
'extra_context': {
'media': 'screen,projection',
},
},
} }
PIPELINE_JS = { PIPELINE_JS = {

View File

@ -10,9 +10,6 @@ from frontend.views import IndexView, RegisterView
urlpatterns = patterns('', 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'^$', IndexView.as_view(), name='frontend-index'),
url(r'^login/$', login_wrap, name='frontend-login'), url(r'^login/$', login_wrap, name='frontend-login'),
url(r'^logout/$', logout_wrap, name='frontend-logout'), url(r'^logout/$', logout_wrap, name='frontend-logout'),

View File

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

View File

@ -1,15 +1,15 @@
{% extends "layout/base.html" %} {% extends "layout/base.html" %}
{% block content %} {% block content %}
{% if form.errors %} <div id="frontend-loginform">
<p>Your username and password did not match. Please try again.</p> {% if form.errors %}
{% endif %} <p>Your username and password did not match. Please try again.</p>
<p> {% endif %}
<form method="POST" action="{% url 'frontend-login' %}"> <form class="form" role="form" method="POST" action="{% url 'frontend-login' %}">
{% csrf_token %} {% 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="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> </form>
</p> </div>
{% endblock %} {% endblock %}