-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
803b6e2
commit 90c21da
Showing
4 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,14 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> | ||
|
||
<link rel="stylesheet" href="{% static 'css/sidebar.css' %}"> | ||
{% block stylesheets %} | ||
{% endblock %} | ||
</head> | ||
<header> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-dark"> | ||
<a class="navbar-brand" href="..\"> | ||
<img src="..\..\..\static\images\Hotails-logo-smaller.png" style="width:50px; height:50px;" class="d-inline-block align-top" loading="lazy"></a> | ||
<img src="{% static 'images/Hotails-logo-smaller.png' %}" style="width:50px; height:50px;" class="d-inline-block align-top" loading="lazy"></a> | ||
<button class="navbar-toggler" type="button" data-target="#navbarText" | ||
aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation"> | ||
</button> | ||
|
@@ -41,8 +41,25 @@ | |
</header> | ||
|
||
<body> | ||
{% block content %} | ||
{% endblock %} | ||
<div class="row"> | ||
<div class="col-3 col-lg-1 bg-dark"> | ||
{% if user.is_authenticated %} | ||
<div class="card"> | ||
<img src="{{ profile_picture_url }}" alt="{{ name }} image" class="card-img-top sidebar-profile-img"> | ||
<div class="card-body"> | ||
<div style="display: flex; flex-direction: row"> | ||
<h5 class="card-title">{{ name }}</h5> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
<div class="col-9 col-lg-11"> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
</div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.sidebar-profile-img | ||
{ | ||
border-radius: 50%; | ||
height: 12rem; | ||
} | ||
|
||
.card | ||
{ | ||
background-color: #2e2e2e; | ||
color: white; | ||
height: 100%; | ||
width: 108%; | ||
} | ||
|
||
.card-title | ||
{ | ||
font-size: xx-large; | ||
} |