From 10cfec30f9474241ff71c3e065957586effb9fe5 Mon Sep 17 00:00:00 2001 From: Simon Diesenreiter Date: Sun, 20 Jul 2025 03:34:09 +0200 Subject: [PATCH] fix: issues with index page for unauthenticated users, refs NOISSUE --- song_of_the_day/Pages/Index.cshtml | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/song_of_the_day/Pages/Index.cshtml b/song_of_the_day/Pages/Index.cshtml index 03b3e52..2d46979 100644 --- a/song_of_the_day/Pages/Index.cshtml +++ b/song_of_the_day/Pages/Index.cshtml @@ -11,8 +11,11 @@ Date Song Submitter - Details - + @if(@User.Identity.IsAuthenticated) + { + Details + + } @foreach(var songSuggestion in Model.SongSuggestions) { @@ -26,18 +29,21 @@ @songSuggestion?.Date.ToString("dd. MM. yyyy") @string.Format("{0} - {1}", songSuggestion?.Song.Name, songSuggestion?.Song.Artist) @displayName - View - - @if(songSuggestion?.Song != null) - { - var handler = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "UnlikeSong" : "LikeSong"; - var likebuttonText = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "Unlike" : "Like"; -
- - -
- } - + @if(@User.Identity.IsAuthenticated) + { + View + + @if(songSuggestion?.Song != null) + { + var handler = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "UnlikeSong" : "LikeSong"; + var likebuttonText = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "Unlike" : "Like"; +
+ + +
+ } + + } } }