Update Submissions and add fields
This commit is contained in:
@@ -104,6 +104,11 @@
|
||||
color: var(--text);
|
||||
border-color: var(--success2);
|
||||
}
|
||||
.badge.yellow, .badge.utilities {
|
||||
background-color: #fdeb0f;
|
||||
color: #000;
|
||||
border-color: #fdeb0f;
|
||||
}
|
||||
|
||||
.topbar-badge {
|
||||
position: absolute;
|
||||
|
||||
@@ -528,3 +528,44 @@
|
||||
}
|
||||
|
||||
.author-search-item:hover { background-color: var(--bg3); }
|
||||
|
||||
.game-selector-mode {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.game-selector-mode-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
padding: 8px 14px;
|
||||
background: none;
|
||||
border: none;
|
||||
border-right: 1px solid var(--border);
|
||||
color: var(--text2);
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
font-family: var(--font-family);
|
||||
transition: background-color 0.1s, color 0.1s;
|
||||
}
|
||||
|
||||
.game-selector-mode-btn:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.game-selector-mode-btn:hover {
|
||||
background-color: var(--bg3);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.game-selector-mode-btn.active {
|
||||
background-color: var(--bg3);
|
||||
color: var(--rhpz-orange);
|
||||
border-bottom: 2px solid var(--rhpz-orange);
|
||||
}
|
||||
|
||||
.game-selector-platform-only {
|
||||
grid-column: span 1;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ const ERROR_TABLE = {
|
||||
uploadError: "One or more files failed to upload.",
|
||||
notAllFilesDone: "Not all the files have finished uploading yet.",
|
||||
noModifications: "Please select at least a type of hack.",
|
||||
noSystems: "Please select at least a system.",
|
||||
noDescription: "Please provide a description.",
|
||||
noGame: "Please provide a game or create a new one and fill all the required fields.",
|
||||
noLanguages: "Please select at least a language.",
|
||||
@@ -117,6 +118,10 @@ window.SubmissionVerifications = {
|
||||
return verifyCheckboxes( document.querySelector( '#modifications-group' ) );
|
||||
},
|
||||
|
||||
step5_UtilitiesSystemsCheckboxes: function(){
|
||||
return verifyCheckboxes( document.querySelector( '#systems-group' ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Verify if the description field has at least one character.
|
||||
* @returns {boolean}
|
||||
@@ -132,6 +137,10 @@ window.SubmissionVerifications = {
|
||||
*/
|
||||
step7_VerifyGame: function( element ){
|
||||
|
||||
const GAME_SELECTOR_MODE = document.querySelector('input[name="game_selection_mode"]')?.value ?? "game";
|
||||
if( GAME_SELECTOR_MODE === 'platform' || GAME_SELECTOR_MODE === 'none' )
|
||||
return true;
|
||||
|
||||
// Check if we have an already existent selected game.
|
||||
const GAME_ID_INPUT = document.querySelector('input[name="game_id"]');
|
||||
if( GAME_ID_INPUT ){
|
||||
@@ -283,12 +292,18 @@ window.Submission = function(){
|
||||
return false;
|
||||
}
|
||||
|
||||
if( SECTION() === "romhacks" ){
|
||||
if( SECTION() === "romhacks" || SECTION() === "lua-scripts" ){
|
||||
console.log( "Step 5" );
|
||||
if( !SubmissionVerifications.step5_RomhacksModificationsCheckboxes()){
|
||||
this.errorKey = "noModifications";
|
||||
return false;
|
||||
}
|
||||
} else if( SECTION() === "utilities" ){
|
||||
console.log( "Step 5" );
|
||||
if( !SubmissionVerifications.step5_UtilitiesSystemsCheckboxes()){
|
||||
this.errorKey = "noSystems";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
console.log( "Step 6" );
|
||||
@@ -341,6 +356,7 @@ window.Submission = function(){
|
||||
notAllFilesDone: 'uploadTarget',
|
||||
uploadError: 'uploadTarget',
|
||||
noModifications: 'modificationsGroup',
|
||||
noSystems: 'systemsGroup',
|
||||
noDescription: 'descriptionField',
|
||||
noGame: 'gameSelector',
|
||||
noLanguages: 'languagesGroup',
|
||||
|
||||
29
resources/views/components/category-selector.blade.php
Normal file
29
resources/views/components/category-selector.blade.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php /** @var \App\Models\Category $category */ ?>
|
||||
<div class="languages-selector form-group level" x-data="{
|
||||
search: '',
|
||||
selected: @js((array) $selected),
|
||||
toggle(value){
|
||||
const i = this.selected.indexOf(value);
|
||||
i === -1 ? this.selected.push(value) : this.selected.splice(i,1);
|
||||
},
|
||||
valueSelect(value){
|
||||
return this.selected.includes(value);
|
||||
},
|
||||
get count(){ return this.selected.length; }
|
||||
}">
|
||||
<div class="language-search">
|
||||
<i data-lucide="search"></i>
|
||||
<input type="text" x-model="search" placeholder="Search a category" autocomplete="off">
|
||||
<button class="btn" type="button" x-show="search !== ''" @click="search = ''" x-cloak>
|
||||
<i data-lucide="x"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="language-list" id="languages-group">
|
||||
@foreach( $categories as $category )
|
||||
<label class="language-item" x-show="'{{ strtolower($category->name) }}'.includes(search.toLowerCase())">
|
||||
<input type="checkbox" name="categories[]" value="{{ $category->id }}" x-model="selected" :value="{{ $category->id }}" {{ in_array($category->id, $selected) ? 'checked' : '' }}> {{ $category->name }}
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -24,13 +24,26 @@
|
||||
@foreach( $entry->modifications as $modif )
|
||||
<span class="badge orange">{{ $modif->name }}</span>
|
||||
@endforeach
|
||||
@elseif( section_must_be( 'translations', $entry->type ) )
|
||||
@foreach( $entry->languages as $lang )
|
||||
<span class="badge orange">{{ $lang->name }}</span>
|
||||
@endforeach
|
||||
@elseif( section_must_be( 'utilities', $entry->type ) )
|
||||
@foreach( $entry->categories as $category )
|
||||
<span class="badge orange">{{ $category->name }}</span>
|
||||
@endforeach
|
||||
@endif
|
||||
@if( $entry->status_id )
|
||||
<span class="badge">{{ $entry->status->name }}</span>
|
||||
@endif
|
||||
@foreach( $entry->languages as $lang )
|
||||
<span class="badge">{{ $lang->name }}</span>
|
||||
@endforeach
|
||||
@if( $entry->level_id )
|
||||
<span class="badge">{{ $entry->level->name }}</span>
|
||||
@endif
|
||||
@if( section_must_not_be( 'translations', $entry->type ) )
|
||||
@foreach( $entry->languages as $lang )
|
||||
<span class="badge">{{ $lang->name }}</span>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<div class="entry-card-meta">
|
||||
<span><i data-lucide="download" size="12"></i> x</span>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -52,6 +52,15 @@
|
||||
{{-- Modifications --}}
|
||||
<x-database-filter-with-mode title="Modifications" :items="$allModifications" model="modifications" mode-model="modificationsMode" :selected-mode="$modificationsMode" />
|
||||
|
||||
{{-- Categories --}}
|
||||
<x-database-filter-with-mode title="Categories" :items="$allCategories" model="categories" mode-model="categoriesMode" :selected-mode="$categoriesMode" />
|
||||
|
||||
{{-- Levels --}}
|
||||
<x-database-filter-without-mode title="Level" :items="$allLevels" model="levels"/>
|
||||
|
||||
{{-- Systems --}}
|
||||
<x-database-filter-with-mode title="Systems" :items="$allSystems" model="systems" mode-model="systemsMode" :selected-mode="$systemsMode" />
|
||||
|
||||
</aside>
|
||||
|
||||
<div class="database-results">
|
||||
|
||||
@@ -3,59 +3,113 @@
|
||||
platformId: @json(old('new-game-platform') ? (string) old('new-game-platform') : null),
|
||||
genreId: @json(old('new-game-genre') ? (string) old('new-game-genre') : null)
|
||||
})">
|
||||
<input type="hidden" name="game_selection_mode" value="{{ $selectionMode ?? 'game' }}">
|
||||
{{--
|
||||
Prefill if server-side error.
|
||||
--}}
|
||||
@if( $canChangeSelection )
|
||||
<div class="game-selector-mode">
|
||||
<button
|
||||
type="button"
|
||||
class="game-selector-mode-btn {{ $selectionMode === 'game' ? 'active' : '' }}"
|
||||
wire:click="setSelectionMode('game')"
|
||||
>
|
||||
Link to a game
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="game-selector-mode-btn {{ $selectionMode === 'platform' ? 'active' : '' }}"
|
||||
wire:click="setSelectionMode('platform')"
|
||||
>
|
||||
Platform only
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="game-selector-mode-btn {{ $selectionMode === 'none' ? 'active' : '' }}"
|
||||
wire:click="setSelectionMode('none')"
|
||||
>
|
||||
Nothing
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
<div class="form-group grid-c3">
|
||||
|
||||
@if( !$newGame && !$hasOldNewGame )
|
||||
{{-- Search game mode --}}
|
||||
<div class="game-selector">
|
||||
<div class="game-selector-level2">
|
||||
@if($selectionMode === 'none')
|
||||
<div style="color: var(--text2); font-size: 0.88rem; padding: 10px 0;">
|
||||
<i data-lucide="info" size="13"></i>
|
||||
This entry will not be linked to any game or platform.
|
||||
</div>
|
||||
@elseif( $selectionMode === 'platform' )
|
||||
<input type="hidden" name="platform_only_id" value="{{ $platformModeId ?? '' }}">
|
||||
|
||||
<x-form-field-title name="Game" required="true" />
|
||||
<input class="form-input" type="text" wire:model.live.debounce="search" placeholder="Search a game..." autocomplete="off"
|
||||
@focus="$wire.dropdown = $wire.search.length >= {{ $required_chars }}" @click.outside="$wire.dropdown = false" >
|
||||
<div class="game-selector-platform-only">
|
||||
<x-form-field-title name="Platform" required="true" />
|
||||
<select
|
||||
class="form-select"
|
||||
wire:change="selectPlatformOnly($event.target.value)"
|
||||
>
|
||||
<option value="" disabled {{ !$platformModeId ? 'selected' : '' }}>
|
||||
Select a platform...
|
||||
</option>
|
||||
@foreach($platforms as $platform)
|
||||
<option
|
||||
value="{{ $platform->id }}"
|
||||
{{ $platformModeId == $platform->id ? 'selected' : '' }}
|
||||
>
|
||||
{{ $platform->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@else
|
||||
@if( !$newGame && !$hasOldNewGame )
|
||||
{{-- Search game mode --}}
|
||||
<div class="game-selector">
|
||||
<div class="game-selector-level2">
|
||||
|
||||
<input type="hidden" name="game_id" value="{{ $gameId ?? '' }}" />
|
||||
<x-form-field-title name="Game" required="true" />
|
||||
<input class="form-input" type="text" wire:model.live.debounce="search" placeholder="Search a game..." autocomplete="off"
|
||||
@focus="$wire.dropdown = $wire.search.length >= {{ $required_chars }}" @click.outside="$wire.dropdown = false" >
|
||||
|
||||
<input type="hidden" name="game_id" value="{{ $gameId ?? '' }}" />
|
||||
|
||||
</div>
|
||||
|
||||
@if( $dropdown )
|
||||
{{-- List games --}}
|
||||
<ul class="game-selector-dropdown">
|
||||
@forelse($games as $game)
|
||||
<li>
|
||||
<button type="button" wire:click="selectGame({{ $game->id }}, '{{ addslashes($game->name) }}')"
|
||||
class="dropdown-item" {{ $gameId === $game->id ? 'selected' : '' }} >
|
||||
<span class="dropdown-item-name">{{ $game->name }}</span>
|
||||
@if($game->platform)
|
||||
<span class="badge">{{ $game->platform->short_name }}</span>
|
||||
@endif
|
||||
@if($game->genre)
|
||||
<span class="badge">{{ $game->genre->name }}</span>
|
||||
@endif
|
||||
</button>
|
||||
</li>
|
||||
@empty
|
||||
<li class="dropdown-empty">No games found</li>
|
||||
@endforelse
|
||||
</ul>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
@if( $dropdown )
|
||||
{{-- List games --}}
|
||||
<ul class="game-selector-dropdown">
|
||||
@forelse($games as $game)
|
||||
<li>
|
||||
<button type="button" wire:click="selectGame({{ $game->id }}, '{{ addslashes($game->name) }}')"
|
||||
class="dropdown-item" {{ $gameId === $game->id ? 'selected' : '' }} >
|
||||
<span class="dropdown-item-name">{{ $game->name }}</span>
|
||||
@if($game->platform)
|
||||
<span class="badge">{{ $game->platform->short_name }}</span>
|
||||
@endif
|
||||
@if($game->genre)
|
||||
<span class="badge">{{ $game->genre->name }}</span>
|
||||
@endif
|
||||
</button>
|
||||
</li>
|
||||
@empty
|
||||
<li class="dropdown-empty">No games found</li>
|
||||
@endforelse
|
||||
</ul>
|
||||
@endif
|
||||
<div class="platform-prefilled">
|
||||
<x-form-field-title name="Platform" helper="Prefilled" />
|
||||
<input class="form-input" disabled="disabled" type="text" autocomplete="off" value="{{ $platformName }}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="genre-prefilled">
|
||||
<x-form-field-title name="Genre" helper="Prefilled" />
|
||||
<input class="form-input" disabled="disabled" type="text" autocomplete="off" value="{{ $genreName }}" >
|
||||
</div>
|
||||
|
||||
<div class="platform-prefilled">
|
||||
<x-form-field-title name="Platform" helper="Prefilled" />
|
||||
<input class="form-input" disabled="disabled" type="text" autocomplete="off" value="{{ $platformName }}">
|
||||
</div>
|
||||
|
||||
<div class="genre-prefilled">
|
||||
<x-form-field-title name="Genre" helper="Prefilled" />
|
||||
<input class="form-input" disabled="disabled" type="text" autocomplete="off" value="{{ $genreName }}" >
|
||||
</div>
|
||||
|
||||
@else {{-- New game --}}
|
||||
@else {{-- New game --}}
|
||||
|
||||
<div class="new-game-title">
|
||||
<x-form-field-title name="Game" required="true" />
|
||||
@@ -65,12 +119,12 @@
|
||||
<div class="new-game-platform">
|
||||
<x-form-field-title name="Platform" required="true" />
|
||||
<select class="form-select" name="new-game-platform" x-model="platformId" required>
|
||||
<option value="" disabled>---</option>
|
||||
@foreach( $platforms as $platform )
|
||||
<option value="{{ (string) $platform->id }}">{{ $platform->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<option value="" disabled>---</option>
|
||||
@foreach( $platforms as $platform )
|
||||
<option value="{{ (string) $platform->id }}">{{ $platform->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="new-game-genre">
|
||||
<x-form-field-title name="Genre" required="true" />
|
||||
@@ -82,17 +136,19 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div style="display:flex;align-items: flex-end;justify-content: right;gap:15px;">
|
||||
@if($gameId)
|
||||
<button type="button" class="btn" wire:click="clearGame">
|
||||
Remove
|
||||
</button>
|
||||
@endif
|
||||
<button type="button" class="btn primary" wire:click="switchNewGame">{{ $newGame ? "Cancel" : "Add a game" }}</button>
|
||||
</div>
|
||||
@if( $selectionMode === 'game')
|
||||
<div style="display:flex;align-items: flex-end;justify-content: right;gap:15px;">
|
||||
@if($gameId)
|
||||
<button type="button" class="btn" wire:click="clearGame">
|
||||
Remove
|
||||
</button>
|
||||
@endif
|
||||
<button type="button" class="btn primary" wire:click="switchNewGame">{{ $newGame ? "Cancel" : "Add a game" }}</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if( section_must_be( 'romhacks', $section ) )
|
||||
@if( section_must_be( ['romhacks', 'lua-scripts'], $section ) )
|
||||
<div class="form-group">
|
||||
<x-form-field-title name="{{ $words['type_of_hack'] }}" required="true" />
|
||||
<div class="form-type-of-checkboxes form-group level" id="modifications-group" x-ref="modificationsGroup">
|
||||
@@ -57,9 +57,26 @@
|
||||
</div>
|
||||
<div class="form-error-text" x-show="errorKey === 'noModifications'" x-text="errorMessage"></div>
|
||||
</div>
|
||||
@elseif( section_must_be( [ 'utilities', 'documents' ], $section ) )
|
||||
<div class="form-group">
|
||||
<x-form-field-title name="Categories" required="true" />
|
||||
<x-category-selector :section="$section" :selected="$oldCategories" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if( section_must_be( ['romhacks', 'translations', 'homebrew'], $section ) )
|
||||
@if( section_must_be( 'utilities', $section ) )
|
||||
<div class="form-group">
|
||||
<x-form-field-title name="{{ $words['system'] }}" required="true" />
|
||||
<div class="form-type-of-checkboxes form-group level" id="systems-group" x-ref="systemsGroup">
|
||||
@foreach( $systems as $system )
|
||||
<label><input class="form-checkbox" type="checkbox" name="systems[]" value="{{ $system->id }}" {{ in_array($system->id, $oldSystems) ? 'checked' : '' }}>{{ $system->name }}</label>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="form-error-text" x-show="errorKey === 'noSystems'" x-text="errorMessage"></div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if( section_must_be( ['romhacks', 'translations', 'homebrew', 'utilities', 'documents', 'lua-scripts'], $section ) )
|
||||
<div class="form-group grid-c3">
|
||||
<div>
|
||||
<x-form-field-title name="{{ $words['version'] }}" required="true" />
|
||||
@@ -71,17 +88,26 @@
|
||||
<input type="date" class="form-input" name="release-date" value="{{ old('release-date') ?? $entry->release_date?->format('Y-m-d') ?? '' }}" required>
|
||||
</div>
|
||||
<div>
|
||||
<x-form-field-title name="{{ $words['status'] }}" required="true" />
|
||||
@if( section_must_be( ['utilities', 'documents'], $section ) )
|
||||
<x-form-field-title name="{{ $words['level'] }}" required="true" />
|
||||
<div class="form-status-radio form-group level">
|
||||
@foreach( $statuses as $status )
|
||||
<label><input class="form-radio" type="radio" name="status" value="{{ $status->id }}" {{ old('status', $entry->status_id ) == $status->id ? 'checked' : '' }} required>{{ $status->name }}</label>
|
||||
@endforeach
|
||||
</div>
|
||||
@foreach( $levels as $level )
|
||||
<label><input class="form-radio" type="radio" name="level" value="{{ $level->id }}" {{ old('level', $entry->level_id ) == $level->id ? 'checked' : '' }} required>{{ $level->name }}</label>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<x-form-field-title name="{{ $words['status'] }}" required="true" />
|
||||
<div class="form-status-radio form-group level">
|
||||
@foreach( $statuses as $status )
|
||||
<label><input class="form-radio" type="radio" name="status" value="{{ $status->id }}" {{ old('status', $entry->status_id ) == $status->id ? 'checked' : '' }} required>{{ $status->name }}</label>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if( section_must_be( 'translations', $section ) )
|
||||
@if( section_must_be( [ 'translations', 'utilities', 'documents'] , $section ) )
|
||||
<x-form-field-title name="Languages" required="true" />
|
||||
<x-languages-selector :selected="$oldLanguages" />
|
||||
@error('languages')
|
||||
@@ -104,10 +130,12 @@
|
||||
<x-form-group-title label="{{ $words['about_game'] }}" icon="gamepad-2" />
|
||||
<div x-ref="gameSelector">
|
||||
<livewire:game-selector
|
||||
:game-id="old('game_id', $entry->game_id ?? null )"
|
||||
:game-id="old('game_id', $entry->game_id ?? null)"
|
||||
:new-game-title="old('new-game-title')"
|
||||
:new-game-platform="old('new-game-platform')"
|
||||
:new-game-genre="old('new-game-genre')"
|
||||
:platform-only-id="old('platform_only_id', $entry->platform_id ?? null)"
|
||||
:section="$section"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-error-text" x-show="errorKey === 'noGame'" x-text="errorMessage"></div>
|
||||
@@ -123,9 +151,11 @@
|
||||
@error('new-game-genre')
|
||||
<x-form-error-text message="{{ $message }}" />
|
||||
@enderror
|
||||
<livewire:hashes-upload :old-hashes="old('hashes', $entry->hashes->toArray(), [])" />
|
||||
@if( section_must_be( [ 'romhacks', 'translations' ], $section ))
|
||||
<livewire:hashes-upload :old-hashes="old('hashes', $entry->hashes->toArray(), [])" />
|
||||
@endif
|
||||
|
||||
@if( section_must_not_be( 'translations', $section ) )
|
||||
@if( section_must_not_be( [ 'translations', 'utilities', 'documents' ], $section ) )
|
||||
<x-form-field-title name="Languages" required="true" />
|
||||
<x-languages-selector :selected="$oldLanguages" />
|
||||
@error('languages')
|
||||
@@ -156,17 +186,21 @@
|
||||
@enderror
|
||||
<x-staff-credits-field :old-staff-credits="old('staff_credits', $entry->staff_credits ?? null)" />
|
||||
|
||||
<x-form-group-title label="{{ $words['related_links'] }}" icon="link" />
|
||||
<div class="form-group grid-c2">
|
||||
<div>
|
||||
<x-form-field-title name="{{ $words['release_site'] }}" helper="{{ $words['release_site_helper'] }}" required="" />
|
||||
<input class="form-input" type="url" name="release_site" value="{{ old( 'release_site', $entry->relevant_link ?? '' ) }}">
|
||||
@if( section_must_not_be( 'documents', $section ) )
|
||||
<x-form-group-title label="{{ $words['related_links'] }}" icon="link" />
|
||||
<div class="form-group grid-c2">
|
||||
<div>
|
||||
<x-form-field-title name="{{ $words['release_site'] }}" helper="{{ $words['release_site_helper'] }}" required="" />
|
||||
<input class="form-input" type="url" name="release_site" value="{{ old( 'release_site', $entry->relevant_link ?? '' ) }}">
|
||||
</div>
|
||||
<div>
|
||||
<x-form-field-title name="{{ $words['youtube_video'] }}" required="" />
|
||||
<input class="form-input" type="url" name="youtube_video" value="{{ old( 'youtube_video', $entry->youtube_link ?? '' ) }}">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<x-form-field-title name="{{ $words['youtube_video'] }}" required="" />
|
||||
<input class="form-input" type="url" name="youtube_video" value="{{ old( 'youtube_video', $entry->youtube_link ?? '' ) }}">
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="form-group"></div>
|
||||
@endif
|
||||
|
||||
@if($isEdit)
|
||||
<x-form-group-title label="Entry Management" icon="wrench" />
|
||||
|
||||
Reference in New Issue
Block a user