Skip to content

Commit b2eaccf

Browse files
committed
Allowing left tab to use glows as an option.
1 parent 29960dd commit b2eaccf

File tree

5 files changed

+162
-53
lines changed

5 files changed

+162
-53
lines changed

public/less/master_mixins.less

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,17 @@ input[type="color"]:focus,
585585
vertical-align: middle !important;
586586
}
587587
/*
588-
/////////////////////////////////////////////////////// Forums /////////////////////////////////////////////////////////
588+
/////////////////////////////////////////////////////// Glow /////////////////////////////////////////////////////////
589589
*/
590-
div.list-glow {
590+
div.list-glow-sm {
591+
div.list-glow-labels:first-child {
592+
margin-left: 5px !important;
593+
}
594+
ul.list-glow-group li div.list-glow-group-item {
595+
padding: 5px 0 5px 0px !important;
596+
}
597+
}
598+
div.list-glow, div.list-glow-sm {
591599
div.list-glow-labels {
592600
font-weight: bold;
593601
&:after, &:before {
@@ -625,6 +633,16 @@ div.list-glow {
625633
border: none;
626634
border-left: 6px solid @grey;
627635
vertical-align: baseline;
636+
&.active {
637+
div.list-glow-group-item {
638+
& > div {
639+
& > .badge {
640+
background: saturate(lighten(@primaryColor, 15%), 40%);
641+
box-shadow: 0 0 40px saturate(lighten(@primaryColor, 15%), 40%);
642+
}
643+
}
644+
}
645+
}
628646
.transition-duration(0.3s);
629647
a.block {
630648
display: block;
@@ -710,9 +728,17 @@ div.list-glow {
710728
&:after {
711729
clear: both;
712730
}
731+
& > div {
732+
& > .badge {
733+
float:right;
734+
& + .badge {
735+
margin-right: 5px;
736+
}
737+
}
738+
}
713739
}
714740
div.list-glow-group-item-sm {
715-
padding: 5px 0 5px 20px;
741+
padding: 5px 0 5px 0px;
716742
}
717743
}
718744
}

src/services/Utility/View/LeftTab.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class LeftTab {
3131
*/
3232
public $panels = null;
3333

34+
/**
35+
* Whether to use the list-glow view
36+
*/
37+
public $glow = false;
38+
3439
/**
3540
* When the class is constructed assign a new collection to
3641
* the panels var.
@@ -109,6 +114,19 @@ public function setCollapsable($collapasable)
109114
return $this;
110115
}
111116

117+
/**
118+
* Set the panels to use list-glow
119+
*
120+
* @param bool $glow
121+
* @return LeftTab
122+
*/
123+
public function setGlow($glow)
124+
{
125+
$this->glow = (bool) $glow;
126+
127+
return $this;
128+
}
129+
112130
/**
113131
* Build the left tab helper.
114132
*
@@ -121,6 +139,10 @@ public function make()
121139
$this->setDefaultTab($this->panels->tabs->first()->id);
122140
}
123141

124-
\CoreView::setRoute('helpers.lefttab')->addData('settings', $this);
142+
if ($this->glow) {
143+
\CoreView::setRoute('helpers.lefttabglow')->addData('settings', $this);
144+
} else {
145+
\CoreView::setRoute('helpers.lefttab')->addData('settings', $this);
146+
}
125147
}
126148
}

src/views/helpers/lefttab.blade.php

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,20 @@
88
<div class="panel panel-default">
99
@if ($settings->collapasable == false)
1010
<div class="panel-heading">{{ $panel->title }}</div>
11-
<div class="list-glow">
12-
<ul class="list-glow-group no-header">
11+
<ul class="list-group">
1312
@else
1413
<div class="panel-heading" onClick="collapse('{{ $panel->id }}');">{{ $panel->title }}</div>
15-
<div class="list-glow">
16-
<ul class="list-glow-group no-header" id="{{ $panel->id }}" style="{{ !Session::get('COLLAPSE_'. $panel->id) ? 'display: none;' : null }}">
14+
<ul class="list-group" id="{{ $panel->id }}" style="{{ !Session::get('COLLAPSE_'. $panel->id) ? 'display: none;' : null }}">
1715
@endif
1816
@foreach ($panel->tabs as $tab)
19-
<li id="{{ $tab->id }}_tab">
20-
<div class="list-glow-group-item list-glow-group-item-sm">
21-
<div class="col-md-12">
22-
@if (isset($tab->options['badge']))
23-
<span class="badge">{{ $tab->options['badge'] }}</span>
24-
@endif
25-
<a href="javascript: void(0);" class="ajaxLink block" id="{{ $tab->id }}" data-location="{{ $tab->path }}">
26-
{{ ucwords($tab->title) }}
27-
</a>
28-
</div>
29-
</div>
17+
<li class="list-group-item">
18+
@if (isset($tab->options['badge']))
19+
<span class="badge">{{ $tab->options['badge'] }}</span>
20+
@endif
21+
<a href="javascript: void(0);" class="ajaxLink" id="{{ $tab->id }}" data-location="{{ $tab->path }}">{{ ucwords($tab->title) }}</a>
3022
</li>
3123
@endforeach
32-
</ul>
33-
</div>
24+
</ul>
3425
</div>
3526
@endforeach
3627
</div>
@@ -47,18 +38,18 @@
4738
var parts = url.split('#');
4839
4940
if (parts[1] != null) {
50-
$('#'+ parts[1] +'_tab').addClass('active');
41+
$('#'+ parts[1]).parent().addClass('active');
5142
$('#ajaxContent').html('{{ $settings->loadingIcon }}');
5243
$('#ajaxContent').load($('#'+ parts[1]).attr('data-location'));
5344
} else {
54-
$('#{{ $settings->defaultTab }}_tab').addClass('active');
45+
$('#{{ $settings->defaultTab }}').parent().addClass('active');
5546
$('#ajaxContent').html('{{ $settings->loadingIcon }}');
5647
$('#ajaxContent').load($('#{{ $settings->defaultTab }}').attr('data-location'));
5748
}
5849
$('.ajaxLink').click(function() {
5950
60-
$('.ajaxLink').parent().parent().parent().removeClass('active');
61-
$(this).parent().parent().parent().addClass('active');
51+
$('.ajaxLink').parent().removeClass('active');
52+
$(this).parent().addClass('active');
6253
6354
var link = $(this).attr('id');
6455
$('#ajaxContent').html('{{ $settings->loadingIcon }}');
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
@if ($settings->header != null)
2+
@include($settings->header)
3+
@endif
4+
5+
<div class="row">
6+
<div class="col-md-2">
7+
@foreach ($settings->panels as $panel)
8+
<div class="panel panel-default">
9+
@if ($settings->collapasable == false)
10+
<div class="panel-heading">{{ $panel->title }}</div>
11+
<div class="list-glow">
12+
<ul class="list-glow-group no-header">
13+
@else
14+
<div class="panel-heading" onClick="collapse('{{ $panel->id }}');">{{ $panel->title }}</div>
15+
<div class="list-glow">
16+
<ul class="list-glow-group no-header" id="{{ $panel->id }}" style="{{ !Session::get('COLLAPSE_'. $panel->id) ? 'display: none;' : null }}">
17+
@endif
18+
@foreach ($panel->tabs as $tab)
19+
<li id="{{ $tab->id }}_tab">
20+
<div class="list-glow-group-item list-glow-group-item-sm">
21+
<div class="col-md-12">
22+
@if (isset($tab->options['badge']))
23+
<span class="badge">{{ $tab->options['badge'] }}</span>
24+
@endif
25+
<a href="javascript: void(0);" class="ajaxLink block" id="{{ $tab->id }}" data-location="{{ $tab->path }}">
26+
{{ ucwords($tab->title) }}
27+
</a>
28+
</div>
29+
</div>
30+
</li>
31+
@endforeach
32+
</ul>
33+
</div>
34+
</div>
35+
@endforeach
36+
</div>
37+
<div class="col-md-10">
38+
<div id="ajaxContent">
39+
{{ $settings->loadingIcon }}
40+
</div>
41+
</div>
42+
</div>
43+
44+
@section('js')
45+
<script>
46+
var url = location.href;
47+
var parts = url.split('#');
48+
49+
if (parts[1] != null) {
50+
$('#'+ parts[1] +'_tab').addClass('active');
51+
$('#ajaxContent').html('{{ $settings->loadingIcon }}');
52+
$('#ajaxContent').load($('#'+ parts[1]).attr('data-location'));
53+
} else {
54+
$('#{{ $settings->defaultTab }}_tab').addClass('active');
55+
$('#ajaxContent').html('{{ $settings->loadingIcon }}');
56+
$('#ajaxContent').load($('#{{ $settings->defaultTab }}').attr('data-location'));
57+
}
58+
$('.ajaxLink').click(function() {
59+
60+
$('.ajaxLink').parent().parent().parent().removeClass('active');
61+
$(this).parent().parent().parent().addClass('active');
62+
63+
var link = $(this).attr('id');
64+
$('#ajaxContent').html('{{ $settings->loadingIcon }}');
65+
$('#ajaxContent').load($(this).attr('data-location'));
66+
$("html, body").animate({ scrollTop: 0 }, "slow");
67+
});
68+
69+
function collapse (target) {
70+
$('#'+ target).toggle();
71+
$.get('/collapse/'+ target);
72+
}
73+
</script>
74+
@stop

src/views/home/memberlist.blade.php

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
1-
<div class="row">
2-
<div class="col-md-offset-2 col-md-8">
3-
<div class="panel panel-default">
4-
<div class="panel-heading">Memberlist</div>
5-
<div class="list-glow">
6-
<div class="list-glow-labels">
7-
<div class="col-md-4">Username</div>
8-
<div class="col-md-4" style="width: 33%;">Email</div>
9-
<div class="col-md-4" style="width: 33%;">Last Active</div>
10-
</div>
11-
<ul class="list-glow-group">
12-
@foreach ($users as $user)
13-
@if ($user->lastActive >= date('Y-m-d H:i:s', strtotime('-15 minutes')))
14-
<li class="online">
15-
@else
16-
<li>
17-
@endif
18-
<div class="list-glow-group-item list-glow-group-item-sm">
19-
<div class="col-md-4">{{ HTML::link('user/view/'. $user->id, $user->username) }}</div>
20-
<div class="col-md-4">{{ $user->emailLink }}</div>
21-
<div class="col-md-4">{{ $user->lastActiveReadable }}</div>
22-
</div>
23-
</li>
24-
@endforeach
25-
</ul>
26-
</div>
27-
</div>
28-
</div>
1+
<div class="panel panel-default">
2+
<div class="panel-heading">Memberlist</div>
3+
<table class="table table-hover table-condensed">
4+
<thead>
5+
<tr>
6+
<th>Username</th>
7+
<th>Email</th>
8+
<th class="text-center">Status</th>
9+
<th>Last Active</th>
10+
</tr>
11+
</thead>
12+
<tbody>
13+
@foreach ($users as $user)
14+
<tr>
15+
<td>{{ HTML::link('user/view/'. $user->id, $user->username) }}</td>
16+
<td>{{ $user->emailLink }}</td>
17+
<td class="text-center">
18+
{{ $user->online }}
19+
</td>
20+
<td>{{ $user->lastActiveReadable }}</td>
21+
</tr>
22+
@endforeach
23+
</tbody>
24+
</table>
2925
</div>

0 commit comments

Comments
 (0)