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

Commit bee717b

Browse files
author
Arjun
committed
beta 5.4
UI Changes Bug Fixes
1 parent 4f3cc3f commit bee717b

File tree

13 files changed

+221
-241
lines changed

13 files changed

+221
-241
lines changed

db.sqlite3

4 KB
Binary file not shown.

qa/models.py

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

1919
# The additional attributes we wish to include.
2020
website = models.URLField(blank=True)
21-
picture = models.ImageField(upload_to='profile_images', blank=True)
21+
picture = models.ImageField(upload_to='qa/static/profile_images', blank=True)
2222

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

qa/templates/qa/add.html

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
{% bootstrap_javascript %}
55

66
<div class="container">
7-
<div class="page-header">
8-
<h1><a href="/">Simple QA </a><small>Add Question</small></h1>
9-
</div>
7+
8+
{% include "qa/header.html" %}
109

1110
{% if message %}
1211
<strong>Enter a valid Question!</strong>
@@ -28,12 +27,5 @@ <h1><a href="/">Simple QA </a><small>Add Question</small></h1>
2827
{% endif %}
2928

3029
</div>
31-
<hr>
32-
<center>
33-
{% if user.is_authenticated %}
34-
<small>Logged in as <b>{{ user.username }}</b> ( <a href="/logout/">Logout</a> )</small>
35-
{% else %}
36-
<small><a href="/login">Login</a></small>
37-
{% endif %}
38-
| <a href="/admin">Admin Panel</a></small></center>
39-
<br/><br/>
30+
31+
{% include "qa/footer.html" %}

qa/templates/qa/answer.html

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
{% load bootstrap3 %}
2-
3-
{% bootstrap_css %}
4-
{% bootstrap_javascript %}
51
{% load django_markdown %}
62

7-
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
8-
93
<div class="container">
10-
<div class="page-header">
11-
<h1><a href="/">Simple QA </a><small>Open Questions</small></h1>
12-
</div>
4+
5+
{% include "qa/header.html" %}
136

147
{% if message %}
158
<strong>Enter a valid Answer!</strong>
@@ -32,12 +25,4 @@ <h4>Answering Question : {{ question.question_text }}</h4>
3225
{% endif %}
3326
</div>
3427

35-
<hr>
36-
<center>
37-
{% if user.is_authenticated %}
38-
<small>Logged in as <b>{{ user.username }}</b> ( <a href="/logout/">Logout</a> )</small>
39-
{% else %}
40-
<small><a href="/login">Login</a></small>
41-
{% endif %}
42-
| <a href="/admin">Admin Panel</a></small></center>
43-
<br/><br/>
28+
{% include "qa/footer.html" %}

qa/templates/qa/comment.html

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
{% load bootstrap3 %}
2-
3-
{% bootstrap_css %}
4-
{% bootstrap_javascript %}
5-
61
<div class="container">
7-
<div class="page-header">
8-
<h1><a href="/">Simple QA </a><small>Add Question</small></h1>
9-
</div>
2+
3+
{% include "qa/header.html" %}
104

115
{% if message %}
126
<strong>Enter a valid comment!</strong>
@@ -26,12 +20,5 @@ <h1><a href="/">Simple QA </a><small>Add Question</small></h1>
2620
{% endif %}
2721

2822
</div>
29-
<hr>
30-
<center>
31-
{% if user.is_authenticated %}
32-
<small>Logged in as <b>{{ user.username }}</b> ( <a href="/logout/">Logout</a> )</small>
33-
{% else %}
34-
<small><a href="/login">Login</a></small>
35-
{% endif %}
36-
| <a href="/admin">Admin Panel</a></small></center>
37-
<br/><br/>
23+
24+
{% include "qa/footer.html" %}

qa/templates/qa/detail.html

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
{% load bootstrap3 %}
2-
3-
{% bootstrap_css %}
41
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
5-
{% bootstrap_javascript %}
62
<script>
73
$(function () {
84
$('[data-toggle="tooltip"]').tooltip()
@@ -26,9 +22,8 @@
2622
</style>
2723

2824
<div class="container">
29-
<div class="page-header">
30-
<h1><a href="/">Simple QA </a><small>Open Questions</small></h1>
31-
</div>
25+
26+
{% include "qa/header.html" %}
3227

3328
{% if message %}
3429
<div class="alert alert-danger" role="alert">{{ message }}
@@ -131,12 +126,5 @@ <h3 class="panel-title">Answers</h3>
131126
{% endif %}
132127

133128
</div>
134-
<hr>
135-
<center>
136-
{% if user.is_authenticated %}
137-
<small>Logged in as <b>{{ user.username }}</b> ( <a href="/logout/">Logout</a> )</small>
138-
{% else %}
139-
<small><a href="/login">Login</a></small>
140-
{% endif %}
141-
| <a href="/admin">Admin Panel</a></small></center>
142-
<br/><br/>
129+
130+
{% include "qa/footer.html" %}

qa/templates/qa/footer.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<hr>
2+
<center>
3+
<a href="http://www.djangoproject.com/"><img src="https://www.djangoproject.com/m/img/badges/djangoproject120x25.gif" border="0" alt="A Django project." title="A Django project." /></a> · <a href="https://github.com/arjunkomath/Simple-Q-A-App-using-Python-Django">Github</a> · <a href="/admin">Admin Panel</a></small></center>
4+
<br/><br/>
5+
6+
<div id="search">
7+
<button type="button" class="close">×</button>
8+
<form method="post" action="/search/">
9+
{% csrf_token %}
10+
<input type="search" value="" name="word" placeholder="type keyword(s) here" />
11+
<input class="btn btn-lg btn-warning" type="submit" value="Find" />
12+
</form>
13+
</div>

qa/templates/qa/header.html

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{% load bootstrap3 %}
2+
3+
{% bootstrap_css %}
4+
5+
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
6+
7+
{% bootstrap_javascript %}
8+
9+
<link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
10+
11+
<style>
12+
13+
.ques {
14+
font-family: 'Roboto', sans-serif;
15+
font-size: 20px;
16+
}
17+
18+
reward {
19+
font-size: 15px;
20+
color: #FF4444;
21+
}
22+
23+
.ans {
24+
height: 40px;
25+
width: 75px;
26+
color:#500000;
27+
text-align: center;
28+
text-align: center;
29+
vertical-align: middle;
30+
}
31+
32+
tag {
33+
background-color:#E0E0E0;
34+
color:#500000;
35+
}
36+
37+
38+
#search {
39+
position: fixed;
40+
top: 0px;
41+
left: 0px;
42+
width: 100%;
43+
height: 100%;
44+
background-color: rgba(0, 0, 0, 0.7);
45+
46+
-webkit-transition: all 0.5s ease-in-out;
47+
-moz-transition: all 0.5s ease-in-out;
48+
-o-transition: all 0.5s ease-in-out;
49+
-ms-transition: all 0.5s ease-in-out;
50+
transition: all 0.5s ease-in-out;
51+
52+
-webkit-transform: translate(0px, -100%) scale(0, 0);
53+
-moz-transform: translate(0px, -100%) scale(0, 0);
54+
-o-transform: translate(0px, -100%) scale(0, 0);
55+
-ms-transform: translate(0px, -100%) scale(0, 0);
56+
transform: translate(0px, -100%) scale(0, 0);
57+
58+
opacity: 0;
59+
}
60+
61+
#search.open {
62+
-webkit-transform: translate(0px, 0px) scale(1, 1);
63+
-moz-transform: translate(0px, 0px) scale(1, 1);
64+
-o-transform: translate(0px, 0px) scale(1, 1);
65+
-ms-transform: translate(0px, 0px) scale(1, 1);
66+
transform: translate(0px, 0px) scale(1, 1);
67+
opacity: 1;
68+
}
69+
70+
#search input[type="search"] {
71+
position: absolute;
72+
top: 50%;
73+
width: 100%;
74+
color: rgb(255, 255, 255);
75+
background: rgba(0, 0, 0, 0);
76+
font-size: 60px;
77+
font-weight: 300;
78+
text-align: center;
79+
border: 0px;
80+
margin: 0px auto;
81+
margin-top: -51px;
82+
padding-left: 30px;
83+
padding-right: 30px;
84+
outline: none;
85+
}
86+
#search .btn {
87+
position: absolute;
88+
top: 50%;
89+
left: 50%;
90+
margin-top: 61px;
91+
margin-left: -45px;
92+
}
93+
#search .close {
94+
position: fixed;
95+
top: 15px;
96+
right: 15px;
97+
color: #fff;
98+
background-color: #428bca;
99+
border-color: #357ebd;
100+
opacity: 1;
101+
padding: 10px 17px;
102+
font-size: 27px;
103+
}
104+
105+
</style>
106+
<script>
107+
$(function () {
108+
$('a[href="#search"]').on('click', function(event) {
109+
event.preventDefault();
110+
$('#search').addClass('open');
111+
$('#search > form > input[type="search"]').focus();
112+
});
113+
114+
$('#search, #search button.close').on('click keyup', function(event) {
115+
if (event.target == this || event.target.className == 'close' || event.keyCode == 27) {
116+
$(this).removeClass('open');
117+
}
118+
});
119+
120+
});
121+
</script>
122+
123+
<div class="page-header">
124+
<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/"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ask Question</a><h1><a href="/"><img width="50px" src="http://icons.iconarchive.com/icons/seanau/flat-app/256/Questionmark-icon.png" />Simple QA </a><small>Open Questions</small></h1>
125+
</div>

0 commit comments

Comments
 (0)