phase 3
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
@php
|
||||
$currentRange = request('range', '7d');
|
||||
$currentRouteName = request()->route()->getName();
|
||||
$currentRouteParams = request()->route()->parameters();
|
||||
$presets = [
|
||||
'today' => 'Today',
|
||||
'7d' => 'Last 7 days',
|
||||
@@ -34,7 +36,7 @@
|
||||
<div class="p-2">
|
||||
@foreach ($presets as $key => $label)
|
||||
<a
|
||||
href="{{ route('dashboard.show', ['website' => $website, 'range' => $key]) }}"
|
||||
href="{{ route($currentRouteName, $currentRouteParams + ['range' => $key]) }}"
|
||||
class="block rounded-md px-3 py-2 text-sm {{ $currentRange === $key ? 'bg-indigo-50 text-indigo-700 font-medium' : 'text-gray-700 hover:bg-gray-100' }}"
|
||||
>
|
||||
{{ $label }}
|
||||
@@ -43,7 +45,7 @@
|
||||
|
||||
<div class="my-2 border-t border-gray-100"></div>
|
||||
|
||||
<form action="{{ route('dashboard.show', $website) }}" method="GET" class="px-3 py-2 space-y-3">
|
||||
<form action="{{ route($currentRouteName, $currentRouteParams) }}" method="GET" class="px-3 py-2 space-y-3">
|
||||
<input type="hidden" name="range" value="custom">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-500 mb-1">From</label>
|
||||
|
||||
Reference in New Issue
Block a user