Initial commit
This commit is contained in:
60
resources/views/livewire/authors-selector.blade.php
Normal file
60
resources/views/livewire/authors-selector.blade.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<div>
|
||||
<div class="form-group grid-c2">
|
||||
<div>
|
||||
@if( $newAuthor === false)
|
||||
<div class="game-selector">
|
||||
<div class="game-selector-level2">
|
||||
<x-form-field-title name="Authors" helper="Person or Group who created this, if it's you add/select yourself." required="true" />
|
||||
<input id="author-search" class="form-input" type="text" wire:model.live.debounce="search" placeholder="Search a game..." autocomplete="off"
|
||||
@focus="$wire.dropdown = $wire.search.length >= 2" @click.outside="$wire.dropdown = false" >
|
||||
</div>
|
||||
@if( $dropdown )
|
||||
<ul class="game-selector-dropdown">
|
||||
@forelse($authors as $author)
|
||||
<li>
|
||||
<button type="button" wire:click="selectAuthor({{ $author->id }}, '{{ addslashes($author->name) }}')"
|
||||
class="dropdown-item">
|
||||
<span class="dropdown-item-name">{{ $author->name }}</span>
|
||||
</button>
|
||||
</li>
|
||||
@empty
|
||||
<li class="dropdown-empty">No author found</li>
|
||||
@endforelse
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<div class="new-author">
|
||||
<x-form-field-title name="New author" required="true" />
|
||||
<input class="form-input" wire:model="newAuthorName" type="text" autocomplete="off" value="" required>
|
||||
</div>
|
||||
@endif
|
||||
<div style="display:flex;align-items: flex-end;justify-content: right;gap:15px;margin-top:20px;">
|
||||
@if($newAuthor)
|
||||
<button type="button" class="btn primary" wire:click="addNewAuthor" :disabled="$wire.newAuthorName.trim() === ''">
|
||||
Add
|
||||
</button>
|
||||
@endif
|
||||
<button type="button" class="btn {{ $newAuthor ? '' : 'primary' }}" wire:click="switchNewAuthor">{{ $newAuthor ? "Cancel" : "Add an author" }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<x-form-field-title name="Selected authors" />
|
||||
<div class="form-group level authors-list">
|
||||
@foreach($selectedAuthors as $i => $author)
|
||||
<div class="author-item">
|
||||
<span>{{ $author['name'] }}</span>
|
||||
<button type="button" class="btn author-item-remove" wire:click="removeAuthor({{ $i }})">
|
||||
X
|
||||
</button>
|
||||
</div>
|
||||
@if( $author['id'] )
|
||||
<input type="hidden" name="authors[]" value="{{ $author['id'] }}">
|
||||
@else
|
||||
<input type="hidden" name="new-authors[]" value="{{ $author['name'] }}">
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
98
resources/views/livewire/game-selector.blade.php
Normal file
98
resources/views/livewire/game-selector.blade.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<div x-data='GameSelector()' x-init="init({
|
||||
name: @json(old('new-game-title') ?: null),
|
||||
platformId: @json(old('new-game-platform') ? (string) old('new-game-platform') : null),
|
||||
genreId: @json(old('new-game-genre') ? (string) old('new-game-genre') : null)
|
||||
})">
|
||||
{{--
|
||||
Prefill if server-side error.
|
||||
--}}
|
||||
<div class="form-group grid-c3">
|
||||
|
||||
@if( !$newGame && !$hasOldNewGame )
|
||||
{{-- Search game mode --}}
|
||||
<div class="game-selector">
|
||||
<div class="game-selector-level2">
|
||||
|
||||
<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>
|
||||
|
||||
<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 --}}
|
||||
|
||||
<div class="new-game-title">
|
||||
<x-form-field-title name="Game" required="true" />
|
||||
<input class="form-input" name="new-game-title" type="text" autocomplete="off" x-model="name" value="{{ old('new-game-title', '') }}" required>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<div class="new-game-genre">
|
||||
<x-form-field-title name="Genre" required="true" />
|
||||
<select class="form-select" name="new-game-genre" x-model="genreId" required>
|
||||
<option value="" disabled>---</option>
|
||||
@foreach( $genres as $genre )
|
||||
<option value="{{ (string) $genre->id }}">{{ $genre->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@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>
|
||||
</div>
|
||||
66
resources/views/livewire/hashes-upload.blade.php
Normal file
66
resources/views/livewire/hashes-upload.blade.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<div x-data="HashesManager($wire)" x-ref="hashRoot">
|
||||
<x-form-field-title name="Hashes" required="true" />
|
||||
@if( count( $hashes ) > 0)
|
||||
<div class="form-group grid-hashes">
|
||||
|
||||
<div class="hash-filename">
|
||||
<x-form-field-title name="Filename" />
|
||||
</div>
|
||||
|
||||
<div class="hash-crc32">
|
||||
<x-form-field-title name="CRC32" />
|
||||
</div>
|
||||
|
||||
<div class="hash-sha1">
|
||||
<x-form-field-title name="SHA-1" />
|
||||
</div>
|
||||
|
||||
<div class="hash-verified">
|
||||
<x-form-field-title name="Verified" />
|
||||
</div>
|
||||
|
||||
<div class="hash-remove">
|
||||
<x-form-field-title name="Actions" />
|
||||
|
||||
</div>
|
||||
|
||||
@foreach( $hashes as $i => $hash )
|
||||
<div class="hash-filename">
|
||||
<input class="form-input" type="text" autocomplete="off" value="{{ $hash['filename'] }}" disabled>
|
||||
</div>
|
||||
<div class="hash-crc32">
|
||||
<input class="form-input" type="text" autocomplete="off" value="{{ $hash['hash_crc32'] }}" disabled>
|
||||
</div>
|
||||
<div class="hash-sha1">
|
||||
<input class="form-input" type="text" autocomplete="off" value="{{ $hash['hash_sha1'] }}" disabled>
|
||||
</div>
|
||||
<div class="hash-verified">
|
||||
<input class="form-input" type="text" autocomplete="off" value="{{ $hash['verified'] }}" disabled>
|
||||
</div>
|
||||
<div class="hash-remove">
|
||||
<button type="button" class="btn" wire:click="removeHash({{ $i }})">
|
||||
Remove
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="hashes[{{ $i }}][filename]" value="{{ $hash['filename'] }}">
|
||||
<input type="hidden" name="hashes[{{ $i }}][hash_crc32]" value="{{ $hash['hash_crc32'] }}">
|
||||
<input type="hidden" name="hashes[{{ $i }}][hash_sha1]" value="{{ $hash['hash_sha1'] }}">
|
||||
<input type="hidden" name="hashes[{{ $i }}][verified]" value="{{ $hash['verified'] }}">
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div style="display:flex;align-items: flex-end;justify-content: right;gap:15px;">
|
||||
<span x-show="isCalculating" x-cloak>
|
||||
<i data-lucide="loader-2" class="spin"></i>
|
||||
Please wait...
|
||||
</span>
|
||||
|
||||
<span x-show="error" x-text="error" class="form-error-text" x-cloak></span>
|
||||
|
||||
<button type="button" class="btn primary" :disabled="isCalculating" @click="handleSubmitFile()">Add Hashes</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user