Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
UI: Add toggling effect on buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
decon-harsh committed Sep 30, 2020
1 parent b58bc98 commit 0c4db04
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vms/administrator/templates/administrator/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block content %}
<div class="spacer"></div>
<ul class="nav nav-tabs">
<li class="active"><a href="{% url 'event:list' %}">{% trans "Events" %}</a></li>
<li class="active"><a class = "tabActive" href="{% url 'event:list' %}">{% trans "Events" %}</a></li>
<li class="active"><a href="{% url 'job:list' %}">{% trans "Jobs" %}</a></li>
<li class="active"><a href="{% url 'shift:list_jobs' %}">{% trans "Shifts" %}</a></li>
<li class="active"><a href="{% url 'organization:list' %}">{% trans "Organizations" %}</a></li>
Expand Down
7 changes: 6 additions & 1 deletion vms/vms/static/vms/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ body > .container {
border-color: #158cba;
}


/* Custom Css for administrator/settings.html */
ul.nav.nav-tabs li.active a.tabActive{
background-color: #158cba !important;
color: white !important;
border-radius: 8px !important;
}
/* Featurettes
------------------------- */

Expand Down
12 changes: 12 additions & 0 deletions vms/vms/static/vms/js/tabswitcher.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$(document).ready(function () {
$(function () {
$('.nav.nav-tabs li a.tabActive').removeClass('tabActive');
var current =location.pathname;
$('ul.nav.nav-tabs li.active a').each(function(){
var $this =$(this);
if($this.attr('href').indexOf(current) !== -1){
$this.addClass('tabActive');
}
});
});
});
1 change: 1 addition & 0 deletions vms/vms/templates/vms/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<script src="{% static "vms/js/load_city.js" %}"></script>
<script src="{% static "vms/js/load_state.js" %}"></script>
<script src="{% static "vms/js/hide_resume_textbox.js" %}"></script>
<script src="{% static "vms/js/tabswitcher.js" %}"></script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
Expand Down

0 comments on commit 0c4db04

Please sign in to comment.