Skip to content

Commit

Permalink
Reformat and tweak HTML templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jbittel committed Mar 21, 2016
1 parent ce31115 commit c98a06c
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 91 deletions.
99 changes: 48 additions & 51 deletions mama_cas/templates/mama_cas/__base.html
Original file line number Diff line number Diff line change
@@ -1,61 +1,58 @@
{% load i18n %}

<!DOCTYPE html>
{% load i18n %}<!DOCTYPE html>
<html>
<head>
<head>
{% block meta_tags %}
<meta charset="utf-8">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{% endblock meta_tags %}
<title>
{% block title %}{% trans "Central Authentication Service" %}{% endblock title %}
</title>
<title>{% block title %}{% trans "Central Authentication Service" %}{% endblock title %}</title>
{% block styles %}
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style type="text/css">
body {
background-color: #eee;
}
.login-title {
color: #555;
font-size: 1.8em;
}
.form-login .checkbox {
font-weight: normal;
padding-left: 20px;
}
.form-login .form-control {
font-size: 16px;
height: auto;
padding: 10px;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.form-login .form-control:focus {
z-index: 2;
}
.form-login input[type="text"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-login input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
</style>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style type="text/css">
body {
background-color: #eee;
}
.login-title {
color: #555;
font-size: 1.8em;
margin-bottom: 20px;
}
.form-login .checkbox {
font-weight: normal;
padding-left: 20px;
}
.form-login .form-control {
font-size: 16px;
height: auto;
padding: 10px;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.form-login .form-control:focus {
z-index: 2;
}
.form-login input[type="text"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-login input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
</style>
{% endblock styles %}
{% block javascript %}{% endblock javascript %}
{% block extra_head %}{% endblock extra_head %}
</head>
<body>
</head>
<body>
<div class="container">
{% block content %}{% endblock content %}
{% block content %}{% endblock content %}
</div>
</body>
</body>
</html>
40 changes: 20 additions & 20 deletions mama_cas/templates/mama_cas/__login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
{% load i18n %}

{% block content %}
<h1 class="text-center login-title">
{% block content_title %}{% trans "Central Authentication Service" %}{% endblock content_title %}
</h1>
<h1 class="text-center login-title">
{% block content_title %}{% trans "Central Authentication Service" %}{% endblock content_title %}
</h1>

<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
{% include "mama_cas/_messages.html" %}
<form class="form-login" method="post">
{% csrf_token %}
<label class="sr-only" for="id_username">{{ form.username.label }}</label>
<input type="text" class="form-control" id="id_username" name="username" placeholder="{{ form.username.label }}" required autofocus>
<label class="sr-only" for="id_password">{{ form.password.label }}</label>
<input type="password" class="form-control" id="id_password" name="password" placeholder="{{ form.password.label }}" required>
{% if form.warn %}
<label class="checkbox">
<input type="checkbox" id="id_warn" name="warn"> {{ form.warn.label }}
</label>
{% endif %}
<button class="btn btn-lg btn-primary btn-block" type="submit">{% trans "Login" %}</button>
</form>
</div>
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
{% include "mama_cas/_messages.html" %}
<form class="form-login" method="post">
{% csrf_token %}
<label class="sr-only" for="id_username">{{ form.username.label }}</label>
<input type="text" class="form-control" id="id_username" name="username" placeholder="{{ form.username.label }}" required autofocus>
<label class="sr-only" for="id_password">{{ form.password.label }}</label>
<input type="password" class="form-control" id="id_password" name="password" placeholder="{{ form.password.label }}" required>
{% if form.warn %}
<label class="checkbox">
<input type="checkbox" id="id_warn" name="warn"> {{ form.warn.label }}
</label>
{% endif %}
<button class="btn btn-lg btn-primary btn-block" type="submit">{% trans "Login" %}</button>
</form>
</div>
</div>
{% endblock content %}
12 changes: 6 additions & 6 deletions mama_cas/templates/mama_cas/__warn.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{% load i18n %}

{% block content %}
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
{% include "mama_cas/_messages.html" %}
<a href="{{ service }}" class="btn btn-lg btn-primary btn-block" role="button">{% trans "Yes, continue" %}</a>
<a href="{% url "cas_logout" %}" class="btn btn-link pull-right" role="button">{% trans "No, log me out" %}</a>
</div>
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
{% include "mama_cas/_messages.html" %}
<a href="{{ service }}" class="btn btn-lg btn-primary btn-block" role="button">{% trans "Yes, continue" %}</a>
<a href="{% url "cas_logout" %}" class="btn btn-link pull-right" role="button">{% trans "No, log me out" %}</a>
</div>
</div>
{% endblock content %}
24 changes: 10 additions & 14 deletions mama_cas/templates/mama_cas/_messages.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{% if messages %}
<div class="alert alert-info"><ul>
{% for message in messages %}
<li>{{ message|urlize }}</li>
{% endfor %}
</ul></div>
{% for message in messages %}
<div class="alert alert-info">{{ message }}</div>
{% endfor %}
{% endif %}

{% if form.errors %}
<div class="alert alert-danger"><ul>
{% for error in form.non_field_errors %}
<li>{{ error }}</li>
{% endfor %}
{% for field in form %}
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
{% for error in form.non_field_errors %}
<div class="alert alert-danger">{{ error }}</div>
{% endfor %}
{% for field in form %}
{% for error in field.errors %}
<div class="alert alert-danger">{{ error }}</div>
{% endfor %}
</ul></div>
{% endfor %}
{% endif %}

0 comments on commit c98a06c

Please sign in to comment.