From 90c21da8aad3237f0e9ce39a8b7d05e7bf435ed7 Mon Sep 17 00:00:00 2001 From: Ofir Matasas Date: Sun, 17 Apr 2022 18:55:58 +0300 Subject: [PATCH] Adding sidebar to base_template with profile image When the user is logged into Hotails, they'll see their profile picture, and their nickname in every page on Hotails. Signed-off-by: Ofir Matasas --- main/templates/main/base_template.html | 25 +++++++++++++++++++++---- main/templates/main/homepage.html | 4 ++-- main/views.py | 18 +++++++++++++++++- static/css/sidebar.css | 18 ++++++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 static/css/sidebar.css diff --git a/main/templates/main/base_template.html b/main/templates/main/base_template.html index 1744b6f..a4dd933 100644 --- a/main/templates/main/base_template.html +++ b/main/templates/main/base_template.html @@ -12,14 +12,14 @@ - + {% block stylesheets %} {% endblock %}
- {% block content %} - {% endblock %} +
+
+ {% if user.is_authenticated %} +
+ {{ name }} image +
+
+
{{ name }}
+
+
+
+ {% endif %} +
+
+ {% block content %} + {% endblock %} +
+
+ \ No newline at end of file diff --git a/main/templates/main/homepage.html b/main/templates/main/homepage.html index 73cda6a..9c6e677 100644 --- a/main/templates/main/homepage.html +++ b/main/templates/main/homepage.html @@ -2,8 +2,8 @@ {% load static %} {% block stylesheets %} - - + +