From: Vincent Vanwaelscappel Date: Fri, 16 Jun 2023 10:15:21 +0000 (+0200) Subject: wait #5662 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ec4a5e5c680ff9c80760320583619ae430b56256;p=fluidbook-toolbox.git wait #5662 @1.5 --- diff --git a/app/Fluidbook/Stats.php b/app/Fluidbook/Stats.php index f90763346..f0175098c 100644 --- a/app/Fluidbook/Stats.php +++ b/app/Fluidbook/Stats.php @@ -226,6 +226,7 @@ class Stats extends Reporting $this->viewData->searches = $this->_processSearches(); $this->viewData->outlinks = $this->_processOutgoingLinks(); $this->viewData->countries = $this->_processCountries(); + $this->viewData->shareDetails = $this->_processShareDetails(); //=== MAIN PERIOD STATISTICS // These are the main statistics used to build the chart and the table below it. @@ -311,6 +312,33 @@ class Stats extends Reporting } + protected function _processShareDetails() + { + $icons = [ + 'email' => 'las la-envelope', + 'facebook' => 'lab la-facebook-f', + 'twitter' => 'lab la-twitter', + 'whatsapp' => 'lab la-whatsapp', + 'linkedin' => 'lab la-linkedin-in', + 'pinterest' => 'lab la-pinterest-p', + 'googleplus' => 'lab la-google-plus', + 'viadeo' => 'lab la-viadeo', + ]; + +// $res = []; +// foreach ($icons as $social => $icon) { +// $res[$social] = ['nb' => rand(1, 100), 'icon' => $icon]; +// } +// return $res; + + $events = collect($this->_eventsByPage['share']['subtable'] ?? [])->sortByDesc('nb_events'); + + foreach ($events as $event) { + $res[$event['label']] = ['nb' => $event['nb_events'], 'icon' => $icons[$event['label']]]; + } + return $res; + } + protected function getTooltipLabels() { @@ -345,6 +373,7 @@ class Stats extends Reporting 'nb_downloads' => __('Téléchargements'), 'nb_prints' => __('Impressions'), 'nb_zooms' => __('Zooms'), + 'nb_shares' => __('Partages'), ], // Per-page detail table 'per-page' => [ @@ -352,7 +381,6 @@ class Stats extends Reporting 'nb_pageviews' => __('Vues'), 'nb_zooms' => __('Zooms'), 'nb_bookmarks' => __('Pages marquées'), - 'nb_shares' => __('Partages'), ], ]; @@ -380,7 +408,7 @@ class Stats extends Reporting ->keyBy('label') ->map(function ($item, $key) { // Make subtable data easier to lookup by keying them with the labels (ie. page numbers) for certain events - if (in_array($item['label'], ['zoom', 'bookmark', 'share']) && isset($item['subtable'])) { + if (in_array($item['label'], ['zoom', 'bookmark', 'share', 'video', 'slideshow']) && isset($item['subtable'])) { $item['subtable'] = collect($item['subtable'])->keyBy(function ($item, $key) { // Since there's some inconsistency in the way labels are stored (some have "page x" instead // of just the number), we strip out any non-numeric values when making the keys diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php index a65b39927..bb51875ab 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php @@ -43,7 +43,7 @@ trait StatsOperation $data = $stats->processData($period_override); $data['locale'] = app()->getLocale(); $data['fluidbook'] = $fluidbook; - return view('fluidbook_stats.loader', $data); + return view('fluidbook_stats.stats', $data); } diff --git a/package-lock.json b/package-lock.json index 91dcc5624..7114deb30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "jquery-form": "^4.3.0", "jquery.scrollto": "^2.1.3", "keymaster-reloaded": "^1.7.2", + "line-awesome": "^1.3.0", "lz4js": "^0.2.0", "noty": "^3.2.0-beta-deprecated", "pako": "^2.1.0", @@ -6630,6 +6631,11 @@ "node": ">=10" } }, + "node_modules/line-awesome": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/line-awesome/-/line-awesome-1.3.0.tgz", + "integrity": "sha512-Y0YHksL37ixDsHz+ihCwOtF5jwJgCDxQ3q+zOVgaSW8VugHGTsZZXMacPYZB1/JULBi6BAuTCTek+4ZY/UIwcw==" + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", diff --git a/package.json b/package.json index bd93cc6be..2c3d43708 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "jquery-form": "^4.3.0", "jquery.scrollto": "^2.1.3", "keymaster-reloaded": "^1.7.2", + "line-awesome": "^1.3.0", "lz4js": "^0.2.0", "noty": "^3.2.0-beta-deprecated", "pako": "^2.1.0", diff --git a/public/packages/fluidbook/toolbox/css/stats.css b/public/packages/fluidbook/toolbox/css/stats.css new file mode 100644 index 000000000..a72fa5675 --- /dev/null +++ b/public/packages/fluidbook/toolbox/css/stats.css @@ -0,0 +1,121 @@ +.chart-header { + display: flex; + align-items: center; + justify-content: space-between; +} +table.stats-details { + width: 100%; + table-layout: fixed; +} +table.stats-details th, +table.stats-details td { + padding: 0.5em 0.75em; +} +table.stats-details td, +table.stats-details .with-aliases { + overflow: hidden; + text-overflow: ellipsis; +} +table.stats-details .with-aliases .number { + font-size: 75%; + display: block; + font-style: italic; + margin-top: -2px; +} +table.stats-details .with-aliases .alias:after { + content: ', '; +} +table.stats-details .with-aliases .alias:last-of-type:after { + content: ''; +} +table.stats-details thead tr { + position: sticky; + top: 0; + background-color: #fafafa; +} +table.stats-details thead th { + border-bottom: medium solid rgba(0, 40, 100, 0.12); +} +[data-name="formatted_date"] { + white-space: nowrap; +} +.table-columns { + display: flex; + flex-wrap: wrap; + gap: 2em; +} +.table-columns > div { + flex: 1; +} +.no-statistics { + background-color: #fefce9; + color: #854e18; + padding: 1.5em; + margin-top: 1.5em; +} +.heading-subtitle { + opacity: 0.6; +} +.heading-subtitle:before { + content: ' — '; +} +/*=== Date Range Picker ===*/ +[data-daterangepicker]:hover { + color: #467fcf; +} +/*=== Table Column Sorter ===*/ +#sorttable_sortfwdind, +#sorttable_sortrevind { + display: none !important; +} +.sortable th:not(.sorttable_nosort) { + cursor: pointer; + white-space: nowrap; + position: relative; + font-size: 100% !important; +} +.sortable th:not(.sorttable_nosort):after, +.sortable th:not(.sorttable_nosort):before { + position: absolute; + content: "\f0d7"; + font-family: Line Awesome Free; + font-weight: 900; + right: 0.4em; + top: 50%; + font-size: 14px !important; + line-height: 1; + opacity: 0.125; +} +.sortable th:not(.sorttable_nosort):before { + content: "\f0d8"; + top: auto; + bottom: 50%; +} +.sortable th:not(.sorttable_nosort).sorttable_sorted_reverse:after { + opacity: 1; +} +.sortable th:not(.sorttable_nosort).sorttable_sorted:before { + opacity: 1; +} +.whitespace-nowrap { + white-space: nowrap; +} +.summary-details, +.share-details { + opacity: 0.6; + display: inline-block; + margin-left: 0.5em; +} +.share-details:before { + content: '('; +} +.share-details:after { + content: ')'; +} +.share-details span { + margin-right: 10px; +} +.share-details span:last-of-type { + margin-right: 0; +} +/*# sourceMappingURL=stats.css.map */ \ No newline at end of file diff --git a/public/packages/fluidbook/toolbox/css/stats.css.map b/public/packages/fluidbook/toolbox/css/stats.css.map new file mode 100644 index 000000000..64ea470f9 --- /dev/null +++ b/public/packages/fluidbook/toolbox/css/stats.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["stats.less"],"names":[],"mappings":"AAAA;EACI,aAAA;EACA,mBAAA;EACA,8BAAA;;AAGJ,KAAK;EACD,WAAA;EACA,mBAAA;;AAFJ,KAAK,cAID;AAJJ,KAAK,cAIG;EACA,qBAAA;;AALR,KAAK,cASD;AATJ,KAAK,cASG;EACA,gBAAA;EACA,uBAAA;;AAXR,KAAK,cAcD,cACI;EACI,cAAA;EACA,cAAA;EACA,kBAAA;EACA,gBAAA;;AAnBZ,KAAK,cAcD,cAQI,OAAM;EACF,SAAS,IAAT;;AAvBZ,KAAK,cAcD,cAYI,OAAM,aAAa;EACf,SAAS,EAAT;;AA3BZ,KAAK,cA+BD,MACI;EACI,gBAAA;EACA,MAAA;EACA,yBAAA;;AAnCZ,KAAK,cA+BD,MAOI;EACI,kDAAA;;AAOZ;EACI,mBAAA;;AAGJ;EACI,aAAA;EACA,eAAA;EACA,QAAA;;AAHJ,cAKI;EACI,OAAA;;AAKR;EACI,yBAAA;EACA,cAAA;EACA,cAAA;EACA,iBAAA;;AAGJ;EACI,YAAA;;AAEA,iBAAC;EACG,SAAS,KAAT;;;AAKR,sBAAsB;EAClB,cAAA;;;AAIJ;AAAuB;EACnB,wBAAA;;AAGJ,SAAU,GAAE,IAAI;EACZ,eAAA;EACA,mBAAA;EACA,kBAAA;EACA,0BAAA;;AAEA,SANM,GAAE,IAAI,mBAMX;AAAQ,SANH,GAAE,IAAI,mBAMF;EACN,kBAAA;EACA,SAAS,OAAT;EACA,8BAAA;EACA,gBAAA;EACA,YAAA;EACA,QAAA;EACA,0BAAA;EACA,cAAA;EACA,cAAA;;AAGJ,SAlBM,GAAE,IAAI,mBAkBX;EACG,SAAS,OAAT;EACA,SAAA;EACA,WAAA;;AAGJ,SAxBM,GAAE,IAAI,mBAwBX,yBAAyB;EACtB,UAAA;;AAGJ,SA5BM,GAAE,IAAI,mBA4BX,iBAAiB;EACd,UAAA;;AAIR;EACI,mBAAA;;AAIJ;AAAkB;EACd,YAAA;EACA,qBAAA;EACA,kBAAA;;AAIA,cAAC;EACG,SAAS,GAAT;;AAGJ,cAAC;EACG,SAAS,GAAT;;AANR,cASI;EACI,kBAAA;;AACA,cAFJ,KAEK;EACG,eAAA","file":"stats.css"} \ No newline at end of file diff --git a/public/packages/fluidbook/toolbox/css/stats.less b/public/packages/fluidbook/toolbox/css/stats.less new file mode 100644 index 000000000..f94cc049c --- /dev/null +++ b/public/packages/fluidbook/toolbox/css/stats.less @@ -0,0 +1,152 @@ +.chart-header { + display: flex; + align-items: center; + justify-content: space-between; +} + +table.stats-details { + width: 100%; + table-layout: fixed; + + th, td { + padding: 0.5em 0.75em; + } + + + td, .with-aliases { + overflow: hidden; + text-overflow: ellipsis; + } + + .with-aliases { + .number { + font-size: 75%; + display: block; + font-style: italic; + margin-top: -2px; + } + + .alias:after { + content: ', '; + } + + .alias:last-of-type:after { + content: ''; + } + } + + thead { + tr { + position: sticky; + top: 0; + background-color: #fafafa; + } + + th { + border-bottom: medium solid rgba(0, 40, 100, .12); + } + } + +} + + +[data-name="formatted_date"] { + white-space: nowrap; +} + +.table-columns { + display: flex; + flex-wrap: wrap; + gap: 2em; + + > div { + flex: 1; + } +} + + +.no-statistics { + background-color: #fefce9; + color: #854e18; + padding: 1.5em; + margin-top: 1.5em; +} + +.heading-subtitle { + opacity: 0.6; + + &:before { + content: ' — '; + } +} + +/*=== Date Range Picker ===*/ +[data-daterangepicker]:hover { + color: #467fcf; +} + +/*=== Table Column Sorter ===*/ +#sorttable_sortfwdind, #sorttable_sortrevind { + display: none !important; +} + +.sortable th:not(.sorttable_nosort) { + cursor: pointer; + white-space: nowrap; + position: relative; + font-size: 100% !important; + + &:after, &:before { + position: absolute; + content: "\f0d7"; + font-family: Line Awesome Free; + font-weight: 900; + right: .4em; + top: 50%; + font-size: 14px !important; + line-height: 1; + opacity: 0.125; + } + + &:before { + content: "\f0d8"; + top: auto; + bottom: 50%; + } + + &.sorttable_sorted_reverse:after { + opacity: 1; + } + + &.sorttable_sorted:before { + opacity: 1; + } +} + +.whitespace-nowrap { + white-space: nowrap; +} + + +.summary-details, .share-details { + opacity: 0.6; + display: inline-block; + margin-left: 0.5em; +} + +.share-details { + &:before { + content: '('; + } + + &:after { + content: ')'; + } + + span { + margin-right: 10px; + &:last-of-type{ + margin-right: 0; + } + } +} diff --git a/resources/views/fluidbook_stats/loader.blade.php b/resources/views/fluidbook_stats/loader.blade.php deleted file mode 100644 index 515658b2d..000000000 --- a/resources/views/fluidbook_stats/loader.blade.php +++ /dev/null @@ -1,152 +0,0 @@ -{{-- __('!! Statistiques') --}} -@extends(backpack_view('blank')) -@push('after_scripts') - {{-- Include the base libraries for the chart and the date picker here so that they're ready - when the report HTML and extra scripts are injected --}} - - {{-- Charting library --}} - - - {{-- Date Range picker: https://www.daterangepicker.com/ --}} - - - - {{-- Simple Table Sorter --}} - - {{-- This script works on any tables with the "sortable" class. There's no extra setup needed here. --}} -@endpush - -@section('after_styles') - - -@endsection - -@section('content') -
- @include('fluidbook_stats.summary') -
-@endsection diff --git a/resources/views/fluidbook_stats/stats.blade.php b/resources/views/fluidbook_stats/stats.blade.php new file mode 100644 index 000000000..f565bfd1e --- /dev/null +++ b/resources/views/fluidbook_stats/stats.blade.php @@ -0,0 +1,484 @@ +{{-- __('!! Statistiques') --}} +@extends(backpack_view('blank')) +@push('after_scripts') + {{-- Include the base libraries for the chart and the date picker here so that they're ready + when the report HTML and extra scripts are injected --}} + + {{-- Charting library --}} + + + {{-- Date Range picker: https://www.daterangepicker.com/ --}} + + + + {{-- Simple Table Sorter --}} + + {{-- This script works on any tables with the "sortable" class. There's no extra setup needed here. --}} +@endpush + +@section('after_styles') + + +@endsection + +@section('content') +
+ {{-- __('!! Statistiques') --}} + {{-- Statistics Report --}} + {{-- This doesn't extend any templates because it is fetched from loader.blade.php and injected via JS --}} + + @php + $tableClasses='stats-details sortable bg-white table table-striped table-hover nowrap rounded shadow-xs border-xs mt-2 dataTable dtr-inline'; + $fluidbookBaseURL=$fluidbook->getPreviewURL(); + @endphp + +

+ {{ __('Statistiques') }} +

+ +
+ + + {!! $formatted_date_range !!} + +
+ + + + + + + + + + + + + + + + + + + + + + + {{-- Summary of totals --}} + @if($period_details->isNotEmpty()) + @foreach ($table_map['summary'] as $summary_key => $summary_heading) + @if($summary_key === 'formatted_date' || $period_details->sum($summary_key)===0) + @continue + @endif + + + + + @endforeach + + + + + + @endif +
#{{ $fluidbook->id }}
{{ __('Titre de la publication') }}{{ $title }}
{{ __('Crée le') }} + {{ $fluidbook->created_at->isoFormat('Do MMMM YYYY') }} + + ({{ $fluidbook->created_at->diffForHumans([ + 'parts' => 2, // How many levels of detail to go into (ie. years, months, days) + 'join' => true, // Join string with natural language separators for the locale + ]) + }}) + +
{{ __('Nombre de pages') }}{{ $page_count }}
{{ $summary_heading }} + {{ $formatter->format($period_details->sum($summary_key)) }} + @if($summary_key==='nb_shares' && $period_details->sum($summary_key)>0) + + + @endif +
{{ __('Recherches') }}{{ $formatter->format($searches->sum()) }}
+ + @if($period_details->isNotEmpty()) + + {{-- Period (segmentation) override controls [ Day / Week / Month / Year ] --}} +
+ +

{!! $chart_heading !!}

+
+ @foreach($period_map as $period_key => $period_title) + + {{ $period_title['singular'] }} + + @endforeach +
+
+ + {{-- Chart --}} +
+ +
+ + {{-- Stats for each period entry (year, month, week or day) --}} + + + + @foreach ($table_map['summary'] as $summary_heading_key => $summary_heading) + + @endforeach + + + + @foreach($period_details as $date_key => $period_data) + + @foreach (array_keys($table_map['summary']) as $summary_key) + + @endforeach + + @endforeach + +
+ {{ $summary_heading }} +
+ @if(isset($period_data[$summary_key])) + {!! is_int($period_data[$summary_key]) ? $formatter->format($period_data[$summary_key]) : $period_data[$summary_key] !!} + @else + - + @endif +
+ + {{-- Stats segregated by page number --}} +

{{ __('Détails par page') }} ({!! $formatted_date_range !!})

+ + + + + @foreach ($table_map['per-page'] as $page_data_heading_key => $page_data_heading) + {{-- In the case of the "page_group" data, we want it to be sorted in ascending order by default, even though it's a numeric column --}} + + @endforeach + + + + @foreach($pages as $page_group => $page_data) + + @foreach (array_keys($table_map['per-page']) as $summary_key) + + @endforeach + + @endforeach + +
+ {{ $page_data_heading }} +
+ @if($summary_key === 'page_group') + @if(count($page_data['page_aliases'])>0) +
+ @foreach($page_data['page_aliases'] as $alias) + {{$alias}} + @endforeach + @endif + {{$page_data[$summary_key]}} + @if(count($page_data['page_aliases'])>0) +
+ @endif + @else + {!! is_int($page_data[$summary_key]) ? $formatter->format($page_data[$summary_key]) : $page_data[$summary_key] !!} + @endif +
+ + {{-- Additional stats tables organised into columns (outgoing links, search keywords and countries) --}} + {{-- Sometimes there are no stats for certain categories, so the number of columns adapts accordingly --}} +
+ + {{-- Outgoing Links --}} + @if($outlinks->isNotEmpty()) +
+

{{ __('Liens sortants') }}

+ + + + + + + + + + @foreach($outlinks as $link) + + + + + @endforeach + +
{{ __('URL') }}{{ __('Clics') }}
{!! \Cubist\Util\Url::linkIfisURL($link['label']) !!}{{ $formatter->format($link['nb_events']) }}
+
+ @endif + + {{-- Search Keywords --}} + @if($searches->isNotEmpty()) +
+

{{ __('Mots recherchés') }}

+ + + + + + + + + + @foreach($searches as $search_query => $search_count) + + + + + @endforeach + +
{{ __('Requêtes') }}{{ __('Nombre') }}
{{ $search_query }}{{ $formatter->format($search_count) }}
+
+ @endif + + {{-- Visitor Countries --}} + @if($countries->isNotEmpty()) +
+

{{ __('Origine des visiteurs') }}

+ + + + + + + + + + @foreach($countries as $country) + + + + + @endforeach + +
{{ __('Pays') }}{{ __('Nombre de visites') }}
+ {{ $country['label'] }} + {{ $country['label'] }} + {{ $formatter->format($country['nb_visits']) }}
+
+ @endif + +
+ + + {{-- It's possible for there to be no statistics returned by the API --}} + @else +
+ ⚠️ + {{ __('Aucune visite ne correspond à cette période') }} +
+ @endif + + @can('fluidbook-publication:admin') +
+ {{__('Voir les données brutes sur Matomo')}} + @can('superadmin') + | {{__('API Matomo')}} + @endcan +
+ @endcan + + @push('after_scripts') + {{--================== SCRIPTS ==================--}} + + {{-- Date Range picker setup: https://sensortower.github.io/daterangepicker/docs --}} + + @endpush + +
+@endsection diff --git a/resources/views/fluidbook_stats/summary.blade.php b/resources/views/fluidbook_stats/summary.blade.php deleted file mode 100644 index 2e705624e..000000000 --- a/resources/views/fluidbook_stats/summary.blade.php +++ /dev/null @@ -1,443 +0,0 @@ -{{-- __('!! Statistiques') --}} -{{-- Statistics Report --}} -{{-- This doesn't extend any templates because it is fetched from loader.blade.php and injected via JS --}} - -@php - $tableClasses='stats-details sortable bg-white table table-striped table-hover nowrap rounded shadow-xs border-xs mt-2 dataTable dtr-inline'; - $fluidbookBaseURL=$fluidbook->getPreviewURL(); -@endphp - -

- {{ __('Statistiques') }} -

- -
- - - {!! $formatted_date_range !!} - -
- - - - - - - - - - - - - - - - - - - - - - - {{-- Summary of totals --}} - @if($period_details->isNotEmpty()) - @foreach ($table_map['summary'] as $summary_key => $summary_heading) - @php - if ($summary_key === 'formatted_date') continue; - @endphp - - - - - @endforeach - - - - - - @endif -
#{{ $fluidbook->id }}
{{ __('Titre de la publication') }}{{ $title }}
{{ __('Crée le') }} - {{ $fluidbook->created_at->isoFormat('Do MMMM YYYY') }} - - ({{ $fluidbook->created_at->diffForHumans([ - 'parts' => 2, // How many levels of detail to go into (ie. years, months, days) - 'join' => true, // Join string with natural language separators for the locale - ]) - }}) - -
{{ __('Nombre de pages') }}{{ $page_count }}
{{ $summary_heading }}{{ $formatter->format($period_details->sum($summary_key)) }}
{{ __('Recherches') }}{{ $formatter->format($searches->sum()) }}
- -@if($period_details->isNotEmpty()) - - {{-- Period (segmentation) override controls [ Day / Week / Month / Year ] --}} -
- -

{!! $chart_heading !!}

-
- @foreach($period_map as $period_key => $period_title) - - {{ $period_title['singular'] }} - - @endforeach -
-
- - {{-- Chart --}} -
- -
- - {{-- Stats for each period entry (year, month, week or day) --}} - - - - @foreach ($table_map['summary'] as $summary_heading_key => $summary_heading) - - @endforeach - - - - @foreach($period_details as $date_key => $period_data) - - @foreach (array_keys($table_map['summary']) as $summary_key) - - @endforeach - - @endforeach - -
- {{ $summary_heading }} -
- @if(isset($period_data[$summary_key])) - {!! is_int($period_data[$summary_key]) ? $formatter->format($period_data[$summary_key]) : $period_data[$summary_key] !!} - @else - - - @endif -
- - {{-- Stats segregated by page number --}} -

{{ __('Détails par page') }} ({!! $formatted_date_range !!})

- - - - - @foreach ($table_map['per-page'] as $page_data_heading_key => $page_data_heading) - {{-- In the case of the "page_group" data, we want it to be sorted in ascending order by default, even though it's a numeric column --}} - - @endforeach - - - - @foreach($pages as $page_group => $page_data) - - @foreach (array_keys($table_map['per-page']) as $summary_key) - - @endforeach - - @endforeach - -
- {{ $page_data_heading }} -
- @if($summary_key === 'page_group') - @if(count($page_data['page_aliases'])>0) -
- @foreach($page_data['page_aliases'] as $alias) - {{$alias}} - @endforeach - @endif - {{$page_data[$summary_key]}} - @if(count($page_data['page_aliases'])>0) -
- @endif - @else - {!! is_int($page_data[$summary_key]) ? $formatter->format($page_data[$summary_key]) : $page_data[$summary_key] !!} - @endif -
- - {{-- Additional stats tables organised into columns (outgoing links, search keywords and countries) --}} - {{-- Sometimes there are no stats for certain categories, so the number of columns adapts accordingly --}} -
- - {{-- Outgoing Links --}} - @if($outlinks->isNotEmpty()) -
-

{{ __('Liens sortants') }}

- - - - - - - - - - @foreach($outlinks as $link) - - - - - @endforeach - -
{{ __('URL') }}{{ __('Clics') }}
{!! \Cubist\Util\Url::linkIfisURL($link['label']) !!}{{ $formatter->format($link['nb_events']) }}
-
- @endif - - {{-- Search Keywords --}} - @if($searches->isNotEmpty()) -
-

{{ __('Mots recherchés') }}

- - - - - - - - - - @foreach($searches as $search_query => $search_count) - - - - - @endforeach - -
{{ __('Requêtes') }}{{ __('Nombre') }}
{{ $search_query }}{{ $formatter->format($search_count) }}
-
- @endif - - {{-- Visitor Countries --}} - @if($countries->isNotEmpty()) -
-

{{ __('Origine des visiteurs') }}

- - - - - - - - - - @foreach($countries as $country) - - - - - @endforeach - -
{{ __('Pays') }}{{ __('Nombre de visites') }}
- {{ $country['label'] }} - {{ $country['label'] }} - {{ $formatter->format($country['nb_visits']) }}
-
- @endif - -
- - - {{-- It's possible for there to be no statistics returned by the API --}} -@else -
- ⚠️ - {{ __('Aucune visite ne correspond à cette période') }} -
-@endif - -@can('fluidbook-publication:admin') -
- {{__('Voir les données brutes sur Matomo')}} - @can('superadmin') - | {{__('API Matomo')}} - @endcan -
-@endcan - -@push('after_scripts') - {{--================== SCRIPTS ==================--}} - - {{-- Date Range picker setup: https://sensortower.github.io/daterangepicker/docs --}} - -@endpush