Skip to content

Commit 4222dde

Browse files
committed
INTEGRITY: Improve homepage navbar.
1 parent 5e4627b commit 4222dde

File tree

5 files changed

+249
-68
lines changed

5 files changed

+249
-68
lines changed

fileset.py

Lines changed: 67 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
url_for,
66
render_template_string,
77
jsonify,
8+
render_template,
89
)
910
import pymysql.cursors
1011
import json
@@ -32,37 +33,12 @@
3233

3334
@app.route("/")
3435
def index():
35-
html = """
36-
<!DOCTYPE html>
37-
<html>
38-
<head>
39-
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
40-
</head>
41-
<body>
42-
<nav style="position: fixed; top: 0; left: 0; right: 0; background: white; padding: 3px; border-bottom: 1px solid #ccc;">
43-
<a href="{{ url_for('index') }}">
44-
<img src="{{ url_for('static', filename='integrity_service_logo_256.png') }}" alt="Logo" style="height:60px; vertical-align:middle;">
45-
</a>
46-
</nav>
47-
<h1 style="margin-top: 80px;">Fileset Database</h1>
48-
<h2>Fileset Actions</h2>
49-
<ul>
50-
<li><a href="{{ url_for('fileset') }}">Fileset</a></li>
51-
<li><a href="{{ url_for('user_games_list') }}">User Games List</a></li>
52-
<li><a href="{{ url_for('ready_for_review') }}">Ready for review</a></li>
53-
<li><a href="{{ url_for('fileset_search') }}">Fileset Search</a></li>
54-
</ul>
55-
<h2>Logs</h2>
56-
<ul>
57-
<li><a href="{{ url_for('logs') }}">Logs</a></li>
58-
</ul>
59-
<form action="{{ url_for('clear_database') }}" method="POST">
60-
<button style="margin:100px 0 0 0; background-color:red" type="submit"> Clear Database </button>
61-
</form>
62-
</body>
63-
</html>
64-
"""
65-
return render_template_string(html)
36+
return redirect(url_for("logs"))
37+
38+
39+
@app.route("/home")
40+
def home():
41+
return render_template("home.html")
6642

6743

6844
@app.route("/clear_database", methods=["POST"])
@@ -148,10 +124,18 @@ def fileset():
148124
<link rel="stylesheet" type="text/css" href="{{{{ url_for('static', filename='style.css') }}}}">
149125
</head>
150126
<body>
151-
<nav style="position: fixed; top: 0; left: 0; right: 0; background: white; padding: 3px; border-bottom: 1px solid #ccc;">
152-
<a href="{{{{ url_for('index') }}}}">
153-
<img src="{{{{ url_for('static', filename='integrity_service_logo_256.png') }}}}" alt="Logo" style="height:60px; vertical-align:middle;">
154-
</a>
127+
<nav>
128+
<div class="logo">
129+
<a href="{{{{ url_for('home') }}}}">
130+
<img src="{{{{ url_for('static', filename='integrity_service_logo_256.png') }}}}" alt="Logo">
131+
</a>
132+
</div>
133+
<div class="nav-buttons">
134+
<a href="{{{{ url_for('user_games_list') }}}}">User Games List</a>
135+
<a href="{{{{ url_for('ready_for_review') }}}}">Ready for review</a>
136+
<a href="{{{{ url_for('fileset_search') }}}}">Fileset Search</a>
137+
<a href="{{{{ url_for('logs') }}}}">Logs</a>
138+
</div>
155139
</nav>
156140
<h2 style="margin-top: 80px;"><u>Fileset: {id}</u></h2>
157141
<table>
@@ -501,10 +485,18 @@ def merge_fileset(id):
501485
<link rel="stylesheet" type="text/css" href="{{{{ url_for('static', filename='style.css') }}}}">
502486
</head>
503487
<body>
504-
<nav style="position: fixed; top: 0; left: 0; right: 0; background: white; padding: 3px; border-bottom: 1px solid #ccc;">
505-
<a href="{{{{ url_for('index') }}}}">
506-
<img src="{{{{ url_for('static', filename='integrity_service_logo_256.png') }}}}" alt="Logo" style="height:60px; vertical-align:middle;">
507-
</a>
488+
<nav>
489+
<div class="logo">
490+
<a href="{{{{ url_for('home') }}}}">
491+
<img src="{{{{ url_for('static', filename='integrity_service_logo_256.png') }}}}" alt="Logo">
492+
</a>
493+
</div>
494+
<div class="nav-buttons">
495+
<a href="{{{{ url_for('user_games_list') }}}}">User Games List</a>
496+
<a href="{{{{ url_for('ready_for_review') }}}}">Ready for review</a>
497+
<a href="{{{{ url_for('fileset_search') }}}}">Fileset Search</a>
498+
<a href="{{{{ url_for('logs') }}}}">Logs</a>
499+
</div>
508500
</nav>
509501
<h2 style="margin-top: 80px;">Search Results for '{search_query}'</h2>
510502
<form method="POST">
@@ -540,10 +532,18 @@ def merge_fileset(id):
540532
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
541533
</head>
542534
<body>
543-
<nav style="position: fixed; top: 0; left: 0; right: 0; background: white; padding: 3px; border-bottom: 1px solid #ccc;">
544-
<a href="{{ url_for('index') }}">
545-
<img src="{{ url_for('static', filename='integrity_service_logo_256.png') }}" alt="Logo" style="height:60px; vertical-align:middle;">
546-
</a>
535+
<nav>
536+
<div class="logo">
537+
<a href="{{ url_for('home') }}">
538+
<img src="{{ url_for('static', filename='integrity_service_logo_256.png') }}" alt="Logo">
539+
</a>
540+
</div>
541+
<div class="nav-buttons">
542+
<a href="{{ url_for('user_games_list') }}">User Games List</a>
543+
<a href="{{ url_for('ready_for_review') }}">Ready for review</a>
544+
<a href="{{ url_for('fileset_search') }}">Fileset Search</a>
545+
<a href="{{ url_for('logs') }}">Logs</a>
546+
</div>
547547
</nav>
548548
<h2 style="margin-top: 80px;">Search Fileset to Merge</h2>
549549
<form method="POST">
@@ -599,10 +599,18 @@ def possible_merge_filesets(id):
599599
<link rel="stylesheet" type="text/css" href="{{{{ url_for('static', filename='style.css') }}}}">
600600
</head>
601601
<body>
602-
<nav style="position: fixed; top: 0; left: 0; right: 0; background: white; padding: 3px; border-bottom: 1px solid #ccc;">
603-
<a href="{{{{ url_for('index') }}}}">
604-
<img src="{{{{ url_for('static', filename='integrity_service_logo_256.png') }}}}" alt="Logo" style="height:60px; vertical-align:middle;">
605-
</a>
602+
<nav>
603+
<div class="logo">
604+
<a href="{{{{ url_for('home') }}}}">
605+
<img src="{{{{ url_for('static', filename='integrity_service_logo_256.png') }}}}" alt="Logo">
606+
</a>
607+
</div>
608+
<div class="nav-buttons">
609+
<a href="{{{{ url_for('user_games_list') }}}}">User Games List</a>
610+
<a href="{{{{ url_for('ready_for_review') }}}}">Ready for review</a>
611+
<a href="{{{{ url_for('fileset_search') }}}}">Fileset Search</a>
612+
<a href="{{{{ url_for('logs') }}}}">Logs</a>
613+
</div>
606614
</nav>
607615
<h2 style="margin-top: 80px;">Possible Merges for fileset-'{id}'</h2>
608616
<table>
@@ -731,10 +739,18 @@ def highlight_differences(source, target):
731739
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
732740
</head>
733741
<body>
734-
<nav style="position: fixed; top: 0; left: 0; right: 0; background: white; padding: 3px; border-bottom: 1px solid #ccc;">
735-
<a href="{{ url_for('index') }}">
736-
<img src="{{ url_for('static', filename='integrity_service_logo_256.png') }}" alt="Logo" style="height:60px; vertical-align:middle;">
737-
</a>
742+
<nav>
743+
<div class="logo">
744+
<a href="{{ url_for('home') }}">
745+
<img src="{{ url_for('static', filename='integrity_service_logo_256.png') }}" alt="Logo">
746+
</a>
747+
</div>
748+
<div class="nav-buttons">
749+
<a href="{{ url_for('user_games_list') }}">User Games List</a>
750+
<a href="{{ url_for('ready_for_review') }}">Ready for review</a>
751+
<a href="{{ url_for('fileset_search') }}">Fileset Search</a>
752+
<a href="{{ url_for('logs') }}">Logs</a>
753+
</div>
738754
</nav>
739755
<h2 style="margin-top: 80px;">Confirm Merge</h2>
740756
<form id="confirm_merge_form">

index.html

Lines changed: 0 additions & 2 deletions
This file was deleted.

pagination.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,18 @@ def create_page(
144144
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
145145
</head>
146146
<body>
147-
<nav style="position: fixed; top: 0; left: 0; right: 0; background: white; padding: 3px; border-bottom: 1px solid #ccc;">
148-
<a href="{{ url_for('index') }}">
149-
<img src="{{ url_for('static', filename='integrity_service_logo_256.png') }}" alt="Logo" style="height:60px; vertical-align:middle;">
150-
</a>
147+
<nav>
148+
<div class="logo">
149+
<a href="{{ url_for('home') }}">
150+
<img src="{{ url_for('static', filename='integrity_service_logo_256.png') }}" alt="Logo">
151+
</a>
152+
</div>
153+
<div class="nav-buttons">
154+
<a href="{{ url_for('user_games_list') }}">User Games List</a>
155+
<a href="{{ url_for('ready_for_review') }}">Ready for review</a>
156+
<a href="{{ url_for('fileset_search') }}">Fileset Search</a>
157+
<a href="{{ url_for('logs') }}">Logs</a>
158+
</div>
151159
</nav>
152160
<form id='filters-form' method='GET' onsubmit='remove_empty_inputs()'>
153161
<table style="margin-top: 80px;">

static/style.css

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,34 @@
33
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
44
}
55

6-
td, th {
6+
td,
7+
th {
78
padding-inline: 5px;
89
}
910

10-
tr:nth-child(even) {background-color: #f2f2f2;}
11-
tr {background-color: white;}
11+
tr:nth-child(even) {
12+
background-color: #f2f2f2;
13+
}
14+
15+
tr {
16+
background-color: white;
17+
}
18+
19+
tr:hover {
20+
background-color: #ddd;
21+
}
22+
23+
tr.games_list:hover {
24+
cursor: pointer;
25+
}
1226

13-
tr:hover {background-color: #ddd;}
14-
tr.games_list:hover {cursor: pointer;}
27+
tr.filter:hover {
28+
background-color: inherit;
29+
}
1530

16-
tr.filter:hover {background-color:inherit;}
17-
td.filter {text-align: center;}
31+
td.filter {
32+
text-align: center;
33+
}
1834

1935
th {
2036
padding-top: 5px;
@@ -26,7 +42,38 @@ th {
2642

2743
th a {
2844
color: white;
29-
text-decoration: none; /* no underline */
45+
text-decoration: none;
46+
/* no underline */
47+
}
48+
49+
nav {
50+
position: fixed;
51+
top: 0;
52+
left: 0;
53+
right: 0;
54+
border-bottom: 1px solid #ccc;
55+
background-color: white;
56+
display: flex;
57+
padding: 0px 20px 0px 20px;
58+
align-items: center;
59+
flex-wrap: wrap;
60+
z-index: 1000;
61+
}
62+
63+
.nav-buttons a {
64+
text-decoration: none;
65+
padding: 10px 16px;
66+
border-radius: 6px;
67+
margin-left: 10px;
68+
}
69+
70+
/* .nav-buttons a:hover {
71+
box-shadow: 0 4px 12px rgba(39, 145, 232, 0.4);
72+
} */
73+
74+
.logo img {
75+
height: 75px;
76+
vertical-align: middle;
3077
}
3178

3279
button {
@@ -39,8 +86,11 @@ button {
3986
}
4087

4188
button:hover {
42-
background-color: #29afe0;
89+
background-color: #1f7fc4;
90+
color: #f2f2f2;
91+
box-shadow: 0 4px 12px rgba(39, 145, 232, 0.4);
4392
}
93+
4494
button:active {
4595
background-color: #1a95c2;
4696
}
@@ -55,13 +105,17 @@ input[type=submit] {
55105
}
56106

57107
input[type=submit]:hover {
58-
background-color: #29afe0;
108+
background-color: #1f7fc4;
109+
color: #f2f2f2;
110+
box-shadow: 0 4px 12px rgba(39, 145, 232, 0.4);
59111
}
112+
60113
input[type=submit]:active {
61114
background-color: #1a95c2;
62115
}
63116

64-
input[type=text], select {
117+
input[type=text],
118+
select {
65119
width: 25%;
66120
height: 38px;
67121
padding: 6px 12px;

0 commit comments

Comments
 (0)