mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
Compare commits
No commits in common. "1442dbfa60d6951cb96c24ddd7acc8dd294842ae" and "b04a0daf388752060c96d5f33328bace5a07091d" have entirely different histories.
1442dbfa60
...
b04a0daf38
31 changed files with 85 additions and 10320 deletions
|
|
@ -9,6 +9,7 @@
|
|||
/storage/*.key
|
||||
/vendor
|
||||
.env
|
||||
.env.example
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpunit.result.cache
|
||||
|
|
|
|||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -21,7 +21,4 @@ yarn-error.log
|
|||
/.nova
|
||||
/.vscode
|
||||
/.zed
|
||||
|
||||
**/caddy
|
||||
frankenphp
|
||||
frankenphp-worker.php
|
||||
composer.lock
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\App;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Footer extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.app.footer');
|
||||
}
|
||||
}
|
||||
|
|
@ -7,12 +7,16 @@ use Livewire\Component;
|
|||
|
||||
class Pfp extends Component
|
||||
{
|
||||
public User $user;
|
||||
public string $user = '';
|
||||
public string $size = '3rem';
|
||||
public string $shape = 'rounded';
|
||||
public string $shape = 'circle';
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.app.pfp');
|
||||
$u = User::find($this->user);
|
||||
return view('livewire.app.pfp', [
|
||||
'pfp' => $u->getAvatarBase64(),
|
||||
'name' => $u->name,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\App;
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
|
||||
class UserCard extends Component
|
||||
{
|
||||
public User $user;
|
||||
|
||||
public function placeholder()
|
||||
{
|
||||
return <<<HTML
|
||||
<article class="wa-stack">
|
||||
<div class="wa-frame wa-border-radius-l">
|
||||
<wa-spinner style="font-size: 2rem;"></wa-spinner>
|
||||
</div>
|
||||
<div class="wa-stack wa-gap-3xs">
|
||||
<wa-skeleton effect="pulse"></wa-skeleton>
|
||||
<wa-skeleton effect="pulse"></wa-skeleton>
|
||||
</div>
|
||||
</article>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.app.user-card');
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ class Upload extends Component
|
|||
{
|
||||
use WithFileUploads;
|
||||
|
||||
#[Validate('image|max:65536')]
|
||||
#[Validate('image|max:10240')]
|
||||
public $file;
|
||||
|
||||
#[Validate('required|in:safe,suggestive,explicit')]
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Pages;
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
|
||||
class Users extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.pages.users', [ 'users' => User::all() ]);
|
||||
}
|
||||
}
|
||||
|
|
@ -20,18 +20,6 @@ class PostFeature extends Component
|
|||
})->first();
|
||||
}
|
||||
|
||||
public function placeholder()
|
||||
{
|
||||
return <<<HTML
|
||||
<div class="wa-stack" style="max-height: 80vh;">
|
||||
<div class="wa-frame wa-border-radius-l">
|
||||
<wa-spinner style="font-size: 3rem; --track-width: 10px;"></wa-spinner>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
if ($this->post == null)
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Posts;
|
||||
|
||||
use App\Models\Post;
|
||||
use Livewire\Component;
|
||||
|
||||
class FullImage extends Component
|
||||
{
|
||||
public Post $post;
|
||||
|
||||
public function placeholder()
|
||||
{
|
||||
return <<<'HTML'
|
||||
<div class="wa-frame wa-border-radius-l" style="max-inline-size: 100%; aspect-ratio: 1280/720;">
|
||||
<wa-spinner style="font-size: 3rem; --track-width: 10px;"></wa-spinner>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.posts.full-image');
|
||||
}
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ class Image extends Component
|
|||
return <<<'HTML'
|
||||
<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%;">
|
||||
<wa-spinner style="font-size: 3rem; --track-width: 10px;"></wa-spinner>
|
||||
<wa-spinner></wa-spinner>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||
}
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
$middleware->trustProxies(at: '*');
|
||||
//
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
|
|
|
|||
|
|
@ -11,10 +11,8 @@
|
|||
"require": {
|
||||
"php": "^8.2",
|
||||
"ext-gmp": "*",
|
||||
"intervention/image-driver-vips": "^1.0",
|
||||
"intervention/image-laravel": "^1.5",
|
||||
"laravel/framework": "^12.0",
|
||||
"laravel/octane": "^2.9",
|
||||
"laravel/sanctum": "^4.0",
|
||||
"laravel/tinker": "^2.10.1",
|
||||
"league/flysystem": "^3.29",
|
||||
|
|
|
|||
9852
composer.lock
generated
9852
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,224 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Laravel\Octane\Contracts\OperationTerminated;
|
||||
use Laravel\Octane\Events\RequestHandled;
|
||||
use Laravel\Octane\Events\RequestReceived;
|
||||
use Laravel\Octane\Events\RequestTerminated;
|
||||
use Laravel\Octane\Events\TaskReceived;
|
||||
use Laravel\Octane\Events\TaskTerminated;
|
||||
use Laravel\Octane\Events\TickReceived;
|
||||
use Laravel\Octane\Events\TickTerminated;
|
||||
use Laravel\Octane\Events\WorkerErrorOccurred;
|
||||
use Laravel\Octane\Events\WorkerStarting;
|
||||
use Laravel\Octane\Events\WorkerStopping;
|
||||
use Laravel\Octane\Listeners\CloseMonologHandlers;
|
||||
use Laravel\Octane\Listeners\CollectGarbage;
|
||||
use Laravel\Octane\Listeners\DisconnectFromDatabases;
|
||||
use Laravel\Octane\Listeners\EnsureUploadedFilesAreValid;
|
||||
use Laravel\Octane\Listeners\EnsureUploadedFilesCanBeMoved;
|
||||
use Laravel\Octane\Listeners\FlushOnce;
|
||||
use Laravel\Octane\Listeners\FlushTemporaryContainerInstances;
|
||||
use Laravel\Octane\Listeners\FlushUploadedFiles;
|
||||
use Laravel\Octane\Listeners\ReportException;
|
||||
use Laravel\Octane\Listeners\StopWorkerIfNecessary;
|
||||
use Laravel\Octane\Octane;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Octane Server
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the default "server" that will be used by Octane
|
||||
| when starting, restarting, or stopping your server via the CLI. You
|
||||
| are free to change this to the supported server of your choosing.
|
||||
|
|
||||
| Supported: "roadrunner", "swoole", "frankenphp"
|
||||
|
|
||||
*/
|
||||
|
||||
'server' => env('OCTANE_SERVER', 'frankenphp'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Force HTTPS
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this configuration value is set to "true", Octane will inform the
|
||||
| framework that all absolute links must be generated using the HTTPS
|
||||
| protocol. Otherwise your links may be generated using plain HTTP.
|
||||
|
|
||||
*/
|
||||
|
||||
'https' => env('OCTANE_HTTPS', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Octane Listeners
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All of the event listeners for Octane's events are defined below. These
|
||||
| listeners are responsible for resetting your application's state for
|
||||
| the next request. You may even add your own listeners to the list.
|
||||
|
|
||||
*/
|
||||
|
||||
'listeners' => [
|
||||
WorkerStarting::class => [
|
||||
EnsureUploadedFilesAreValid::class,
|
||||
EnsureUploadedFilesCanBeMoved::class,
|
||||
],
|
||||
|
||||
RequestReceived::class => [
|
||||
...Octane::prepareApplicationForNextOperation(),
|
||||
...Octane::prepareApplicationForNextRequest(),
|
||||
//
|
||||
],
|
||||
|
||||
RequestHandled::class => [
|
||||
//
|
||||
],
|
||||
|
||||
RequestTerminated::class => [
|
||||
// FlushUploadedFiles::class,
|
||||
],
|
||||
|
||||
TaskReceived::class => [
|
||||
...Octane::prepareApplicationForNextOperation(),
|
||||
//
|
||||
],
|
||||
|
||||
TaskTerminated::class => [
|
||||
//
|
||||
],
|
||||
|
||||
TickReceived::class => [
|
||||
...Octane::prepareApplicationForNextOperation(),
|
||||
//
|
||||
],
|
||||
|
||||
TickTerminated::class => [
|
||||
//
|
||||
],
|
||||
|
||||
OperationTerminated::class => [
|
||||
FlushOnce::class,
|
||||
FlushTemporaryContainerInstances::class,
|
||||
// DisconnectFromDatabases::class,
|
||||
// CollectGarbage::class,
|
||||
],
|
||||
|
||||
WorkerErrorOccurred::class => [
|
||||
ReportException::class,
|
||||
StopWorkerIfNecessary::class,
|
||||
],
|
||||
|
||||
WorkerStopping::class => [
|
||||
CloseMonologHandlers::class,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Warm / Flush Bindings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The bindings listed below will either be pre-warmed when a worker boots
|
||||
| or they will be flushed before every new request. Flushing a binding
|
||||
| will force the container to resolve that binding again when asked.
|
||||
|
|
||||
*/
|
||||
|
||||
'warm' => [
|
||||
...Octane::defaultServicesToWarm(),
|
||||
],
|
||||
|
||||
'flush' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Octane Swoole Tables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| While using Swoole, you may define additional tables as required by the
|
||||
| application. These tables can be used to store data that needs to be
|
||||
| quickly accessed by other workers on the particular Swoole server.
|
||||
|
|
||||
*/
|
||||
|
||||
'tables' => [
|
||||
'example:1000' => [
|
||||
'name' => 'string:1000',
|
||||
'votes' => 'int',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Octane Swoole Cache Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| While using Swoole, you may leverage the Octane cache, which is powered
|
||||
| by a Swoole table. You may set the maximum number of rows as well as
|
||||
| the number of bytes per row using the configuration options below.
|
||||
|
|
||||
*/
|
||||
|
||||
'cache' => [
|
||||
'rows' => 1000,
|
||||
'bytes' => 10000,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| File Watching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following list of files and directories will be watched when using
|
||||
| the --watch option offered by Octane. If any of the directories and
|
||||
| files are changed, Octane will automatically reload your workers.
|
||||
|
|
||||
*/
|
||||
|
||||
'watch' => [
|
||||
'app',
|
||||
'bootstrap',
|
||||
'config/**/*.php',
|
||||
'database/**/*.php',
|
||||
'public/**/*.php',
|
||||
'resources/**/*.php',
|
||||
'routes',
|
||||
'composer.lock',
|
||||
'.env',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Garbage Collection Threshold
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When executing long-lived PHP scripts such as Octane, memory can build
|
||||
| up before being cleared by PHP. You can force Octane to run garbage
|
||||
| collection if your application consumes this amount of megabytes.
|
||||
|
|
||||
*/
|
||||
|
||||
'garbage' => 50,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maximum Execution Time
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following setting configures the maximum execution time for requests
|
||||
| being handled by Octane. You may set this value to 0 to indicate that
|
||||
| there isn't a specific time limit on Octane request execution time.
|
||||
|
|
||||
*/
|
||||
|
||||
'max_execution_time' => 30,
|
||||
|
||||
];
|
||||
|
|
@ -1,27 +1,28 @@
|
|||
FROM dunglas/frankenphp
|
||||
# Stage 1: Build
|
||||
FROM joseluisq/php-fpm:8.4 AS build
|
||||
|
||||
# Copy php.ini
|
||||
COPY ./deploy/php.ini $PHP_INI_DIR/php.ini
|
||||
RUN apk add --no-cache nodejs npm
|
||||
|
||||
RUN apt update -y && apt install -y --no-install-recommends git nodejs npm
|
||||
COPY --from=composer:lts /usr/bin/composer /usr/bin/composer
|
||||
WORKDIR /var/www/html
|
||||
COPY --chown=www-data:www-data . .
|
||||
|
||||
RUN install-php-extensions \
|
||||
gd \
|
||||
opcache \
|
||||
redis \
|
||||
mongodb \
|
||||
pcntl \
|
||||
gmp \
|
||||
imagick \
|
||||
zip
|
||||
RUN chmod -R 775 /var/www/html/storage \
|
||||
&& chmod -R 775 /var/www/html/bootstrap/cache
|
||||
|
||||
COPY . /app
|
||||
RUN composer install --no-dev --prefer-dist \
|
||||
&& npm install \
|
||||
&& npm run build
|
||||
|
||||
RUN cp .env.example .env
|
||||
RUN sed -i'' -e 's/^APP_ENV=.*/APP_ENV=production/' -e 's/^APP_DEBUG=.*/APP_DEBUG=false/' .env
|
||||
RUN chown -R www-data:www-data /var/www/html/vendor \
|
||||
&& chmod -R 775 /var/www/html/vendor
|
||||
|
||||
RUN composer install --ignore-platform-reqs --no-dev -a
|
||||
RUN npm install && npm run build
|
||||
# Stage 2: Deploy
|
||||
FROM joseluisq/php-fpm:8.4
|
||||
|
||||
ENTRYPOINT ["php", "artisan", "octane:frankenphp", "--host=0.0.0.0"]
|
||||
COPY --from=build /var/www/html /var/www/html
|
||||
WORKDIR /var/www/html
|
||||
|
||||
VOLUME ["/var/www/html/storage/app"]
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=9000", "--tries=1"]
|
||||
|
|
|
|||
|
|
@ -7,9 +7,35 @@ services:
|
|||
context: ../
|
||||
dockerfile: ./deploy/Dockerfile
|
||||
volumes:
|
||||
- ..:/app
|
||||
- ../storage/app:/var/www/html/storage/app
|
||||
environment:
|
||||
APP_NAME: ${APP_NAME}
|
||||
APP_ENV: ${APP_ENV}
|
||||
APP_DEBUG: ${APP_DEBUG}
|
||||
APP_KEY: ${APP_KEY}
|
||||
APP_URL: ${APP_URL}
|
||||
DB_CONNECTION: ${DB_CONNECTION}
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_NAME: ${DB_NAME}
|
||||
AUTHENTIK_BASE_URL: ${AUTHENTIK_BASE_URL}
|
||||
AUTHENTIK_CLIENT_ID: ${AUTHENTIK_CLIENT_ID}
|
||||
AUTHENTIK_CLIENT_SECRET: ${AUTHENTIK_CLIENT_SECRET}
|
||||
AUTHENTIK_REDIRECT_URI: ${APP_URL}/auth/callback
|
||||
SESSION_DRIVER: ${SESSION_DRIVER}
|
||||
FILESYSTEM_DISK: ${FILESYSTEM_DISK}
|
||||
CACHE_STORE: ${CACHE_STORE}
|
||||
REDIS_CLIENT: ${REDIS_CLIENT}
|
||||
REDIS_HOST: ${REDIS_HOST}
|
||||
MAIL_MAILER: ${MAIL_MAILER}
|
||||
MAIL_SCHEME: ${MAIL_SCHEME}
|
||||
MAIL_HOST: ${MAIL_HOST}
|
||||
MAIL_PORT: ${MAIL_PORT}
|
||||
MAIL_USERNAME: ${MAIL_USERNAME}
|
||||
MAIL_PASSWORD: ${MAIL_PASSWORD}
|
||||
MAIL_FROM_ADDRESS: ${MAIL_FROM_ADDRESS}
|
||||
MAIL_FROM_NAME: ${MAIL_FROM_NAME}
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "9000:9000"
|
||||
networks:
|
||||
- nyaabooru-internal
|
||||
depends_on:
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
upload_max_filesize = 64M
|
||||
post_max_filesize = 72M
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
upload_max_filesize=64M
|
||||
post_max_filesize=72M
|
||||
|
|
@ -45,11 +45,6 @@ wa-page[view='mobile'] {
|
|||
border-block-end: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
|
||||
}
|
||||
|
||||
[slot='footer'] {
|
||||
--wa-link-decoration-default: none;
|
||||
border-block-start: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
|
||||
}
|
||||
|
||||
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
|
||||
@source '../../storage/framework/views/*.php';
|
||||
@source '../**/*.blade.php';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
<!doctype html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="wa-cloak wa-dark">
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="wa-dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||
<script type="module" src="https://early.webawesome.com/webawesome@3.0.0-alpha.13/dist/webawesome.loader.js" data-fa-kit-code="ba9cf75857"></script>
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
@livewireStyles
|
||||
|
|
@ -19,10 +18,6 @@
|
|||
<main>
|
||||
{{ $slot }}
|
||||
</main>
|
||||
|
||||
<footer slot="footer">
|
||||
@livewire('app.footer')
|
||||
</footer>
|
||||
</wa-page>
|
||||
|
||||
@stack('modals')
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
<div class="wa-split">
|
||||
<div class="wa-stack wa-gap-2xs">
|
||||
<div class="wa-cluster wa-heading-l">
|
||||
<wa-icon name="paw-simple"></wa-icon>
|
||||
<span>{{ config('app.name') }}</span>
|
||||
</div>
|
||||
<span class="wa-caption-l">© 2025 NyaaStudios; All rights reserved.</span>
|
||||
</div>
|
||||
<div class="wa-cluster wa-heading-m">
|
||||
<wa-icon-button family="brands" name="github" href="https://github.com/NyaaStudios/nyaabooru" target="_blank"></wa-icon-button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -11,5 +11,5 @@
|
|||
@endauth
|
||||
</div>
|
||||
|
||||
<livewire:post-feature lazy />
|
||||
<livewire:post-feature />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,11 +23,6 @@
|
|||
<wa-icon slot="prefix" name="tags"></wa-icon>
|
||||
Tags
|
||||
</wa-button>
|
||||
|
||||
<wa-button appearance="plain" href="{{ route('users') }}" wire:navigate.hover>
|
||||
<wa-icon slot="prefix" name="users"></wa-icon>
|
||||
Users
|
||||
</wa-button>
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
|
|
@ -41,15 +36,9 @@
|
|||
|
||||
@auth
|
||||
<wa-button href="{{ url('/profiles/' . Auth::id()) }}" appearance="plain" wire:navigate.hover>
|
||||
<div class="wa-cluster wa-align-items-center">
|
||||
<livewire:app.pfp :user="auth()->user()" size="2rem" shape="rounded" />
|
||||
{{ Auth::user()->name }}
|
||||
</div>
|
||||
</wa-button>
|
||||
<wa-button href="{{ route('logout') }}" appearance="plain">
|
||||
<wa-icon name="arrow-left-from-bracket" slot="prefix"></wa-icon>
|
||||
Sign out
|
||||
</wa-button>
|
||||
<wa-icon-button href="{{ route('logout') }}" appearance="plain" name="arrow-left-from-bracket"></wa-icon-button>
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,3 @@
|
|||
<wa-avatar
|
||||
@if(Illuminate\Support\Facades\Storage::has("avatars/$user->id"))
|
||||
image="{{ $user->getAvatarBase64() }}"
|
||||
@endif
|
||||
label="avatar for {{ $user->name }}"
|
||||
shape="{{ $shape }}"
|
||||
style="--size: {{ $size }}"
|
||||
></wa-avatar>
|
||||
<div>
|
||||
<wa-avatar image="{{ $pfp }}" label="{{ $name }}'s Profile Picture" shape="{{ $shape }}" loading="lazy" style="--size: {{ $size }}"></wa-avatar>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
<article class="wa-stack">
|
||||
<a class="wa-frame wa-border-radius-l" style="max-inline-size: 15rem;" href="{{ url("/profiles/$user->id") }}" wire:navigate.hover>
|
||||
@if (\Illuminate\Support\Facades\Storage::has("avatars/$user->id"))
|
||||
<img src="{{ $user->getAvatarBase64() }}"/>
|
||||
@else
|
||||
<wa-icon name="user"></wa-icon>
|
||||
@endif
|
||||
</a>
|
||||
<div class="wa-stack wa-gap-3xs">
|
||||
<span class="wa-heading-s">{{ $user->name }}</span>
|
||||
<span class="wa-caption-m">Joined <wa-format-date value="{{ $user->created_at }}"></wa-format-date></span>
|
||||
</div>
|
||||
</article>
|
||||
|
|
@ -1,11 +1,8 @@
|
|||
<div class="wa-stack wa-gap-3xl">
|
||||
<div class="wa-stack wa-gap-xl">
|
||||
<div class="wa-stack">
|
||||
<div class="wa-flank wa-align-items-center">
|
||||
<livewire:app.pfp :$user size="5rem" shape="rounded" />
|
||||
<div class="wa-stack wa-gap-2xs">
|
||||
<livewire:app.pfp user="{{ $user->id }}" size="5rem" shape="rounded" />
|
||||
<h1>{{ $user->name }}</h1>
|
||||
<span class="wa-caption-l">Member since <wa-format-date value="{{ $user->created_at }}"></wa-format-date></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wa-grid" style="--min-column-size: 30ch;">
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
<div class="wa-stack wa-gap-3xl">
|
||||
<h1>Users</h1>
|
||||
|
||||
<div class="wa-cluster wa-gap-3xl">
|
||||
@foreach ($users as $user)
|
||||
<livewire:app.user-card :$user />
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
<wa-card>
|
||||
<div class="wa-flank wa-align-items-start">
|
||||
<livewire:app.pfp :user="$comment->user" />
|
||||
<div class="wa-flank wa-align-items-center">
|
||||
<livewire:app.pfp :user="$comment->user->id" />
|
||||
<div class="wa-split">
|
||||
<div class="wa-stack wa-gap-3xs">
|
||||
<div class="wa-cluster wa-align-items-center">
|
||||
|
|
@ -14,5 +13,4 @@
|
|||
<wa-icon-button href="{{ url("/delete/comment/$comment->id") }}" name="times" label="Delete"></wa-icon-button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</wa-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
<div class="wa-frame wa-border-radius-l" style="max-inline-size: 100%; {{ $post->getAspectRatio() }}">
|
||||
<img src="{{ $post->getFullUrl() }}" />
|
||||
</div>
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
<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>
|
||||
<wa-icon-button name="arrow-up-right-and-arrow-down-left-from-center" wire:click="$js.showFullImage" style="color: var(--wa-color-text-link);"></wa-icon-button>
|
||||
</div>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
|
|
@ -71,9 +70,7 @@
|
|||
|
||||
{{-- Main content --}}
|
||||
<div class="wa-stack wa-gap-2xl" wire:poll.visible>
|
||||
<a wire:click="$js.showFullImage" style="cursor: pointer;">
|
||||
<livewire:posts.image :$post lazy />
|
||||
</a>
|
||||
|
||||
<span class="wa-heading-m">
|
||||
<wa-format-number value="{{ $post->comments->count() }}"></wa-format-number>
|
||||
|
|
@ -89,19 +86,6 @@
|
|||
@foreach ($comments as $comment)
|
||||
<livewire:posts.comment :$comment :key="$comment->id" />
|
||||
@endforeach
|
||||
|
||||
{{-- Full image dialog --}}
|
||||
<wa-dialog id="fullImagePreview" without-header without-footer light-dismiss style="--width: 90%;" wire:ignore>
|
||||
<livewire:posts.full-image :$post lazy />
|
||||
</wa-dialog>
|
||||
|
||||
@script
|
||||
<script>
|
||||
$js('showFullImage', () => {
|
||||
document.querySelector('#fullImagePreview').open = true
|
||||
});
|
||||
</script>
|
||||
@endscript
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ use App\Http\Controllers\DeletionController;
|
|||
use App\Livewire\App\Home as AppHome;
|
||||
use App\Livewire\Pages\Profile as ProfilePage;
|
||||
use App\Livewire\Pages\Upload as UploadPage;
|
||||
use App\Livewire\Pages\Users as UsersPage;
|
||||
use App\Livewire\Posts\Index as PostsPage;
|
||||
use App\Livewire\Posts\Edit as EditPost;
|
||||
use App\Livewire\Posts\View as ViewPost;
|
||||
|
|
@ -20,7 +19,6 @@ Route::get('/', AppHome::class)->name('home');
|
|||
Route::middleware('auth')->group(function () {
|
||||
Route::get('/upload', UploadPage::class)->name('upload');
|
||||
Route::get('/profiles/{user}', ProfilePage::class);
|
||||
Route::get('/users', UsersPage::class)->name('users');
|
||||
});
|
||||
|
||||
// Post routes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue