From 3ed9956d80434b634508980a1aeddbfd3c690b8d Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Tue, 13 Dec 2022 22:10:57 +0100 Subject: [PATCH] Adding uncommitted code. WIP #5316 --- .../views/fluidbook_stats/loader.blade.php | 5 +++++ .../views/fluidbook_stats/summary.blade.php | 20 ++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/resources/views/fluidbook_stats/loader.blade.php b/resources/views/fluidbook_stats/loader.blade.php index d60607e9b..fece720ee 100644 --- a/resources/views/fluidbook_stats/loader.blade.php +++ b/resources/views/fluidbook_stats/loader.blade.php @@ -77,6 +77,10 @@ color: #fff; text-decoration: none; } + .period_disabled { + opacity: 0.5; + cursor: not-allowed; + } .summary { display: grid; @@ -262,6 +266,7 @@ function showStatsLoader() { document.getElementById('stats_wrapper').style.display = 'none'; document.getElementById('stats_loader').style.display = 'flex'; + window.scrollTo(0,0); } function showStatsError() { diff --git a/resources/views/fluidbook_stats/summary.blade.php b/resources/views/fluidbook_stats/summary.blade.php index 8b1c7ddc9..5cf97e4db 100644 --- a/resources/views/fluidbook_stats/summary.blade.php +++ b/resources/views/fluidbook_stats/summary.blade.php @@ -3,7 +3,7 @@

{{ __('Statistics') }} - {{ $fluidbook->name }} + {{ $fluidbook_settings->title }}

@@ -19,7 +19,7 @@
{{ __('Fluidbook Name') }}
-
{{ $fluidbook->name }}
+
{{ $fluidbook_settings->title }}
{{ __('Creation Date') }}
@@ -36,6 +36,7 @@
{{ __('Page Count') }}
{{ $page_count }}
+ {{-- Summary of totals --}} @if($period_details->isNotEmpty()) @foreach ($table_map['summary'] as $summary_key => $summary_heading) @php @@ -52,12 +53,17 @@ @if($period_details->isNotEmpty()) + {{-- Period (segmentation) override controls [ Day / Week / Month / Year ] --}}

{!! $chart_heading !!}

@foreach($period_map as $period_key => $period_title) - @if($period_key === $period) - {{ $period_title['singular'] }} + @php + // When in the month or year display modes, it makes no sense to offer the month and year segmentations + $period_not_available = ($mode === 'month' && in_array($period_key, ['month', 'year'])) || ($mode === 'year' && $period_key === 'year'); + @endphp + @if($period_key === $period || $period_not_available) + {{ $period_title['singular'] }} @else {{ $period_title['singular'] }} @@ -70,7 +76,7 @@ {{-- Chart --}} - {{-- Stats for each period entry (year, month or day) --}} + {{-- Stats for each period entry (year, month, week or day) --}} @@ -192,7 +198,7 @@ @foreach($countries as $country) - @@ -281,7 +287,7 @@ {{-- Charting library --}}
+ {{ $country['label'] }} {{ $country['label'] }}