From e09e0a5405756e40b02a1bd8ca39a42fb4609f6e Mon Sep 17 00:00:00 2001 From: Eligiusz Kurzawa Date: Wed, 13 Jan 2021 19:01:13 +0100 Subject: [PATCH] 12# added dropdown menu --- templates/base.html | 55 +++++++++++++++++++++++++++++++++++++++------ users/models.py | 3 +++ 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/templates/base.html b/templates/base.html index fe141c8..f7ba21c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,7 +4,7 @@ - JobPortal - Free Bootstrap 4 Template by Colorlib + JobPortal @@ -28,6 +28,8 @@ + + @@ -45,10 +47,40 @@ {% if not user.is_authenticated %} - - + + + {% endif %} + {% if user.is_authenticated and user.is_employee %} +
+ + +
+ {% endif %} + {% if user.is_authenticated and user.is_employer %} +
+ + +
{% endif %} - @@ -56,9 +88,11 @@ {% block content %} -{% endblock %} -
+ {% endblock %} + + +
@@ -168,6 +202,13 @@ + {% if user.is_authenticated and user.is_employee %} + + {% else %} + + {% endif %} + + - \ No newline at end of file + diff --git a/users/models.py b/users/models.py index 38479da..3e71cf8 100644 --- a/users/models.py +++ b/users/models.py @@ -50,6 +50,9 @@ class Account(AbstractBaseUser, PermissionsMixin): verbose_name = _('user') verbose_name_plural = _('users') + def get_profile_id(self): + return self.profile.id + class Profile(models.Model): user = models.OneToOneField(Account, on_delete=models.CASCADE, related_name="profile")