Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Nov 24, 2023
1 parent e5945c9 commit 0e26f1e
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 98 deletions.
19 changes: 18 additions & 1 deletion app/Http/Controllers/MeetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,24 @@ class MeetController extends Controller
{
public function index()
{
return view('meet.index');
$most = Meet::whereDate('start_date', '>=', now())
->orderBy('start_date', 'asc')
->first();

$actual = Meet::whereDate('start_date', '>=', now())
->where('id', '!=', $most->id)
->orderBy('start_date', 'asc')
->get();

$past = Meet::whereDate('start_date', '<', now())
->orderBy('start_date', 'desc')
->simplePaginate(5);

return view('meet.index', [
'most' => $most,
'actual' => $actual,
'past' => $past,
]);
}

public function edit(Request $request, Meet $meet)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private function getPosts(User $owner, PostTypeEnum $type, User $user){
return $user->attachLikeStatus($posts);
}

public function events(User $user, Request $request)
public function meets(User $user, Request $request)
{
$meets = $user->meets()->latest()
->cursorPaginate(2);
Expand Down
4 changes: 4 additions & 0 deletions app/Models/Meet.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class Meet extends Model
'link',
];

protected $casts = [
'start_date' => 'datetime',
];

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
Expand Down
3 changes: 2 additions & 1 deletion resources/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ $font-family-sans-serif:
'Segoe UI Symbol',
'Noto Color Emoji';

$headings-font-family: 'Raleway';
$headings-font-family: 'Raleway', system-ui;
$btn-font-family: 'Raleway', system-ui;

$btn-border-radius: 0.75rem;
$border-width: 2px;
Expand Down
164 changes: 74 additions & 90 deletions resources/views/meet/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,83 @@

@section('content')



<x-header>
<x-slot:sup>Нельзя пропустить</x-slot>
<x-slot:title>Ни одна PHP конференция не обойдется без Laravel</x-slot>
<x-slot:description>
Рассказать, что Laravel на столько популярен в мире PHP что нет какой-либо конференции, где не спикеры
не упоминали Laravel
</x-slot>

<x-slot:content>
<div class="bg-dark-subtle dashed p-4 rounded position-relative">
<a href="#" class="position-absolute start-0 end-0 top-0 bottom-0 z-1"></a>

<div class="row g-4 justify-content-between align-items-center">
<div class="col-sm-7">
<div class="row g-3">

<div class="col-12">
<h4 class="mb-0">PHP Russia</h4>
</div>

<!-- Date -->
<div class="col-6">
<small class="text-muted">Дата</small>
<h6>11 Ноября</h6>
@if($past->currentPage() === 1)
<x-header>
<x-slot:sup>Нельзя пропустить</x-slot>
<x-slot:title>Не обойдется без Laravel</x-slot>
<x-slot:description>
Ни одна PHP конференция не обходится без упоминания Laravel.
Это самый популярный фреймворк в мире PHP.
</x-slot>

@if($most)
<x-slot:content>
<div class="bg-dark-subtle dashed p-4 rounded position-relative">
<a href="{{ $most->link }}" class="position-absolute start-0 end-0 top-0 bottom-0 z-1"></a>

<div class="row g-4 justify-content-between align-items-center">
<div class="col-sm-7">
<div class="row g-3">

<div class="col-12">
<h4 class="mb-0">{{ $most->name }}</h4>
</div>

<!-- Date -->
<div class="col-6">
<small class="text-muted">Дата</small>
<h6>{{ $most->start_date->isoFormat('DD MMMM', 'Do MMMM') }}</h6>
</div>
<!-- Time -->
<div class="col-6">
<small class="text-muted">Время</small>
<h6>Начало в {{ $most->start_date->isoFormat('hh:mm', 'Do MMMM') }}</h6>
</div>
<!-- Address -->
<div class="col-12">
<small class="text-muted">Адрес</small>
<h6>{{ $most->address }}</h6>
</div>
</div>
</div>
<!-- Time -->
<div class="col-6">
<small class="text-muted">Время</small>
<h6>Начало в 9 утра</h6>
</div>
<!-- Address -->
<div class="col-12">
<small class="text-muted">Адрес</small>
<h6>Москва, Крокус Сити Хол</h6>
<div class="col-sm-5 text-center">
<div class="ticket-border">
<!-- QR code -->
<img class="img-fluid mx-auto user-select-none rounded" src="https://chart.googleapis.com/chart?cht=qr&chl={{ urlencode($most->link) }}&chs=500x500" alt="">
</div>
</div>
</div>
</div>
<div class="col-sm-5 text-center">
<div class="ticket-border">
<!-- QR code -->
<img class="img-fluid mx-auto user-select-none" src="/img/qr-code.svg" alt="">
</div>
</x-slot:content>
@endif
</x-header>

<div class="container py-5">
<div class="row row-cols-lg-3 gy-0 position-relative">
@foreach($actual as $meet)
<div class="col position-relative">
@if($loop->first)
<figure class="position-absolute top-0 start-0 translate-middle z-n1 ms-4">
<x-icon path="l.cube" width="46" height="53" fill="none"/>
</figure>
@endif
@include('particles.meet', ['meet' => $meet])
</div>
</div>
</div>
</x-slot:content>
</x-header>
@endforeach

@if($actual->count() % 3 !== 0)
<x-icon path="l.dots" class="text-primary opacity-2 opacity-25 col" height="400" width="100%" />

@if($actual->count() % 4 === 0)
<x-icon path="l.dots" class="text-primary opacity-2 opacity-25 col" height="400" width="100%" />
@endif
@endif
</div>
</div>
@endif

<div class="container py-5">

<div class="container py-5">
<div class="row g-5 justify-content-center align-items-start position-relative mb-5">
<div class="col-xl-4 position-sticky top-0 py-3">
<div class="mb-4">
Expand All @@ -74,53 +97,14 @@
<p class="mb-0">Чтобы вы не сожалели о пропущенных конференциях, мы оставили записи с этих событий.</p>
</div>
<div class="col-xl-8 text-center text-xl-start">
<div class="bg-body-tertiary p-5 rounded-5 shadow mb-5">
<span class="opacity-50">Ульяновск, Главклуб</span>
<h5 class="my-3">Summer Merge</h5>
<p>
В этом году PHP Russia пройдет в рамках HighLoad++ 2022. 30 докладов, 2 круглых стола, ревью
резюме, unconference и митапы. Поговорим о тестировании, качестве, лучших практиках, архитектуре
и фреймворках, добавим хардкора.
</p>

<a href="#" class="btn btn-outline-primary">Как это было</a>
</div>

<div class="bg-body-tertiary p-5 rounded-5 shadow mb-5">
<span class="opacity-50">Ульяновск, Главклуб</span>
<h5 class="my-3">Summer Merge</h5>
<p>
В этом году PHP Russia пройдет в рамках HighLoad++ 2022. 30 докладов, 2 круглых стола, ревью
резюме, unconference и митапы. Поговорим о тестировании, качестве, лучших практиках, архитектуре
и фреймворках, добавим хардкора.
</p>

<a href="#" class="btn btn-outline-primary">Как это было</a>
</div>

<div class="bg-body-tertiary p-5 rounded-5 shadow mb-5">
<span class="opacity-50">Ульяновск, Главклуб</span>
<h5 class="my-3">Summer Merge</h5>
<p>
В этом году PHP Russia пройдет в рамках HighLoad++ 2022. 30 докладов, 2 круглых стола, ревью
резюме, unconference и митапы. Поговорим о тестировании, качестве, лучших практиках, архитектуре
и фреймворках, добавим хардкора.
</p>

<a href="#" class="btn btn-outline-primary">Как это было</a>
</div>

<div class="bg-body-tertiary p-5 rounded-5 shadow mb-5">
<span class="opacity-50">Ульяновск, Главклуб</span>
<h5 class="my-3">Summer Merge</h5>
<p>
В этом году PHP Russia пройдет в рамках HighLoad++ 2022. 30 докладов, 2 круглых стола, ревью
резюме, unconference и митапы. Поговорим о тестировании, качестве, лучших практиках, архитектуре
и фреймворках, добавим хардкора.
</p>
@foreach($past as $meet)
<div class="col">
@include('particles.meet', ['meet' => $meet])
</div>
@endforeach

<a href="#" class="btn btn-outline-primary">Как это было</a>
</div>
{!! $past->links() !!}
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions resources/views/profile/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
>Награды</a>
</li>
<li class="nav-item me-2">
<a class="nav-link link-body-emphasis fw-normal {{ active('profile.events') }}"
href="{{ route('profile.events', $user) }}"
<a class="nav-link link-body-emphasis fw-normal {{ active('profile.meets') }}"
href="{{ route('profile.meets', $user) }}"
>События</a>
</li>
</div>
Expand Down
4 changes: 2 additions & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@
Route::get('/profile/{user:nickname}/awards',[\App\Http\Controllers\ProfileController::class,'awards'])
->name('profile.awards');

Route::get('/profile/{user:nickname}/events',[\App\Http\Controllers\ProfileController::class,'events'])
->name('profile.events');
Route::get('/profile/{user:nickname}/meets',[\App\Http\Controllers\ProfileController::class,'meets'])
->name('profile.meets');


/*
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
refresh: true,
}),
prismjsPlugin({
languages: ["php", "php-extras", "javascript", "json", "sql", "shell", "bash", "markup", "html", "clike", "phpdoc"],
languages: ["php", "php-extras", "javascript", "json", "sql", "shell", "bash", "markup", "html", "clike", "phpdoc", "yml", "nginx", "sass", "scss", "css"],
plugins: [],
//theme: "twilight",
css: false,
Expand Down

0 comments on commit 0e26f1e

Please sign in to comment.