UI: Implement web-assets v2 component nav-pills #93592

Merged
Márton Lente merged 3 commits from ui/web-assets-component-nav-pills into main 2024-09-27 11:24:25 +02:00
3 changed files with 26 additions and 49 deletions

View File

@ -375,34 +375,6 @@ form
position: relative
top: calc(var(--border-width) * -1)
// TODO: Move to web-assets. This is copied over from Extensions.
.nav-pills
@extend .dropdown-menu
box-shadow: none
display: block
position: relative
.nav-pills-item
@extend .dropdown-item
+margin(1, bottom)
white-space: normal
&.active
background-color: var(--color-accent-bg)
+fw-normal
&:last-child
+margin(0, bottom)
.nav-pills-divider
@extend .dropdown-divider
+margin(0, top)
+margin(1, bottom)
/* Larger icons */
i.icon.icon-lg
svg

View File

@ -1,4 +1,7 @@
<a class="nav-pills-item {% if url_match == request.path %}active{% endif %}" href="{% url url %}">
{% if icon %}<i class="{{ icon }}"></i>{% endif %}
{% if icon %}
<i class="{{ icon }}"></i>
{% endif %}
{{ title }}
</a>

View File

@ -43,15 +43,17 @@
<div class="row">
{% block sidebar %}
<div class="col-md-3">
<nav class="box p-2 mb-3">
<div class="nav-drawer-body">
<div class="nav nav-pills flex-column" role="tablist" aria-orientation="vertical">
<nav aria-orientation="vertical" class="flex-column mb-3 nav nav-pills" role="tablist">
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:index" title="Home" url_match="/" icon="i-home" %}
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:profile" title="Profile" url_match="/settings/profile" icon="i-user" %}
<div class="nav-pills-divider"></div>
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:active_sessions" title="Sessions" url_match="/active-sessions" icon="i-activity" %}
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:auth_tokens" title="Authenticated Apps" url_match="/applications" icon="i-link" %}
{% if user.bid_main_oauth2application.count %}
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:developer_applications" title="Developer Apps" url_match="/developer/applications" icon="i-code" %}
{% endif %}
@ -61,10 +63,10 @@
{% if show_mfa %}
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:mfa" title="Multi-factor Authentication" url_match="/settings/profile" icon="i-shield" %}
{% endif %}
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:password_change" title="Password" url_match="/change" icon="i-shield" %}
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:password_change" title="Password" url_match="/change" icon="i-asterisk" %}
{% include "bid_main/components/sidebar_nav_item.html" with url="bid_main:delete_user" title="Delete Account" url_match="/delete-my-account" icon="i-trash" %}
</div>
</div>
</nav>
</div>
{% endblock %}