Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit ffa3365

Browse files
authored
Merge pull request #6 from forepath/feat/notification_indicators
feat: notification indicators
2 parents f1ff227 + 258544d commit ffa3365

4 files changed

Lines changed: 71 additions & 10 deletions

File tree

src/layouts/admin.blade.php

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,24 @@ class="nav-item dropdown show {{ str_contains(Request::route()?->getName(), 'adm
127127
<a class="nav-link dropdown-toggle" href="#" id="dropdown04" data-toggle="dropdown"
128128
aria-expanded="false" title="{{ __('interface.misc.support') }}">
129129
<div>
130-
<i class="bi bi-telephone"></i>
130+
<i class="bi bi-telephone">
131+
@if (request()->get('badges')->tickets > 0)
132+
<span class="bubble bubble-warning bubble--on-sidebar"></span>
133+
@endif
134+
</i>
131135
<span>{{ __('interface.misc.support') }}</span>
132136
</div>
133137
<i class="bi bi-chevron-down dropdown-indicator"></i>
134138
</a>
135139
<div class="dropdown-menu w-100" aria-labelledby="dropdown04">
136-
<a class="dropdown-item" href="{{ route('admin.support') }}"
140+
<a class="dropdown-item d-flex align-items-center justify-content-between" href="{{ route('admin.support') }}"
137141
title="{{ __('interface.misc.tickets') }}"
138-
data-toggle="tooltip">{{ __('interface.misc.tickets') }}</a>
142+
data-toggle="tooltip">
143+
{{ __('interface.misc.tickets') }}
144+
@if (request()->get('badges')->tickets > 0)
145+
<span class="bubble bubble-warning bubble--on-dropdown"></span>
146+
@endif
147+
</a>
139148
@if (Auth::user()->role == 'admin')
140149
<a class="dropdown-item" href="{{ route('admin.support.categories') }}"
141150
title="{{ __('interface.misc.categories') }}"
@@ -213,15 +222,24 @@ class="nav-item dropdown show {{ str_contains(Request::route()?->getName(), 'adm
213222
<a class="nav-link dropdown-toggle" href="#" id="dropdown04" data-toggle="dropdown"
214223
aria-expanded="false" title="{{ __('interface.misc.shop') }}">
215224
<div>
216-
<i class="bi bi-box"></i>
225+
<i class="bi bi-box">
226+
@if (request()->get('badges')->orders > 0)
227+
<span class="bubble bubble-warning bubble--on-sidebar"></span>
228+
@endif
229+
</i>
217230
<span>{{ __('interface.misc.shop') }}</span>
218231
</div>
219232
<i class="bi bi-chevron-down dropdown-indicator"></i>
220233
</a>
221234
<div class="dropdown-menu w-100" aria-labelledby="dropdown04">
222-
<a class="dropdown-item" href="{{ route('admin.shop.orders') }}"
235+
<a class="dropdown-item d-flex align-items-center justify-content-between" href="{{ route('admin.shop.orders') }}"
223236
title="{{ __('interface.misc.orders') }}"
224-
data-toggle="tooltip">{{ __('interface.misc.orders') }}</a>
237+
data-toggle="tooltip">
238+
{{ __('interface.misc.orders') }}
239+
@if (request()->get('badges')->orders > 0)
240+
<span class="bubble bubble-warning bubble--on-dropdown"></span>
241+
@endif
242+
</a>
225243
<a class="dropdown-item" href="{{ route('admin.shop.categories') }}"
226244
title="{{ __('interface.misc.configuration') }}"
227245
data-toggle="tooltip">{{ __('interface.misc.configuration') }}</a>

src/layouts/customer.blade.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt
105105
data-toggle="tooltip">
106106
<a class="nav-link" href="{{ route('customer.support') }}"
107107
title="{{ __('interface.misc.tickets') }}">
108-
<i class="bi bi-ticket-fill"></i>
108+
<i class="bi bi-ticket-fill">
109+
@if (request()->get('badges')->tickets > 0)
110+
<span class="bubble bubble-warning bubble--on-sidebar"></span>
111+
@endif
112+
</i>
109113
<span>{{ __('interface.misc.tickets') }}</span>
110114
</a>
111115
</li>
@@ -121,7 +125,13 @@ class="nav-item {{ str_contains(Request::route()?->getName(), 'customer.contract
121125
class="nav-item {{ str_contains(Request::route()?->getName(), 'customer.invoices') ? 'active' : '' }}">
122126
<a class="nav-link" href="{{ route('customer.invoices') }}"
123127
title="{{ __('interface.misc.invoices') }}" data-toggle="tooltip">
124-
<i class="bi bi-file-earmark-text"></i>
128+
<i class="bi bi-file-earmark-text">
129+
@if (request()->get('badges')->invoices->overdue > 0)
130+
<span class="bubble bubble-danger bubble--on-sidebar"></span>
131+
@elseif (request()->get('badges')->invoices->total > 0)
132+
<span class="bubble bubble-warning bubble--on-sidebar"></span>
133+
@endif
134+
</i>
125135
<span>{{ __('interface.misc.invoices') }}</span>
126136
</a>
127137
</li>

src/layouts/public.blade.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt
114114
class="nav-item {{ str_contains(Request::route()?->getName(), 'customer.support') ? 'active' : '' }}">
115115
<a class="nav-link" href="{{ route('customer.support') }}"
116116
title="{{ __('interface.misc.tickets') }}" data-toggle="tooltip">
117-
<i class="bi bi-ticket-fill"></i>
117+
<i class="bi bi-ticket-fill">
118+
@if (request()->get('badges')->tickets > 0)
119+
<span class="bubble bubble-warning bubble--on-sidebar"></span>
120+
@endif
121+
</i>
118122
<span>{{ __('interface.misc.tickets') }}</span>
119123
</a>
120124
</li>
@@ -130,7 +134,13 @@ class="nav-item {{ str_contains(Request::route()?->getName(), 'customer.contract
130134
class="nav-item {{ str_contains(Request::route()?->getName(), 'customer.invoices') ? 'active' : '' }}">
131135
<a class="nav-link" href="{{ route('customer.invoices') }}"
132136
title="{{ __('interface.misc.invoices') }}" data-toggle="tooltip">
133-
<i class="bi bi-file-earmark-text"></i>
137+
<i class="bi bi-file-earmark-text">
138+
@if (request()->get('badges')->invoices->overdue > 0)
139+
<span class="bubble bubble-danger bubble--on-sidebar"></span>
140+
@elseif (request()->get('badges')->invoices->total > 0)
141+
<span class="bubble bubble-warning bubble--on-sidebar"></span>
142+
@endif
143+
</i>
134144
<span>{{ __('interface.misc.invoices') }}</span>
135145
</a>
136146
</li>

src/scss/app.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ main {
358358
justify-content: center;
359359
transition-duration: .25s;
360360
min-width: 2.5rem;
361+
position: relative;
361362
}
362363
}
363364

@@ -803,3 +804,25 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
803804
text-decoration: none;
804805
background-color: $dropdown-link-hover-bg;
805806
}
807+
808+
.bubble {
809+
border-radius: 0.3rem;
810+
display: block;
811+
height: 0.6rem !important;
812+
width: 0.6rem !important;
813+
814+
&.bubble-warning {
815+
background-color: var(--warning);
816+
}
817+
818+
&.bubble-danger {
819+
background-color: var(--danger);
820+
}
821+
822+
&.bubble--on-sidebar {
823+
position: absolute;
824+
right: 0;
825+
top: 0;
826+
transform: translate(50%, -50%);
827+
}
828+
}

0 commit comments

Comments
 (0)