mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
add models, setup livewire, setup mongodb
This commit is contained in:
parent
c0590a3412
commit
be4c848eee
27 changed files with 2508 additions and 0 deletions
17
resources/views/livewire/app/home.blade.php
Normal file
17
resources/views/livewire/app/home.blade.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<div class="wa-stack wa-gap-3xl">
|
||||
<div class="wa-grid">
|
||||
{{-- <h1 class="wa-cluster">--}}
|
||||
{{-- <wa-icon name="paw-simple"></wa-icon>--}}
|
||||
{{-- {{ config('app.name') }}--}}
|
||||
{{-- </h1>--}}
|
||||
<h1>{{ config('app.name') }}</h1>
|
||||
|
||||
@auth
|
||||
<wa-input placeholder="Search for posts, tags, users, etc.">
|
||||
<wa-icon slot="prefix" name="magnifying-glass"></wa-icon>
|
||||
</wa-input>
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
<livewire:post-feature />
|
||||
</div>
|
||||
42
resources/views/livewire/app/navbar.blade.php
Normal file
42
resources/views/livewire/app/navbar.blade.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<div class="wa-split">
|
||||
<div class="wa-cluster wa-align-items-center">
|
||||
<wa-icon-button
|
||||
href="{{ route('home') }}"
|
||||
name="paw-simple"
|
||||
appearance="plain"
|
||||
style="font-size: 1.5rem;"
|
||||
wire:navigate.hover>
|
||||
</wa-icon-button>
|
||||
|
||||
@auth
|
||||
<wa-button appearance="plain" href="{{ route('posts.home') }}" wire:navigate.hover>
|
||||
<wa-icon slot="prefix" name="images"></wa-icon>
|
||||
Posts
|
||||
</wa-button>
|
||||
|
||||
<wa-button appearance="plain" href="{{ route('upload') }}" wire:navigate.hover>
|
||||
<wa-icon slot="prefix" name="arrow-up-from-bracket"></wa-icon>
|
||||
Upload
|
||||
</wa-button>
|
||||
|
||||
<wa-button appearance="plain">
|
||||
<wa-icon slot="prefix" name="tags"></wa-icon>
|
||||
Tags
|
||||
</wa-button>
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
<div class="wa-cluster">
|
||||
@guest
|
||||
<wa-button href="{{ route('login') }}" appearance="plain">
|
||||
<wa-icon slot="prefix" name="arrow-right-to-bracket"></wa-icon>
|
||||
Sign in
|
||||
</wa-button>
|
||||
@endguest
|
||||
|
||||
@auth
|
||||
<wa-button appearance="plain">{{ Auth::user()->name }}</wa-button>
|
||||
<wa-icon-button href="{{ route('logout') }}" appearance="plain" name="arrow-left-from-bracket"></wa-icon-button>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
23
resources/views/livewire/pages/upload.blade.php
Normal file
23
resources/views/livewire/pages/upload.blade.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<div class="wa-stack wa-gap-3xl">
|
||||
<h1>Upload</h1>
|
||||
|
||||
<form wire:submit="createPost" class="wa-stack wa-gap-xl">
|
||||
<wa-card>
|
||||
<input wire:model="file" type="file" label="file" placeholder="Select a file to upload." />
|
||||
@error('file')
|
||||
<span class="wa-caption-m">{{ $message }}</span>
|
||||
@enderror
|
||||
</wa-card>
|
||||
|
||||
<wa-select wire:model="rating" label="Rating" value="safe" hint="Select a content rating that matches the file.">
|
||||
<wa-option value="safe">Safe</wa-option>
|
||||
<wa-option value="suggestive">Suggestive</wa-option>
|
||||
<wa-option value="explicit">Explicit</wa-option>
|
||||
</wa-select>
|
||||
|
||||
<wa-button type="submit" variant="brand" wire:loading.attr="disabled">
|
||||
<wa-icon slot="prefix" name="arrow-up-from-bracket"></wa-icon>
|
||||
Upload
|
||||
</wa-button>
|
||||
</form>
|
||||
</div>
|
||||
6
resources/views/livewire/post-feature.blade.php
Normal file
6
resources/views/livewire/post-feature.blade.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<div class="wa-stack" style="max-height: 80vh;">
|
||||
<a href="{{ url("posts/$post->id") }}" class="wa-frame wa-border-radius-l" style="max-inline-size: 100%; {{ $post->getAspectRatio() }}" wire:navigate.hover>
|
||||
<img src="{{ $post->getPreviewUrl() }}" />
|
||||
</a>
|
||||
<span class="wa-caption-m">-{{ $post->user->name }}, <wa-format-date></wa-format-date></span>
|
||||
</div>
|
||||
49
resources/views/livewire/posts/edit.blade.php
Normal file
49
resources/views/livewire/posts/edit.blade.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<div class="wa-flank wa-align-items-start wa-gap-3xl" style="--flank-size: 20rem;">
|
||||
|
||||
{{-- Sidebar --}}
|
||||
<div class="wa-stack" wire:poll>
|
||||
|
||||
<div class="wa-cluster">
|
||||
<span class="wa-caption-m">Changes are automatically saved.</span>
|
||||
<wa-button href="{{ url("posts/$post->id") }}" appearance="outlined" variant="neutral" size="small" wire:navigate.hover>
|
||||
<wa-icon slot="prefix" name="check"></wa-icon>
|
||||
<span>Finish</span>
|
||||
</wa-button>
|
||||
</div>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
|
||||
<form wire:submit class="wa-stack">
|
||||
<wa-select wire:model.live="rating" label="Rating" value="{{ $post->rating }}" wire:loading.attr="disabled" @error('rating') hint="{{ $message }}" @enderror>
|
||||
<wa-option value="safe">Safe</wa-option>
|
||||
<wa-option value="suggestive">Suggestive</wa-option>
|
||||
<wa-option value="explicit">Explicit</wa-option>
|
||||
</wa-select>
|
||||
|
||||
@if ($post->rating == 'safe')
|
||||
<wa-switch
|
||||
wire:model.live="featured"
|
||||
{{ $post->featured ? 'checked' : '' }}
|
||||
wire:loading.attr="disabled"
|
||||
hint="Featured posts will be randomly selected to show on the front page.">
|
||||
Feature post
|
||||
</wa-switch>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
|
||||
{{-- Tags --}}
|
||||
<div class="wa-cluster wa-heading-m">
|
||||
<wa-icon fixed-width name="tags"></wa-icon>
|
||||
<span>Tags</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Main content --}}
|
||||
<div class="wa-stack wa-gap-2xl" wire:poll>
|
||||
<livewire:posts.image :$post lazy />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
5
resources/views/livewire/posts/image.blade.php
Normal file
5
resources/views/livewire/posts/image.blade.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<div class="wa-stack" style="display: flex; align-items: center; justify-content: center; max-height: 80vh;">
|
||||
<div class="wa-frame wa-border-radius-l" style="max-inline-size: 100%; {{ $post->getAspectRatio() }}">
|
||||
<img src="{{ $post->getPreviewUrl() }}" />
|
||||
</div>
|
||||
</div>
|
||||
8
resources/views/livewire/posts/index.blade.php
Normal file
8
resources/views/livewire/posts/index.blade.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<div class="wa-stack wa-gap-3xl">
|
||||
<h1>Posts</h1>
|
||||
<div class="wa-cluster wa-gap-s">
|
||||
@foreach ($posts as $post)
|
||||
<livewire:posts.thumbnail :$post lazy />
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
10
resources/views/livewire/posts/thumbnail.blade.php
Normal file
10
resources/views/livewire/posts/thumbnail.blade.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<div style="max-inline-size: 256px;">
|
||||
<a
|
||||
id="post_{{ $post->id }}"
|
||||
href="{{ url("posts/$post->id") }}"
|
||||
class="wa-frame wa-border-radius-l"
|
||||
style="border: 2px solid var(--wa-color-{{ $post->getRatingColor() }}-border-loud);"
|
||||
wire:navigate.hover>
|
||||
<img src="{{ $post->getThumbUrl() }}" />
|
||||
</a>
|
||||
</div>
|
||||
72
resources/views/livewire/posts/view.blade.php
Normal file
72
resources/views/livewire/posts/view.blade.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<div class="wa-flank wa-align-items-start wa-gap-3xl" style="--flank-size: 20rem;">
|
||||
|
||||
{{-- Sidebar --}}
|
||||
<div class="wa-stack" wire:poll>
|
||||
|
||||
{{-- Post navigation --}}
|
||||
<div class="wa-cluster">
|
||||
@if ($prev = $post->getPreviousPost())
|
||||
<wa-icon-button href="{{ url("posts/$prev->id") }}" name="arrow-left" style="color: var(--wa-color-text-link);" wire:navigate.hover></wa-icon-button>
|
||||
@else
|
||||
<wa-icon-button name="arrow-left" disabled></wa-icon-button>
|
||||
@endif
|
||||
|
||||
@if ($next = $post->getNextPost())
|
||||
<wa-icon-button href="{{ url("posts/$next->id") }}" name="arrow-right" style="color: var(--wa-color-text-link);" wire:navigate.hover></wa-icon-button>
|
||||
@else
|
||||
<wa-icon-button name="arrow-right" disabled></wa-icon-button>
|
||||
@endif
|
||||
|
||||
<wa-icon-button href="{{ url("posts/$post->id/edit") }}" name="file-pen" style="color: var(--wa-color-text-link);" wire:navigate.hover></wa-icon-button>
|
||||
<wa-icon-button href="{{ url("posts/$post->id/download") }}" name="download" style="color: var(--wa-color-text-link);"></wa-icon-button>
|
||||
</div>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
|
||||
{{-- Post ID --}}
|
||||
<div class="wa-cluster">
|
||||
<wa-icon fixed-width name="hashtag"></wa-icon>
|
||||
<span>{{ $post->id }}</span>
|
||||
</div>
|
||||
|
||||
{{-- Post author --}}
|
||||
<div class="wa-cluster">
|
||||
<wa-icon fixed-width name="user"></wa-icon>
|
||||
<span>{{ $post->user->name }}</span>
|
||||
</div>
|
||||
|
||||
{{-- Post upload date --}}
|
||||
<div class="wa-cluster">
|
||||
<wa-icon fixed-width name="calendar"></wa-icon>
|
||||
<wa-format-date
|
||||
month="numeric"
|
||||
day="numeric"
|
||||
year="numeric"
|
||||
hour="numeric"
|
||||
minute="numeric"
|
||||
date="{{ $post->created_at }}">
|
||||
</wa-format-date>
|
||||
</div>
|
||||
|
||||
{{-- Post rating --}}
|
||||
<div class="wa-cluster">
|
||||
<wa-icon fixed-width name="face-hand-peeking"></wa-icon>
|
||||
<span style="color: var(--wa-color-{{ $post->getRatingColor() }}-on-normal);">{{ $post->rating }}</span>
|
||||
</div>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
|
||||
{{-- Tags --}}
|
||||
<div class="wa-cluster wa-heading-m">
|
||||
<wa-icon fixed-width name="tags"></wa-icon>
|
||||
<span>Tags</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Main content --}}
|
||||
<div class="wa-stack wa-gap-2xl" wire:poll>
|
||||
<livewire:posts.image :$post lazy />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue