Brush up styles in the login form
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#content-body {
|
||||
width: 50vw;
|
||||
max-width: 800px;
|
||||
margin: 40px auto;
|
||||
}
|
||||
|
||||
#login-button {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#site-title {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
+37
-10
@@ -3,17 +3,44 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>SIK - Login</title>
|
||||
<link rel="stylesheet" href="static/css/login.css">
|
||||
|
||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css" rel = "stylesheet">
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.6/angular.js"></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular-route.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div>{{ error }}</div>
|
||||
<form method="POST" action=""> {% csrf_token %}
|
||||
<div> Käyttäjätunnus
|
||||
<input type="text" name="username" placeholder="Keijo Kiltalainen"></input>
|
||||
</div>
|
||||
<div> Salasana
|
||||
<input type="password" name="passwd" placeholder="abc123"></input>
|
||||
</div>
|
||||
<input type="submit" value="Kirjaudu">
|
||||
</form>
|
||||
<div id="content-body" class="container">
|
||||
<h1 id="site-title">SIK Admin</h1>
|
||||
<form method="POST" class="form-horizontal" action=""> {% csrf_token %}
|
||||
<div class="form-group row">
|
||||
<label for="input-username" class="col-sm-2 col-form-label">Käyttäjätunnus</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="username" id="input-username" class="form-control" placeholder="Käyttäjätunnus"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="input-password" class="col-sm-2 col-form-label">Salasana</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" name="passwd" id="input-passwd" class="form-control" placeholder="Salasana"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="text-danger">{{ error }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="login-button">
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" class="btn btn-default">Kirjaudu</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ def login_view(request, *args, **kwargs):
|
||||
login(request, user)
|
||||
original_site = request.GET.get("next",None) or "/"
|
||||
return redirect(original_site)
|
||||
return render(request, "login.html", {"error":"kirjautuminen kosahti. koita uudelleen"})
|
||||
return render(request, "login.html", {"error" : "☹ Kirjautuminen kosahti. Yritä uudelleen!"})
|
||||
# user got here by a get request
|
||||
user = request.user
|
||||
if user.is_authenticated():
|
||||
|
||||
Reference in New Issue
Block a user