Skip to content

Commit

Permalink
Merge pull request #55 from N5GEH/54-show-which-app-is-selected
Browse files Browse the repository at this point in the history
Show which app is selected
  • Loading branch information
djs0109 authored Oct 10, 2022
2 parents 9e50c53 + 0013abc commit 25139fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/Entirety/devices/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
DeviceCreateSubmitView,
DeviceEditSubmitView,
DeviceEditView,
DeviceDeleteView
DeviceDeleteView,
)

app_name = "devices"
Expand All @@ -15,7 +15,7 @@
path("edit", DeviceEditView.as_view(), name="edit"),
path("edit-submit", DeviceEditSubmitView.as_view(), name="edit-submit"),
path("create-submit", DeviceCreateSubmitView.as_view(), name="create_submit"),
path("list", DeviceListView.as_view(), name="list"),
path("", DeviceListView.as_view(), name="list"),
path("list-submit", DeviceListSubmitView.as_view(), name="list_submit"),
path("delete", DeviceDeleteView.as_view(), name="delete")
path("delete", DeviceDeleteView.as_view(), name="delete"),
]
5 changes: 4 additions & 1 deletion app/Entirety/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

const sidebarItems = document.querySelectorAll('.btn-sidebar');
[...sidebarItems].forEach(el => {
if (!el.classList.contains("hi-ignore")) {
if(el.getAttribute("href") === url){
el.classList.add("active")
}
else if (!el.classList.contains("hi-ignore")) {
let regEx = new RegExp(`^${el.getAttribute("href")}.*$`, "i")
if (regEx.test(url))
el.classList.add('active')
Expand Down
2 changes: 1 addition & 1 deletion app/Entirety/templates/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</li>

<li class="nav-item d-inline-flex {% if project %}mt-auto border-top{% else %} border-bottom {% endif %}">
<a href="{% url "projects:index" %}" class="nav-link btn-sidebar py-md-2"
<a href="{% url "projects:index" %}" class="nav-link btn-sidebar py-md-2 hi-ignore"
data-bs-toggle="tooltip" data-bs-placement="right" data-bs-custom-class="d-md-none"
title="Projects">
<i class="bi {% if project %}bi-arrow-left{% else %}bi-kanban{% endif %}"></i>
Expand Down

0 comments on commit 25139fe

Please sign in to comment.