mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
book case stats added
This commit is contained in:
18
app/Http/Livewire/BookCase/Stats.php
Normal file
18
app/Http/Livewire/BookCase/Stats.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\BookCase;
|
||||
|
||||
use App\Models\OrangePill;
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
|
||||
class Stats extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.book-case.stats', [
|
||||
'orangePills' => OrangePill::query()->count(),
|
||||
'plebs' => User::query()->whereHas('orangePills')->count(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@
|
||||
<section class="w-full mb-12">
|
||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10">
|
||||
|
||||
<livewire:book-case.stats/>
|
||||
|
||||
<h1 class="text-xl font-bold py-4 text-gray-200">
|
||||
{{ __('Orange Pill Heatmap') }}
|
||||
</h1>
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
{{-- MAIN --}}
|
||||
<section class="w-full mb-12">
|
||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">
|
||||
|
||||
<livewire:book-case.stats/>
|
||||
|
||||
<div class="md:flex md:items-center md:justify-between">
|
||||
<div class="min-w-0 flex-1">
|
||||
<h2 class="text-2xl font-bold leading-7 text-white sm:truncate sm:text-3xl sm:tracking-tight">
|
||||
|
||||
23
resources/views/livewire/book-case/stats.blade.php
Normal file
23
resources/views/livewire/book-case/stats.blade.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<div class="bg-gray-900 py-12 sm:py-24">
|
||||
<div class="mx-auto max-w-7xl px-6 lg:px-8">
|
||||
<dl class="grid grid-cols-1 gap-x-8 gap-y-16 text-center lg:grid-cols-2">
|
||||
<div class="mx-auto flex max-w-xs flex-col gap-y-4">
|
||||
<dt class="text-base leading-7 text-gray-400">
|
||||
{{ __('Book cases orange pilled') }}
|
||||
</dt>
|
||||
<dd class="order-first text-3xl font-semibold tracking-tight text-white sm:text-5xl">
|
||||
{{ number_format($orangePills, 0, ',', '.') }}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
<div class="mx-auto flex max-w-xs flex-col gap-y-4">
|
||||
<dt class="text-base leading-7 text-gray-400">
|
||||
{{ __('Number of plebs') }}
|
||||
</dt>
|
||||
<dd class="order-first text-3xl font-semibold tracking-tight text-white sm:text-5xl">
|
||||
{{ number_format($plebs, 0, ',', '.') }}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@@ -7,6 +7,8 @@
|
||||
<section class="w-full mb-12">
|
||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10">
|
||||
|
||||
<livewire:book-case.stats/>
|
||||
|
||||
<h1 class="text-xl font-bold py-4 text-gray-200">
|
||||
{{ __('World Map') }}
|
||||
</h1>
|
||||
|
||||
Reference in New Issue
Block a user