Highlight selected tab in administration panel

This commit is contained in:
Kumi 2019-01-16 09:27:33 +01:00
parent fc10a45eef
commit e62c63a103
2 changed files with 13 additions and 1 deletions

View file

@ -5,7 +5,7 @@
<p><b>Organization:</b> {{ organization }}</p>
<p><b>User:</b> {{ user.first_name }} {{ user.last_name }} ({{ user.username }})</p>
<div align="center"><b>Manage:</b> <a href="#" onclick="showdevices();">Devices</a> &dash; <a href="#" onclick="showwifi();">WiFi</a>{% if user.is_staff %} &dash; <a href="#" onclick="showusers();">Users</a>{% endif %}</div>
<div align="center"><b>Manage:</b> <a id="linkdevices" href="#" onclick="showdevices();">Devices</a> &dash; <a id="linkwifi" href="#" onclick="showwifi();">WiFi</a>{% if user.is_staff %} &dash; <a id="linkusers" href="#" onclick="showusers();">Users</a>{% endif %}</div>
<div name="devicespart" id="devicespart">
<h2>Devices</h2>

View file

@ -70,18 +70,30 @@ function showdevices() {
$("#devicespart").show();
$("#wifipart").hide();
$("#userpart").hide();
$("#linkdevices").css("font-weight", "bold");
$("#linkwifi").css("font-weight", "normal");
$("#linkusers").css("font-weight", "normal");
};
function showwifi() {
$("#devicespart").hide();
$("#wifipart").show();
$("#userpart").hide();
$("#linkdevices").css("font-weight", "normal");
$("#linkwifi").css("font-weight", "bold");
$("#linkusers").css("font-weight", "normal");
};
function showusers() {
$("#devicespart").hide();
$("#wifipart").hide();
$("#userpart").show();
$("#linkdevices").css("font-weight", "normal");
$("#linkwifi").css("font-weight", "normal");
$("#linkusers").css("font-weight", "bold");
};
showdevices();