mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
gamified
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Livewire\BookCase;
|
namespace App\Http\Livewire\BookCase;
|
||||||
|
|
||||||
use App\Models\BookCase;
|
use App\Models\BookCase;
|
||||||
|
use App\Models\Country;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithFileUploads;
|
use Livewire\WithFileUploads;
|
||||||
@@ -10,6 +11,7 @@ use Livewire\WithFileUploads;
|
|||||||
class CommentBookCase extends Component
|
class CommentBookCase extends Component
|
||||||
{
|
{
|
||||||
use WithFileUploads;
|
use WithFileUploads;
|
||||||
|
public Country $country;
|
||||||
|
|
||||||
public $photo;
|
public $photo;
|
||||||
|
|
||||||
|
|||||||
24
app/Http/Livewire/BookCase/HighscoreTable.php
Normal file
24
app/Http/Livewire/BookCase/HighscoreTable.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire\BookCase;
|
||||||
|
|
||||||
|
use App\Models\Country;
|
||||||
|
use App\Models\User;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class HighscoreTable extends Component
|
||||||
|
{
|
||||||
|
public Country $country;
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.book-case.highscore-table', [
|
||||||
|
'plebs' => User::query()
|
||||||
|
->withCount([
|
||||||
|
'orangePills',
|
||||||
|
])
|
||||||
|
->orderByDesc('orange_pills_count')
|
||||||
|
->get(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ use Laravel\Fortify\TwoFactorAuthenticatable;
|
|||||||
use Laravel\Jetstream\HasProfilePhoto;
|
use Laravel\Jetstream\HasProfilePhoto;
|
||||||
use Laravel\Jetstream\HasTeams;
|
use Laravel\Jetstream\HasTeams;
|
||||||
use Laravel\Sanctum\HasApiTokens;
|
use Laravel\Sanctum\HasApiTokens;
|
||||||
|
use QCod\Gamify\Gamify;
|
||||||
use Spatie\Comments\Models\Concerns\InteractsWithComments;
|
use Spatie\Comments\Models\Concerns\InteractsWithComments;
|
||||||
use Spatie\Comments\Models\Concerns\Interfaces\CanComment;
|
use Spatie\Comments\Models\Concerns\Interfaces\CanComment;
|
||||||
use Spatie\Permission\Traits\HasRoles;
|
use Spatie\Permission\Traits\HasRoles;
|
||||||
@@ -24,6 +25,7 @@ class User extends Authenticatable implements MustVerifyEmail, CanComment
|
|||||||
use TwoFactorAuthenticatable;
|
use TwoFactorAuthenticatable;
|
||||||
use HasRoles;
|
use HasRoles;
|
||||||
use InteractsWithComments;
|
use InteractsWithComments;
|
||||||
|
use Gamify;
|
||||||
|
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
@@ -53,4 +55,9 @@ class User extends Authenticatable implements MustVerifyEmail, CanComment
|
|||||||
protected $appends = [
|
protected $appends = [
|
||||||
'profile_photo_url',
|
'profile_photo_url',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function orangePills()
|
||||||
|
{
|
||||||
|
return $this->hasMany(OrangePill::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -619,5 +619,7 @@
|
|||||||
"Dates for courses about Bitcoin.": "Termine für Kurse zum Thema Bitcoin.",
|
"Dates for courses about Bitcoin.": "Termine für Kurse zum Thema Bitcoin.",
|
||||||
"Lecturers in the surrounding area.": "Dozenten in der Umgebung.",
|
"Lecturers in the surrounding area.": "Dozenten in der Umgebung.",
|
||||||
"Venues in the surrounding area.": "Veranstaltungsorte in der Umgebung.",
|
"Venues in the surrounding area.": "Veranstaltungsorte in der Umgebung.",
|
||||||
"nova-spatie-permissions::lang.display_names\": \"": ""
|
"nova-spatie-permissions::lang.display_names\": \"": "",
|
||||||
|
"PlebArt": "",
|
||||||
|
"Highscore Table": "Highscore-Tabelle"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -612,5 +612,6 @@
|
|||||||
"Dates for courses about Bitcoin.": "",
|
"Dates for courses about Bitcoin.": "",
|
||||||
"Lecturers in the surrounding area.": "",
|
"Lecturers in the surrounding area.": "",
|
||||||
"Venues in the surrounding area.": "",
|
"Venues in the surrounding area.": "",
|
||||||
"PlebArt": ""
|
"PlebArt": "",
|
||||||
|
"Highscore Table": ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +1,4 @@
|
|||||||
<div class="bg-21gray flex flex-col h-screen justify-between">
|
<div class="bg-21gray flex flex-col h-screen justify-between">
|
||||||
<script src="{{ asset('earth/miniature.earth.js') }}"></script>
|
|
||||||
<style>
|
|
||||||
.earth-container::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
height: 22%;
|
|
||||||
bottom: 4%;
|
|
||||||
left: 13%;
|
|
||||||
right: 13%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{{-- HEADER --}}
|
|
||||||
<div>
|
|
||||||
<section class="w-full">
|
|
||||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10">
|
|
||||||
<div
|
|
||||||
class="relative sm:sticky sm:top-0 bg-21gray z-10 flex flex-col flex-wrap items-center justify-between py-7 mx-auto md:flex-row max-w-screen-2xl">
|
|
||||||
<div class="relative flex flex-col md:flex-row">
|
|
||||||
<a href="{{ route('school.table.city', ['country' => $c]) }}"
|
|
||||||
class="flex items-center mb-5 font-medium text-gray-900 lg:w-auto lg:items-center lg:justify-center md:mb-0">
|
|
||||||
<img src="{{ asset('img/einundzwanzig-horizontal-inverted.svg') }}">
|
|
||||||
</a>
|
|
||||||
<nav
|
|
||||||
class="flex flex-wrap items-center mb-5 text-lg md:mb-0 md:pl-8 md:ml-8 md:border-l md:border-gray-800">
|
|
||||||
<a href="{{ route('school.table.city', ['country' => $c, '#table']) }}"
|
|
||||||
class="{{ request()->routeIs('school.table.city') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Städte</a>
|
|
||||||
<a href="{{ route('school.table.lecturer', ['country' => $c, '#table']) }}"
|
|
||||||
class="{{ request()->routeIs('school.table.lecturer') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Dozenten</a>
|
|
||||||
<a href="{{ route('school.table.venue', ['country' => $c, '#table']) }}"
|
|
||||||
class="{{ request()->routeIs('school.table.venue') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Veranstaltungs-Orte</a>
|
|
||||||
<a href="{{ route('school.table.course', ['country' => $c, '#table']) }}"
|
|
||||||
class="{{ request()->routeIs('school.table.course') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Kurse</a>
|
|
||||||
<a href="{{ route('school.table.event', ['country' => $c, '#table']) }}"
|
|
||||||
class="{{ request()->routeIs('school.table.event') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Termine</a>
|
|
||||||
<a href="{{ route('library.table.libraryItems', ['country' => $c]) }}"
|
|
||||||
class="{{ request()->routeIs('library.table.libraryItems') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Bibliothek</a>
|
|
||||||
<a href="{{ route('bookCases.table.bookcases', ['country' => $c]) }}"
|
|
||||||
class="{{ request()->routeIs('bookCases.table.bookcases') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Bücher-Schränke</a>
|
|
||||||
@if(auth()->user()?->is_lecturer)
|
|
||||||
<a href="{{ route('library.table.lecturer', ['country' => $c]) }}"
|
|
||||||
class="{{ request()->routeIs('library.table.lecturer') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">Dozenten-Bibliothek</a>
|
|
||||||
@endif
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
@auth
|
|
||||||
<div></div>
|
|
||||||
@else
|
|
||||||
<div class="inline-flex items-center ml-5 my-2 text-lg space-x-6 lg:justify-end">
|
|
||||||
<a href="{{ route('auth.ln') }}"
|
|
||||||
class="text-xs sm:text-base font-medium leading-6 text-gray-400 hover:text-gray-300 whitespace-no-wrap transition duration-150 ease-in-out">
|
|
||||||
Login
|
|
||||||
</a>
|
|
||||||
<a href="{{ route('auth.ln') }}"
|
|
||||||
class="text-xs sm:text-base inline-flex items-center justify-center px-4 py-2 font-medium leading-6 text-gray-200 hover:text-white whitespace-no-wrap bg-gray-800 border border-transparent rounded shadow-sm hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-800">
|
|
||||||
Registrieren
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
@endauth
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
{{-- MAIN --}}
|
{{-- MAIN --}}
|
||||||
<section class="w-full mb-12">
|
<section class="w-full mb-12">
|
||||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10">
|
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10">
|
||||||
@@ -240,19 +178,19 @@
|
|||||||
|
|
||||||
<div class="rounded" wire:ignore>
|
<div class="rounded" wire:ignore>
|
||||||
@map([
|
@map([
|
||||||
'lat' => $bookCase->latitude,
|
'lat' => $bookCase->latitude,
|
||||||
'lng' => $bookCase->longitude,
|
'lng' => $bookCase->longitude,
|
||||||
'zoom' => 24,
|
'zoom' => 24,
|
||||||
'markers' => [
|
'markers' => [
|
||||||
[
|
[
|
||||||
'title' => $bookCase->title,
|
'title' => $bookCase->title,
|
||||||
'lat' => $bookCase->latitude,
|
'lat' => $bookCase->latitude,
|
||||||
'lng' => $bookCase->longitude,
|
'lng' => $bookCase->longitude,
|
||||||
'url' => 'https://gonoware.com',
|
'url' => 'https://gonoware.com',
|
||||||
'icon' => asset('img/btc-logo-6219386_1280.png'),
|
'icon' => asset('img/btc-logo-6219386_1280.png'),
|
||||||
'icon_size' => [42, 42],
|
'icon_size' => [42, 42],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
67
resources/views/livewire/book-case/highscore-table.blade.php
Normal file
67
resources/views/livewire/book-case/highscore-table.blade.php
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<div class="bg-21gray flex flex-col h-screen justify-between">
|
||||||
|
{{-- HEADER --}}
|
||||||
|
<livewire:frontend.header :country="$country"/>
|
||||||
|
{{-- 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">
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="w-1/2">
|
||||||
|
<h1 class="mb-6 text-5xl font-extrabold leading-none max-w-5xl mx-auto tracking-normal text-gray-200 sm:text-6xl md:text-6xl lg:text-7xl md:tracking-tight">
|
||||||
|
Orange-Pill <span
|
||||||
|
class="w-full text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-amber-500 to-amber-200 lg:inline">{{ __('Highscore Table') }}</span>
|
||||||
|
</h1>
|
||||||
|
<p class="px-0 mb-6 text-lg text-gray-600 md:text-xl">
|
||||||
|
{{ __('Hall of fame of our honorable plebs') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul role="list" class="grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
|
||||||
|
|
||||||
|
@foreach($plebs as $pleb)
|
||||||
|
<li class="col-span-1 flex flex-col divide-y divide-gray-200 rounded-lg bg-amber-200 text-center shadow">
|
||||||
|
<div class="flex flex-1 flex-col p-8">
|
||||||
|
<img class="mx-auto h-32 w-32 flex-shrink-0 rounded-full"
|
||||||
|
src="{{ $pleb->profile_photo_url }}" alt="{{ $pleb->name }}">
|
||||||
|
<h3 class="mt-6 text-sm font-medium text-gray-900 truncate">{{ $pleb->public_key }}</h3>
|
||||||
|
<dl class="mt-1 flex flex-grow flex-col justify-between">
|
||||||
|
<dd class="text-sm text-gray-500">{{ $pleb->orange_pills_count }} {{ __('Bookcases') }} {{ __('Orange pilled') }}</dd>
|
||||||
|
<dd class="mt-3">
|
||||||
|
<span class="rounded-full bg-21gray px-2 py-1 text-xs font-medium text-gray-200">{{ __('Points') }}: {{ $pleb->getPoints() }}</span>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
{{--<div>
|
||||||
|
<div class="-mt-px flex divide-x divide-gray-200">
|
||||||
|
<div class="flex w-0 flex-1">
|
||||||
|
<a href="mailto:janecooper@example.com" class="relative -mr-px inline-flex w-0 flex-1 items-center justify-center rounded-bl-lg border border-transparent py-4 text-sm font-medium text-gray-700 hover:text-gray-500">
|
||||||
|
<!-- Heroicon name: mini/envelope -->
|
||||||
|
<svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path d="M3 4a2 2 0 00-2 2v1.161l8.441 4.221a1.25 1.25 0 001.118 0L19 7.162V6a2 2 0 00-2-2H3z" />
|
||||||
|
<path d="M19 8.839l-7.77 3.885a2.75 2.75 0 01-2.46 0L1 8.839V14a2 2 0 002 2h14a2 2 0 002-2V8.839z" />
|
||||||
|
</svg>
|
||||||
|
<span class="ml-3">Email</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="-ml-px flex w-0 flex-1">
|
||||||
|
<a href="tel:+1-202-555-0170" class="relative inline-flex w-0 flex-1 items-center justify-center rounded-br-lg border border-transparent py-4 text-sm font-medium text-gray-700 hover:text-gray-500">
|
||||||
|
<!-- Heroicon name: mini/phone -->
|
||||||
|
<svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd" d="M2 3.5A1.5 1.5 0 013.5 2h1.148a1.5 1.5 0 011.465 1.175l.716 3.223a1.5 1.5 0 01-1.052 1.767l-.933.267c-.41.117-.643.555-.48.95a11.542 11.542 0 006.254 6.254c.395.163.833-.07.95-.48l.267-.933a1.5 1.5 0 011.767-1.052l3.223.716A1.5 1.5 0 0118 15.352V16.5a1.5 1.5 0 01-1.5 1.5H15c-1.149 0-2.263-.15-3.326-.43A13.022 13.022 0 012.43 8.326 13.019 13.019 0 012 5V3.5z" clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
<span class="ml-3">Call</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>--}}
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{{-- FOOTER --}}
|
||||||
|
<livewire:frontend.footer/>
|
||||||
|
</div>
|
||||||
@@ -59,6 +59,10 @@
|
|||||||
class="{{ request()->routeIs('bookCases.table.bookcases') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">
|
class="{{ request()->routeIs('bookCases.table.bookcases') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">
|
||||||
{{ __('Bookcases') }}
|
{{ __('Bookcases') }}
|
||||||
</a>
|
</a>
|
||||||
|
<a href="{{ route('bookCases.highScoreTable', ['country' => $c]) }}"
|
||||||
|
class="{{ request()->routeIs('bookCases.highScoreTable') ? 'text-amber-500 underline' : 'text-gray-400' }} mr-5 font-medium leading-6 hover:text-gray-300">
|
||||||
|
{{ __('Highscore Table') }}
|
||||||
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@if(str(request()->route()->getName())->contains('meetup.'))
|
@if(str(request()->route()->getName())->contains('meetup.'))
|
||||||
<a href="{{ route('meetup.world', ['country' => $c]) }}"
|
<a href="{{ route('meetup.world', ['country' => $c]) }}"
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ Route::middleware([])
|
|||||||
|
|
||||||
Route::get('/book-case/{bookCase}', \App\Http\Livewire\BookCase\CommentBookCase::class)
|
Route::get('/book-case/{bookCase}', \App\Http\Livewire\BookCase\CommentBookCase::class)
|
||||||
->name('comment.bookcase');
|
->name('comment.bookcase');
|
||||||
|
|
||||||
|
Route::get('/high-score-table', \App\Http\Livewire\BookCase\HighscoreTable::class)
|
||||||
|
->name('highScoreTable');
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user