Skip to content

Commit

Permalink
Fix dropdown menues Closes #73
Browse files Browse the repository at this point in the history
In dropdown menues change href='#' to href='javascript:void(0)' so
dropdowns works with the current moodle version and bootstrap
  • Loading branch information
klarer committed May 15, 2017
1 parent b29fc17 commit f6c0721
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
25 changes: 13 additions & 12 deletions templates/course_detail.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,15 @@
</div>

<div>
<ul class="nav nav-tabs nav-justified" id = "myTabs" role="tablist">
<ul class="nav nav-tabs nav-justified" id = "{{uniqid}}-myTabs" role="tablist">
<li class="nav-item active"><a class = "nav-link" data-toggle="tab" href="#CoursePill_1" role = "tab">{{#str}}enrolledusers, enrol{{/str}}</a></li>
<li class = "nav-item"><a class = "nav-link" data-toggle="tab" href="#CoursePill_2" role = "tab">{{#str}}activities{{/str}}</a></li>
<li class = 'dropdown'>
<a class = "dropdown-toggle" href="#" data-toggle="dropdown">{{#str}}roles{{/str}}</a>
<li class = "dropdown">
<a class = "dropdown-toggle" href='javascript:void(0)' data-toggle="dropdown">{{#str}}roles{{/str}}</a>
<ul class="dropdown-menu" id="roledropdown">
<!--filter user list by selecting wanted role-->
{{#rolesincourse}}
<li><input type="checkbox" value="{{{.}}}" name="rolesincourse" id="rolesincourse"> {{{.}}}</li> <!--filter user list by selecting wanted role-->
<li><input type="checkbox" value="{{{.}}}" name="rolesincourse" id="rolesincourse">{{{.}}}</li>
{{/rolesincourse}}
</ul>
</li>
Expand All @@ -215,14 +216,14 @@
<div id="CoursePill_1" class="tab-pane active" role="tabpanel">
<!--table of users in this course-->
<div class="table-responsive">
<table class = "table-condensed table-hover table-striped" id = "{{uniqid}}-userincourse" cellspacing="0" width="100%">
<table class = "table table-striped table-hover" id = "{{uniqid}}-userincourse" cellspacing="0" width="100%">
<thead>
<tr>
<th>ID {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}username{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}firstname{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}lastname{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}roles{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>ID</th>
<th>{{#str}}username{{/str}} </th>
<th>{{#str}}firstname{{/str}} </th>
<th>{{#str}}lastname{{/str}} </th>
<th>{{#str}}roles{{/str}} </th>
</tr>
</thead>
<tbody>
Expand All @@ -243,7 +244,7 @@
<div id="CoursePill_2" class="tab-pane fade" role="tabpanel">
<!--table of activites in this course-->
<div class="table-responsive">
<table class = "table-condensed table-hover table-striped" id = "{{uniqid}}-activityInCourse" cellspacing="0" width="100%">
<table class = "stripe hover row-border compact" id = "{{uniqid}}-activityInCourse" cellspacing="0" width="100%">
<thead>
<tr>
<th>{{#str}}sectionname{{/str}}</th>
Expand Down Expand Up @@ -282,7 +283,7 @@
//selecting the active table by using click-Event
tabTableID = "#{{uniqid}}-userincourse";
$('#myTabs a').click(function(e){
$('#{{uniqid}}-myTabs a').click(function(e){
var activeTab = e.target.getAttribute('href');
if(activeTab == "#CoursePill_1"){
tabTableID = "#{{uniqid}}-userincourse";
Expand Down
18 changes: 9 additions & 9 deletions templates/user_detail.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,18 @@


<div>
<ul class="nav nav-tabs nav-justified" id = "myTabs2" >
<ul class="nav nav-tabs nav-justified">
<li class = "nav-item"><a><b>{{#str}}courses{{/str}}</b></a></li>
<li class="dropdown">
<a class = "dropdown-toggle" href="#" data-toggle="dropdown">{{#str}}department{{/str}}</a>
<a class = "dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown">{{#str}}department{{/str}}</a>
<ul class="dropdown-menu" id="departmentdropdown">
{{#uniquecategoryname}}
<li><input type="checkbox" value="{{{.}}}" name="departmentradios" id="departmentradios"> {{{.}}}</li><!--filter course list by selecting wanted parent-->
{{/uniquecategoryname}}
</ul>
</li>
<li class="dropdown">
<a class = "dropdown-toggle" href="#" data-toggle="dropdown">{{#str}}semester, tool_supporter{{/str}}</a>
<a class = "dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown">{{#str}}semester, tool_supporter{{/str}}</a>
<ul class="dropdown-menu" id="semesterdropdown">
{{#uniqueparentcategory}}
<li><input type="checkbox" value="{{{.}}}" name="semesterradios" id="semesterradios"> {{{.}}}</li> <!--filter course list by selecting wanted grand parent-->
Expand All @@ -250,15 +250,15 @@
</div>

<div class="table-responsive">
<table class = "table-condensed table-hover table-striped" id="{{uniqid}}-userdetailcourses">
<table class = "stripe hover row-border compact" id="{{uniqid}}-userdetailcourses" cellspacing="0" width="100%">
<thead>
<tr>
<th>ID</th>
<th>{{#str}}fullnamecourse{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}department{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}roles{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}semester, tool_supporter{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}visible{{/str}} {{#pix}} t/sort, core, {{#str}}sort{{/str}} {{/pix}}</th>
<th>{{#str}}fullnamecourse{{/str}} </th>
<th>{{#str}}department{{/str}} </th>
<th>{{#str}}roles{{/str}} </th>
<th>{{#str}}semester, tool_supporter{{/str}} </th>
<th>{{#str}}visible{{/str}} </th>
</tr>
</thead>
<tbody>
Expand Down

0 comments on commit f6c0721

Please sign in to comment.