Skip to content

Commit

Permalink
Add navbar item for repo management
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <[email protected]>
  • Loading branch information
keshav-space committed Jan 3, 2025
1 parent e14982e commit 1018fe7
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion fedcode/templates/navbar.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% load static %}

<nav class="navbar is-dark mb-6 border-bottom-radius" role="navigation" aria-label="main navigation">
<div class="navbar-brand ml-3">
<a class="navbar-item is-size-4 has-text-weight-bold" href="/">
Expand Down Expand Up @@ -33,15 +35,20 @@
</div>
</div>

{% if user.person %}
{% if user.person or user.service %}
<div class="navbar-item has-dropdown is-hoverable">
<div class="navbar-link is-arrowless">
<figure class="image is-32x32">
{% if user.service %}
<img src="{% static 'images/aboutcode_favicon-32x32.png' %}">
{% else %}
<img src="{{ user.person.avatar }}">
{% endif %}
</figure>
</div>

<div class="navbar-dropdown is-right mr-2">
{% if user.person %}
{% if request.path == '/users/@'|add:user.username %}
<a class="navbar-item is-active-light" href="{% url 'user-profile' user.username %}"
style="background-color: #dcdcdc;">
Expand All @@ -52,6 +59,28 @@
<strong>Profile</strong>
</a>
{% endif %}
{% endif %}
{% if user.service %}
{% if request.path == '/create-repo' %}
<a class="navbar-item is-active-light" href="{% url 'repo-create' %}" style="background-color: #dcdcdc;">
<strong>Add Repo</strong>
</a>
{% else %}
<a class="navbar-item" href="{% url 'repo-create' %}">
<strong>Add Repo</strong>
</a>
{% endif %}
{% if request.path == '/repo-list' %}
<a class="navbar-item is-active-light" href="{% url 'repo-list' %}" style="background-color: #dcdcdc;">
<strong>All Repo</strong>
</a>
{% else %}
<a class="navbar-item" href="{% url 'repo-list' %}">
<strong>All Repo</strong>
</a>
{% endif %}
{% endif %}

<a class="navbar-item has-text-danger" href="{% url 'logout' %}">
<strong>Log out</strong>
</a>
Expand Down

0 comments on commit 1018fe7

Please sign in to comment.