Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

Commit 9e04479

Browse files
author
Arjun
committed
v5.1
New Login Page Minor UI Changes
1 parent f6bf75b commit 9e04479

File tree

6 files changed

+116
-50
lines changed

6 files changed

+116
-50
lines changed

db.sqlite3

4 KB
Binary file not shown.

profile_images/me.jpg

-170 KB
Binary file not shown.

profile_images/me_RMLRaw3.jpg

-170 KB
Binary file not shown.

qa/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class UserProfile(models.Model):
2727

2828
# The additional attributes we wish to include.
2929
website = models.URLField(blank=True)
30-
picture = models.ImageField(upload_to='static/profile_images', blank=True)
30+
picture = models.ImageField(upload_to='profile_images', blank=True)
3131

3232
# Override the __unicode__() method to return out something meaningful!
3333
def __unicode__(self):

qa/templates/qa/index.html

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
</script>
117117

118118
<div class="container">
119+
119120
<div class="page-header">
120121
<a class="btn btn-lg btn-warning pull-right" href="#search"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Find</a><a class="btn btn-lg btn-danger pull-right" href="/add/">Ask Question</a><h1><a href="/">Simple QA </a><small>Open Questions</small></h1>
121122
</div>
@@ -161,6 +162,7 @@
161162
</div>
162163

163164
<div class="col-md-4">
165+
164166
<div class="panel panel-default">
165167
<div class="panel-body">
166168
<h4>Total Questions: {{ totalcount }}</h4>
@@ -194,16 +196,25 @@ <h3 class="panel-title">Unanswered Questions</h3>
194196
</div>
195197
</div>
196198

199+
{% if user.is_authenticated %}
200+
201+
<div class="span3 well">
202+
<center>
203+
<a href="/profile/{{ user.id }}" data-toggle="modal"><img src="/static/qa/user.png" name="aboutme" width="100" height="100" class="img-circle"></a>
204+
<h3>{{ user.first_name }} {{ user.last_name }}</h3>
205+
<a href="/profile/{{ user.id }}">My Profile</a> |
206+
<a href="/logout/">Logout</a>
207+
</center>
208+
</div>
209+
{% else %}
210+
<a class="btn btn-block btn-success" href="/login"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Login | Sign Up</a><br/>
211+
{% endif %}
212+
197213
</div>
198214
</div>
199215
<hr>
200216
<center>
201-
{% if user.is_authenticated %}
202-
<small>Logged in as <b>{{ user.username }}</b> ( <a href="/profile/{{ user.id }}">My Profile</a> | <a href="/logout/">Logout</a> )</small>
203-
{% else %}
204-
<small><a href="/login">Login</a></small>
205-
{% endif %}
206-
| <a href="/admin">Admin Panel</a></small></center>
217+
<a href="/admin">Admin Panel</a></small></center>
207218
<br/><br/>
208219

209220
<div id="search">

qa/templates/qa/login.html

Lines changed: 98 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,106 @@
33
{% bootstrap_css %}
44
{% bootstrap_javascript %}
55

6-
<div class="container">
7-
<div class="page-header">
8-
<h1><a href="/">Simple QA </a><small>Login</small></h1>
9-
</div>
10-
11-
<div class="row">
12-
<div class="col-md-6">
13-
<div class="panel panel-default">
14-
<div class="panel-heading">
15-
<h3 class="panel-title">Login</h3>
16-
</div>
17-
<div class="panel-body">
18-
<form id="login_form" method="post" action="/login/">
19-
{% csrf_token %}
20-
<input class="input-md" style="width:98%" placeholder="Username" type="text" name="username" value="" size="50" />
21-
<br /><br />
22-
<input class="input-md" style="width:98%" placeholder="Password" type="password" name="password" value="" size="50" />
23-
<br /><br />
6+
<style>
7+
body {
8+
padding-top: 120px;
9+
padding-bottom: 40px;
10+
background-color: #eee;
11+
12+
}
13+
.btn
14+
{
15+
outline:0;
16+
border:none;
17+
border-top:none;
18+
border-bottom:none;
19+
border-left:none;
20+
border-right:none;
21+
box-shadow:inset 2px -3px rgba(0,0,0,0.15);
22+
}
23+
.btn:focus
24+
{
25+
outline:0;
26+
-webkit-outline:0;
27+
-moz-outline:0;
28+
}
29+
.fullscreen_bg {
30+
position: fixed;
31+
top: 0;
32+
right: 0;
33+
bottom: 0;
34+
left: 0;
35+
background-size: cover;
36+
background-position: 50% 50%;
37+
background-image: url('http://cleancanvas.herokuapp.com/img/backgrounds/color-splash.jpg');
38+
background-repeat:repeat;
39+
}
40+
.form-signin {
41+
max-width: 280px;
42+
padding: 15px;
43+
margin: 0 auto;
44+
margin-top:50px;
45+
}
46+
.form-signin .form-signin-heading, .form-signin {
47+
margin-bottom: 10px;
48+
}
49+
.form-signin .form-control {
50+
position: relative;
51+
font-size: 16px;
52+
height: auto;
53+
padding: 10px;
54+
-webkit-box-sizing: border-box;
55+
-moz-box-sizing: border-box;
56+
box-sizing: border-box;
57+
}
58+
.form-signin .form-control:focus {
59+
z-index: 2;
60+
}
61+
.form-signin input[type="text"] {
62+
margin-bottom: -1px;
63+
border-bottom-left-radius: 0;
64+
border-bottom-right-radius: 0;
65+
border-top-style: solid;
66+
border-right-style: solid;
67+
border-bottom-style: none;
68+
border-left-style: solid;
69+
border-color: #000;
70+
}
71+
.form-signin input[type="password"] {
72+
margin-bottom: 10px;
73+
border-top-left-radius: 0;
74+
border-top-right-radius: 0;
75+
border-top-style: none;
76+
border-right-style: solid;
77+
border-bottom-style: solid;
78+
border-left-style: solid;
79+
border-color: rgb(0,0,0);
80+
border-top:1px solid rgba(0,0,0,0.08);
81+
}
82+
.form-signin-heading {
83+
color: #fff;
84+
text-align: center;
85+
text-shadow: 0 2px 2px rgba(0,0,0,0.5);
86+
}
87+
</style>
2488

25-
<input class="btn btn-primary" type="submit" value="Login" />
26-
</form>
27-
</div>
28-
</div>
29-
</div>
89+
<div id="fullscreen_bg" class="fullscreen_bg"/>
3090

31-
<div class="col-md-6">
32-
<div class="panel panel-info">
33-
<div class="panel-heading">
34-
<h3 class="panel-title">New User?</h3>
35-
</div>
36-
<div class="panel-body">
37-
<a href="/register">Create new Account!</a>
38-
</div>
39-
</div>
40-
</div>
4191

42-
</div>
92+
<div class="container">
93+
<form class="form-signin" id="login_form" method="post" action="/login/">
94+
<center><a href="/"><h1 class="form-signin-heading text-muted">Simple QA</h1></a></center><br/>
95+
<h1 class="form-signin-heading text-muted">Sign In</h1>
96+
<input type="text" class="form-control" placeholder="Username" type="text" name="username" required="" autofocus="">
97+
<input type="password" class="form-control" placeholder="Password" type="password" name="password" required="">
98+
{% csrf_token %}
99+
<button class="btn btn-lg btn-primary btn-block" type="submit">
100+
Sign In
101+
</button>
102+
</form>
43103

104+
<center><h2 class="form-signin-heading text-muted">or</h2>
105+
<a class="btn btn-lg btn-success" href="/register" type="submit">New User? Sign Up</a></center>
44106
</div>
45-
<hr>
46-
<center>
47-
{% if user.is_authenticated %}
48-
<small>Logged in as <b>{{ user.username }}</b> ( <a href="/profile/{{ user.id }}">My Profile</a> | <a href="/logout/">Logout</a> )</small>
49-
{% else %}
50-
<small><a href="/login">Login</a></small>
51-
{% endif %}
52-
| <a href="/admin">Admin Panel</a></small></center>
53-
<br/><br/>
107+
108+

0 commit comments

Comments
 (0)