[dfae77e] | 1 | @extends('layouts.app')
|
---|
| 2 |
|
---|
| 3 | @section('content')
|
---|
| 4 | <div class="container">
|
---|
| 5 | <div class="row justify-content-left">
|
---|
| 6 | <form action="/explore" method="get" id="searchForm">
|
---|
| 7 | <div class="d-flex mb-2 w-75" style="justify-content: space-between">
|
---|
| 8 | <input type="text" placeholder="Search for artists by name" class="form-control w-50 mr-2"
|
---|
| 9 | name="search_name_criteria"
|
---|
| 10 | value="{{ app('request')->input('search_name_criteria') ?? '' }}">
|
---|
| 11 | <select name="music_type" class="form-select w-25">
|
---|
| 12 | <option value="all">All</option>
|
---|
| 13 | @foreach($genres as $genre)
|
---|
| 14 | <option
|
---|
| 15 | value="{{ $genre->id }}" {{ $genre->id === app('request')->input('music_type') ? 'selected' : '' }}>{{ $genre->name }}</option>
|
---|
| 16 | @endforeach
|
---|
| 17 | </select>
|
---|
| 18 | <div style="width: 200px; align-items: center; justify-content: space-between" class="d-flex">
|
---|
| 19 | @foreach($artist_types as $type)
|
---|
| 20 | <div>
|
---|
| 21 | <input type="checkbox" id={{ "artist_type_" . $type->id }} class="form-check-input"
|
---|
| 22 | name="artist_type[]"
|
---|
| 23 | value={{$type->id}} {{ in_array($type->id, app('request')->input('artist_type') ?? []) ? 'checked' : '' }}>
|
---|
| 24 | <label class="form-check-label"
|
---|
| 25 | for={{ "artist_type_" . $type->id }}>{{ $type->name }}</label>
|
---|
| 26 | </div>
|
---|
| 27 | @endforeach
|
---|
| 28 |
|
---|
| 29 | </div>
|
---|
| 30 | </div>
|
---|
| 31 | <button class="btn btn-primary mb-4 btn-search" type="submit">Search</button>
|
---|
| 32 | <button class="btn btn-danger mb-4" onclick="clearForm()" type="button">Clear</button>
|
---|
| 33 | </form>
|
---|
| 34 | </div>
|
---|
| 35 |
|
---|
| 36 | </div>
|
---|
| 37 | <div class="container">
|
---|
| 38 | <div class="row">
|
---|
| 39 | @include('components.artist-small-card')
|
---|
| 40 | </div>
|
---|
| 41 | </div>
|
---|
| 42 |
|
---|
| 43 | <script type="text/javascript">
|
---|
| 44 | function clearForm() {
|
---|
| 45 | $("#searchForm :input:not(:radio):not(:checkbox)").val("");
|
---|
| 46 | $('input[type="checkbox"]').prop("checked", false);
|
---|
| 47 |
|
---|
| 48 | $('.btn-search').click();
|
---|
| 49 | }
|
---|
| 50 | </script>
|
---|
| 51 | @endsection
|
---|