Update Submissions and add fields

This commit is contained in:
2026-06-10 11:04:26 +02:00
parent 1d8ea70b72
commit 4f9f6c63b3
64 changed files with 2278 additions and 174 deletions

View File

@@ -1,4 +1,4 @@
<?php /** @var \App\Models\EntryGallery $galleryItem */ ?>
<?php /** @var \App\Models\Gallery $galleryItem */ ?>
@extends('layouts.app')
@section('page-title', $entry->title . " - " . config('app.name') )
@@ -54,9 +54,13 @@
</h1>
<div class="entry-authors">
@forelse( $entry->authors as $author)
@if($loop->first)By @endif
@if($loop->first)
By
@endif
{{ $author->name }}
@if( !$loop->last ), @endif
@if( !$loop->last )
,
@endif
@empty
No authors
@endforelse
@@ -65,7 +69,7 @@
@if($entry->user_id)
<span>
<i data-lucide="user" size="14"></i>
Posted by <x-xf-username-link :user-id="$entry->user_id" />
Posted by <x-xf-username-link :user-id="$entry->user_id"/>
</span>
@endif
@@ -83,43 +87,68 @@
</div>
<div class="entry-meta-grid">
@if( $entry->game )
<x-entry-meta-item label="Game Name" value="{{ $entry->game->name }}" route="{!! databaseRoute( [ 'games' => [ $entry->game->id ], 'platforms' => [ $entry->getRealPlatform()?->id ] ] ) !!}" />
<x-entry-meta-item label="Game Name" value="{{ $entry->game->name }}"
route="{!! databaseRoute( [ 'games' => [ $entry->game->id ], 'platforms' => [ $entry->getRealPlatform()?->id ] ] ) !!}"/>
@endif
@if( $entry->getRealPlatform() )
<x-entry-meta-item label="Platform" value="{{ ($entry->getRealPlatform())->name }}" route="{!! databaseRoute( ['platforms' => [ $entry->getRealPlatform()->id ] ] ) !!}" />
<x-entry-meta-item label="Platform" value="{{ ($entry->getRealPlatform())->name }}"
route="{!! databaseRoute( ['platforms' => [ $entry->getRealPlatform()->id ] ] ) !!}"/>
@endif
@if( $entry->game && $entry->game->genre )
<x-entry-meta-item label="Genre" value="{{ $entry->game->genre->name }}" route="{!! databaseRoute( ['genres' => [ $entry->game->genre->id ] ]) !!}" />
<x-entry-meta-item label="Genre" value="{{ $entry->game->genre->name }}"
route="{!! databaseRoute( ['genres' => [ $entry->game->genre->id ] ]) !!}"/>
@endif
@if( $entry->languages->isNotEmpty() )
<x-entry-meta-item label="Language" value="{{ $entry->languages->pluck('name')->implode(', ') }}" route="{!! databaseRoute( [ 'languages' => $entry->languages->pluck('id')->toArray() ]) !!}" />
<x-entry-meta-item label="Language"
value="{{ $entry->languages->pluck('name')->implode(', ') }}"
route="{!! databaseRoute( [ 'languages' => $entry->languages->pluck('id')->toArray() ]) !!}"/>
@endif
@if( $entry->status_id )
<x-entry-meta-item label="Status" value="{{ $entry->status->name }}" route="{!! databaseRoute( ['statuses' => [ $entry->status->id ] ]) !!}" />
<x-entry-meta-item label="Status" value="{{ $entry->status->name }}"
route="{!! databaseRoute( ['statuses' => [ $entry->status->id ] ]) !!}"/>
@endif
@if( $entry->level_id )
<x-entry-meta-item label="Experience Level" value="{{ $entry->level->name }}"
route="{!! databaseRoute( ['levels' => [ $entry->level->id ] ]) !!}"/>
@endif
@if( $entry->modifications->isNotEmpty() )
<x-entry-meta-item label="Type of hack" value="{{ $entry->modifications->pluck('name')->implode(', ') }}" route="{!! databaseRoute( [ 'modifications' => $entry->modifications->pluck('id')->toArray() ] ) !!}" />
<x-entry-meta-item label="Type of hack"
value="{{ $entry->modifications->pluck('name')->implode(', ') }}"
route="{!! databaseRoute( [ 'modifications' => $entry->modifications->pluck('id')->toArray() ] ) !!}"/>
@endif
@if( $entry->categories->isNotEmpty() )
<x-entry-meta-item label="Categories"
value="{{ $entry->categories->pluck('name')->implode(', ') }}"
route="{!! databaseRoute( [ 'categories' => $entry->categories->pluck('id')->toArray() ] ) !!}"/>
@endif
@if( $entry->systems->isNotEmpty() )
<x-entry-meta-item label="OS" value="{{ $entry->systems->pluck('name')->implode(', ') }}"
route="{!! databaseRoute( [ 'systems' => $entry->systems->pluck('id')->toArray() ] ) !!}"/>
@endif
@if( $entry->version )
<x-entry-meta-item label="Version" value="{{ $entry->version }}" route="none" />
<x-entry-meta-item label="Version" value="{{ $entry->version }}" route="none"/>
@endif
@if( $entry->release_date )
<x-entry-meta-item label="Release Date" value="{{ $entry->release_date->format('Y-m-d') }}" route="none" />
<x-entry-meta-item label="Release Date" value="{{ $entry->release_date->format('Y-m-d') }}"
route="none"/>
@endif
</div>
<div class="hack-actions" style="display:flex;gap:10px;">
@if($entry->state === 'pending')
@can('approve', $entry)
<div x-data="{ rejectOpen: false }">
<form action="{{ route('queue.approve', $entry) }}" method="POST" style="display:inline">
<form action="{{ route('queue.approve', $entry) }}" method="POST"
style="display:inline">
@csrf
@method('PATCH')
<button type="submit" class="btn success" onclick="return confirm('Approve this entry?')">
<button type="submit" class="btn success"
onclick="return confirm('Approve this entry?')">
<i data-lucide="check-circle" size="14"></i>
Approve
</button>
</form>
<button type="button" class="btn danger" style="margin-right:15px;" @click="rejectOpen = !rejectOpen">
<button type="button" class="btn danger" style="margin-right:15px;"
@click="rejectOpen = !rejectOpen">
<i data-lucide="x-circle" size="14"></i>
Reject
</button>
@@ -145,7 +174,7 @@
@csrf
@method('PATCH')
<div class="form-group">
<x-form-field-title name="Rejection reason" required="true" />
<x-form-field-title name="Rejection reason" required="true"/>
<textarea
class="form-input"
name="reason"
@@ -171,11 +200,13 @@
</div>
@endcan
@endif
<button class="btn primary" onclick="Livewire.dispatch('entryOpenFilesModal', { entryId: {{ $entry->id }} })">
<button class="btn primary"
onclick="Livewire.dispatch('entryOpenFilesModal', { entryId: {{ $entry->id }} })">
<i data-lucide="download"></i> Download
</button>
@can('update',$entry)
<a href="{{ route('submit.edit', ['section' => $entry->type, 'entry' => $entry ] ) }}" class="btn">
<a href="{{ route('submit.edit', ['section' => $entry->type, 'entry' => $entry ] ) }}"
class="btn">
<i data-lucide="edit"></i> Edit
</a>
@endcan
@@ -190,13 +221,13 @@
<div class="entry-content">
@if( $entry->description )
<x-entry-section-title label="Description" icon="file-text" />
<x-entry-section-title label="Description" icon="file-text"/>
<div class="entry-description">
{{ $entry->description }}
</div>
@endif
@if( $entry->hashes->isNotEmpty() )
<x-entry-section-title label="Hashes" icon="table-properties" />
<x-entry-section-title label="Hashes" icon="table-properties"/>
<div class="entry-description">
@foreach( $entry->hashes->all() as $hash )
Filename: {{ $hash->filename }}<br>
@@ -207,7 +238,7 @@
</div>
@endif
@if( $entry->parseStaffCredits() )
<x-entry-section-title label="Staff Credits" icon="users-round" />
<x-entry-section-title label="Staff Credits" icon="users-round"/>
<div class="entry-description">
<ul>
@foreach( $entry->parseStaffCredits() as $item )
@@ -218,13 +249,16 @@
@endif
@if( $entry->gallery->isNotEmpty() )
<div x-data="{ open: false, currentImage: ''}" x-cloak>
<x-entry-section-title label="Gallery" icon="images" />
<x-entry-section-title label="Gallery" icon="images"/>
<div class="entry-gallery">
@foreach( $entry->gallery as $galleryItem )
<div class="entry-gallery-item" @click="currentImage = '{{ Storage::url($galleryItem->image) }}'; open = true; "><img src="{{ Storage::url($galleryItem->image) }}"></div>
<div class="entry-gallery-item"
@click="currentImage = '{{ Storage::url($galleryItem->image) }}'; open = true; "><img
src="{{ Storage::url($galleryItem->image) }}"></div>
@endforeach
</div>
<div class="gallery-modal" x-show="open" x-transition.opacity.duration.300ms @click="open = false" @keydown.escape.window="open = false">
<div class="gallery-modal" x-show="open" x-transition.opacity.duration.300ms @click="open = false"
@keydown.escape.window="open = false">
<span class="gallery-modal-close" @click="open = false;"><i data-lucide="x"></i></span>
<div class="gallery-modal-content" @click.stop>
<img :src="currentImage">
@@ -233,7 +267,7 @@
</div>
@endif
@if( $entry->relevant_link )
<x-entry-section-title label="Relevant Link" icon="link" />
<x-entry-section-title label="Relevant Link" icon="link"/>
<div class="entry-description">
<a href="{{ $entry->relevant_link }}" target="_blank">{{ $entry->relevant_link }}</a>
</div>
@@ -241,19 +275,24 @@
@if( $entry->getYoutubeVideoId() )
<div x-data="{open: false, src: ''}" x-cloak class="youtube-section">
<x-entry-section-title label="Youtube Video" icon="play" />
<x-entry-section-title label="Youtube Video" icon="play"/>
<div class="video-thumbnail-wrapper" @click="src = 'https://www.youtube.com/embed/{{ $entry->getYoutubeVideoId() }}?autoplay=1'; open = true">
<div class="video-thumbnail-wrapper"
@click="src = 'https://www.youtube.com/embed/{{ $entry->getYoutubeVideoId() }}?autoplay=1'; open = true">
<img src="https://img.youtube.com/vi/{{ $entry->youtube_id }}/maxresdefault.jpg">
<div class="play-trigger">
<i data-lucide="play"></i>
</div>
</div>
<div class="gallery-modal" x-show="open" x-transition.opacity.duration.300ms @click="open = false; src = ''" @keydown.escape.window="open = false; src = ''">
<span class="gallery-modal-close" @click="open = false; src = '';"><i data-lucide="x"></i></span>
<div class="gallery-modal" x-show="open" x-transition.opacity.duration.300ms
@click="open = false; src = ''" @keydown.escape.window="open = false; src = ''">
<span class="gallery-modal-close" @click="open = false; src = '';"><i
data-lucide="x"></i></span>
<div class="gallery-modal-video" @click.stop>
<iframe :src="src" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe :src="src"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</div>
</div>
</div>