-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
103 lines (93 loc) · 3.07 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<title>Q & A Site</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Roboto font from Google -->
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<!-- 'static' is the directory containing css files -->
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'qa/style.css' %}" />
</head>
<body>
{% load qa_extras %}
<div id="main">
{% if user.is_authenticated %}
{{user.username}}
<form action="/qa/profile/" id="profile">
<input type="submit" value="Profile" />
</form>
<form action="/qa/logout/" id="logout">
<input type="submit" value="Logout" />
</form>
{% else %}
<form action="/qa/login/" id="login">
<input type="submit" value="Login" />
</form>
<form action="/qa/register/">
<input type="submit" value="Register" />
</form>
{% endif %}
<form action="/qa/ask/" id="ask">
<input type="submit" value="Ask" />
</form>
<form action="/qa/" method="get" id="search">
<input type="text" name="keyword" id="keyword" />
<input type="submit" value="Search"> </input>
</form>
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
{% if post_list %}
<table class="table-hover">
<tr>
<th>
<form action="/qa/" method="get">
<input type="text" name="vote_count" id="vote_count" value="vote_count" style="display:none;" class="table-submit"/>
<input type="submit" value="Vote Count" class="table-submit" />
</form>
</th>
<th>Post</th>
<th>Author</th>
<th>
<form action="/qa/" method="get">
<input type="text" name="pub_date" id="pub_date" value="pub_date" style="display:none;" class="table-submit"/>
<input type="submit" value="Submission Date" class="table-submit" />
</form>
</th>
</tr>
{% for post in post_list %}
<tr>
<td>{{post.vote_count}}</td>
<td><a href="/qa/{{ post.id }}/">{{ post.post_text }}</a></td>
<td>{{post.author}}</td>
<td>{{post.pub_date}}</td>
</tr>
{% endfor %}
</tr>
</table>
<!-- <div class="pagination"> -->
<ul class="pager">
{% if post_list.has_previous %}
<li class="previous"><a href="?page={{ post_list.previous_page_number }}">previous</a></li>
{% endif %}
<li class="current">
Page {{ post_list.number }} of {{ post_list.paginator.num_pages }}.
</li>
{% if post_list.has_next %}
<li class="next"><a href="?page={{ post_list.next_page_number }}">next</a></li>
{% endif %}
</ul>
<!-- </div> -->
{% else %}
<p>No posts are available.</p>
{% endif %}
{% current_time "%Y-%m-%d %I:%M %p" as the_time %}
<br>
</div>
</label>The time is {{ the_time }}.</label>
</body>
</html>