fix: issues with index page for unauthenticated users, refs NOISSUE
This commit is contained in:
		@@ -11,8 +11,11 @@
 | 
			
		||||
            <th>Date</th>
 | 
			
		||||
            <th>Song</th>
 | 
			
		||||
            <th>Submitter</th>
 | 
			
		||||
            <th>Details</th>
 | 
			
		||||
            <th></th>
 | 
			
		||||
            @if(@User.Identity.IsAuthenticated)
 | 
			
		||||
            {
 | 
			
		||||
                <th>Details</th>
 | 
			
		||||
                <th></th>
 | 
			
		||||
            }
 | 
			
		||||
        </tr>
 | 
			
		||||
        @foreach(var songSuggestion in Model.SongSuggestions)
 | 
			
		||||
        {
 | 
			
		||||
@@ -26,18 +29,21 @@
 | 
			
		||||
                    <td>@songSuggestion?.Date.ToString("dd. MM. yyyy")</td>
 | 
			
		||||
                    <td><a href="@songSuggestion?.Song.Url" target="_blank">@string.Format("{0} - {1}", songSuggestion?.Song.Name, songSuggestion?.Song.Artist)</a></td>
 | 
			
		||||
                    <td>@displayName</td>
 | 
			
		||||
                    <td><a href="/SongSubmission/@songSuggestion?.Id">View</a></td>
 | 
			
		||||
                    <td class="=viewLike">
 | 
			
		||||
                        @if(songSuggestion?.Song != null)
 | 
			
		||||
                        {
 | 
			
		||||
                            var handler = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "UnlikeSong" : "LikeSong";
 | 
			
		||||
                            var likebuttonText = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "Unlike" : "Like";
 | 
			
		||||
                            <form method="post">
 | 
			
		||||
                                <input name="songId" value="@songSuggestion.Song.SongId" type="hidden" /> 
 | 
			
		||||
                                <input type="submit" id="songlike" value="@likebuttonText" asp-page-handler="@handler" />
 | 
			
		||||
                            </form>
 | 
			
		||||
                        }
 | 
			
		||||
                    </td>
 | 
			
		||||
                    @if(@User.Identity.IsAuthenticated)
 | 
			
		||||
                    {
 | 
			
		||||
                        <td><a href="/SongSubmission/@songSuggestion?.Id">View</a></td>
 | 
			
		||||
                        <td class="=viewLike">
 | 
			
		||||
                            @if(songSuggestion?.Song != null)
 | 
			
		||||
                            {
 | 
			
		||||
                                var handler = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "UnlikeSong" : "LikeSong";
 | 
			
		||||
                                var likebuttonText = Model.HasUserLikedThisSong(@songSuggestion.Song) ? "Unlike" : "Like";
 | 
			
		||||
                                <form method="post">
 | 
			
		||||
                                    <input name="songId" value="@songSuggestion.Song.SongId" type="hidden" /> 
 | 
			
		||||
                                    <input type="submit" id="songlike" value="@likebuttonText" asp-page-handler="@handler" />
 | 
			
		||||
                                </form>
 | 
			
		||||
                            }
 | 
			
		||||
                        </td>
 | 
			
		||||
                    }
 | 
			
		||||
                </tr>
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user