@model CompetitionPlatform.Models.ProjectViewModels.ProjectCommentPartialViewModel

<form asp-controller="ProjectDetails" asp-action="AddComment" enctype="multipart/form-data">
    <div class="form-group">
        @Html.Hidden("projectId", Model.ProjectId)
        <input asp-for="@Model.ProjectId" type="hidden" />
        <textarea asp-for="@Model.Comment" rows="5" class="form-control" placeholder="Enter your comment here..."></textarea>
    </div>
    <input type="submit" value="Post Comment" class="btn btn-primary pull-right" />
</form>
<div class="project-details-comments">
    @foreach (var comment in Model.Comments)
    {
        <div class="container">
            <div class="row">
                <div class="project-comments-avatar inline">
                    <img src="~/images/avatar.svg"
                         alt="@Model.FullName"
                         asp-append-version="true" />
                </div>
                <p class="project-comment-author bold-text inline">
                    @comment.FullName
                    @if (Model.UserId == comment.UserId)
                    {
                        <span class="label label-primary">CREATOR</span>
                    }
                </p>
                <small class="inline text-muted">@comment.LastModified.ToString("hh:mm tt MMMM dd, yyyy")</small>
            </div>
            <div class="project-comment col-md-9">
                <p class="project-comment-text">@comment.Comment</p>
            </div>
        </div>
    }
</div>
@using System.Threading.Tasks
@using CompetitionPlatform.Helpers
@model CompetitionPlatform.Models.ProjectViewModels.ProjectCommentPartialViewModel

<form asp-controller="ProjectDetails" asp-action="AddComment" enctype="multipart/form-data">
    @if (ClaimsHelper.GetUser(User.Identity).Email != null)
    {
        <div class="form-group">
            @Html.Hidden("projectId", Model.ProjectId)
            <input asp-for="@Model.ProjectId" type="hidden" />
            <textarea asp-for="@Model.Comment" rows="5" class="form-control" placeholder="Enter your comment here..."></textarea>
        </div>
        <input type="submit" value="Post Comment" class="btn btn-primary pull-right" />
    }
</form>
<div class="project-details-comments">
    @foreach (var comment in Model.Comments)
    {
        <div class="container">
            <div class="row">
                <div class="project-comments-avatar inline">
                    <img src="~/images/avatar.svg"
                         alt="@Model.FullName"
                         asp-append-version="true" />
                </div>
                <p class="project-comment-author bold-text inline">
                    @comment.FullName
                    @if (Model.UserId == comment.UserId)
                    {
                        <span class="label label-primary">CREATOR</span>
                    }
                </p>
                <small class="inline text-muted">@comment.LastModified.ToString("hh:mm tt MMMM dd, yyyy")</small>
            </div>
            <div class="project-comment col-md-9">
                <p class="project-comment-text">@comment.Comment</p>
            </div>
        </div>
    }
</div>
Hide comment form if user not signed in.
Hide comment form if user not signed in.
