From 651e709e46e95f6d8a197a6ee19af5028b007edf Mon Sep 17 00:00:00 2001
From: jakobsn
Date: Tue, 29 Oct 2019 15:30:31 +0100
Subject: [PATCH] Add navbar
---
.../4a7a69f1d0514a515600940b77084078a78239fd | 3 ++
src/app/static/stylesheet.css | 39 ++++++++++++++++++-
src/app/templates/guestbook.html | 10 +++--
src/app/templates/index.html | 12 ++----
src/app/templates/login.html | 38 +++++++++++-------
src/app/templates/register.html | 5 ++-
src/app/utils.py | 15 +++++++
src/app/views.py | 20 +++++++---
8 files changed, 108 insertions(+), 34 deletions(-)
create mode 100644 src/app/sessions/4a7a69f1d0514a515600940b77084078a78239fd
create mode 100644 src/app/utils.py
diff --git a/src/app/sessions/4a7a69f1d0514a515600940b77084078a78239fd b/src/app/sessions/4a7a69f1d0514a515600940b77084078a78239fd
new file mode 100644
index 0000000..71583e4
--- /dev/null
+++ b/src/app/sessions/4a7a69f1d0514a515600940b77084078a78239fd
@@ -0,0 +1,3 @@
+gAN9cQAoWAoAAABzZXNzaW9uX2lkcQFYKAAAADRhN2E2OWYxZDA1MTRhNTE1NjAwOTQwYjc3MDg0
+MDc4YTc4MjM5ZmRxAlgIAAAAdXNlcm5hbWVxA1gBAAAAYXEEWAIAAABpcHEFWAkAAAAxMjcuMC4w
+LjFxBnUu
diff --git a/src/app/static/stylesheet.css b/src/app/static/stylesheet.css
index 4f14609..692858e 100644
--- a/src/app/static/stylesheet.css
+++ b/src/app/static/stylesheet.css
@@ -1,7 +1,8 @@
body {
background-color: lightblue;
display: flex; /* or inline-flex */
- flex-direction: column
+ flex-direction: column;
+ margin: 0;
}
h1 {
@@ -10,4 +11,40 @@ h1 {
img {
margin: auto;
+}
+
+nav {
+ margin-bottom: 10px;
+}
+
+nav li {
+ float: left;
+}
+
+nav li a {
+ display: block;
+ color: white;
+ text-align: center;
+ padding: 20px 16px;
+ text-decoration: none;
+}
+
+nav li a:hover {
+ background-color: lightskyblue;
+}
+
+nav ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ background-color: gray;
+}
+
+#title {
+ display: block;
+ color: white;
+ text-align: center;
+ padding: 14px 16px;
+ text-decoration: none;
}
\ No newline at end of file
diff --git a/src/app/templates/guestbook.html b/src/app/templates/guestbook.html
index 4bea4b5..09747d0 100644
--- a/src/app/templates/guestbook.html
+++ b/src/app/templates/guestbook.html
@@ -1,4 +1,4 @@
-$def with (entries, guestbook_form)
+$def with (nav, entries, guestbook_form)
Friends
@@ -8,6 +8,9 @@ $def with (entries, guestbook_form)
+
+ $:nav
+
Guestbook
$for entry in entries:
@@ -23,6 +26,5 @@ $def with (entries, guestbook_form)
$:guestbook_form.render()
-
- Home
-
\ No newline at end of file
+
- Beelance2
-
-
+ $:nav
-
-
- - Register!
-
- - Guestbook
+
+
+ $:nav
+
+ Log In
+
+
+ $if session.username:
+ Logged in as $session.username
+
+ Registered friends:
+
+ $for user in friends:
+ $user[1]
+
+
+
+
+ $:nav
+
Become a friend!
+
\ No newline at end of file
diff --git a/src/app/templates/index.html b/src/app/templates/index.html
index b9ff4e5..0a11129 100644
--- a/src/app/templates/index.html
+++ b/src/app/templates/index.html
@@ -1,4 +1,4 @@
-
+$def with (nav)
Beelance2
Friends
@@ -8,16 +8,10 @@
\ No newline at end of file
diff --git a/src/app/templates/login.html b/src/app/templates/login.html
index 2c0b45c..8f369e5 100644
--- a/src/app/templates/login.html
+++ b/src/app/templates/login.html
@@ -1,16 +1,28 @@
-$def with (login_form, friends)
+$def with (nav, login_form, friends)
-
Log In
-
+
+
Beelance2
+
+
-$if session.username:
-
Logged in as $session.username
- Logout
+
-
Registered friends:
-
- $for user in friends:
- $user[1]
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/app/templates/register.html b/src/app/templates/register.html
index fb01fe2..51644d8 100644
--- a/src/app/templates/register.html
+++ b/src/app/templates/register.html
@@ -1,4 +1,4 @@
-$def with (register_form)
+$def with (nav, register_form)
@@ -8,6 +8,9 @@ $def with (register_form)