diff options
| author | horus | 2022-01-03 14:53:41 +0100 |
|---|---|---|
| committer | horus | 2022-01-03 14:53:41 +0100 |
| commit | 6531270e480bd39cb1b364d8d1a3cd8a4fe3fc17 (patch) | |
| tree | c0c91d340dc40087ee80517db68f5f075c61e2bc | |
| parent | 69dcbe18fa3854f08d97ec661309c61c5296459e (diff) | |
| download | senpai-6531270e480bd39cb1b364d8d1a3cd8a4fe3fc17.tar.gz | |
Fixed wrong order when changing seasons.
| -rw-r--r-- | app/helpers.php | 3 | ||||
| -rw-r--r-- | resources/views/layouts/sidebar.blade.php | 4 | ||||
| -rw-r--r-- | resources/views/list_anime.blade.php | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/app/helpers.php b/app/helpers.php index 7214626..e83d534 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -188,6 +188,7 @@ function getChangeSeasonOptions() { season_name != "" AND season_year IS NOT NULL - ORDER BY season_year DESC, FIELD(season_name, ' . getFieldSeasonName() . ') ASC' + ORDER BY season_year DESC, FIELD(season_name, "Winter", "Spring", "Summer", "Fall") DESC' ); + #ORDER BY season_year DESC, FIELD(season_name, ' . getFieldSeasonName() . ') ASC' } diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index 4584b38..1182091 100644 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -9,7 +9,11 @@ </label> <select name="season" id="season_switcher" class="custom-select" required> @foreach( getChangeSeasonOptions() as $season ) + @if ( $season->season_name == getSeason() && $season->season_year == date("Y") ) + <option selected value="{{ $season->season_name }}-{{ $season->season_year }}">{{ $season->season_name }} {{ $season->season_year }}</option> + @else <option value="{{ $season->season_name }}-{{ $season->season_year }}">{{ $season->season_name }} {{ $season->season_year }}</option> + @endif @endforeach </select> </div> diff --git a/resources/views/list_anime.blade.php b/resources/views/list_anime.blade.php index 49a1935..957073f 100644 --- a/resources/views/list_anime.blade.php +++ b/resources/views/list_anime.blade.php @@ -31,7 +31,11 @@ </label> <select name="season" id="season_switcher" class="custom-select" required> @foreach( getChangeSeasonOptions() as $season ) + @if ( $season->season_name == getSeason() && $season->season_year == date("Y") ) + <option selected value="{{ $season->season_name }}-{{ $season->season_year }}">{{ $season->season_name }} {{ $season->season_year }}</option> + @else <option value="{{ $season->season_name }}-{{ $season->season_year }}">{{ $season->season_name }} {{ $season->season_year }}</option> + @endif @endforeach </select> </div> |
