add comments for users [#145]

This commit is contained in:
Gary Sharp
2025-07-12 19:55:58 +10:00
parent 42e9045d5e
commit 2184c9e22e
35 changed files with 2201 additions and 498 deletions
@@ -0,0 +1,41 @@
@model Disco.Web.Models.User.ShowModel
@{
var canShowComments = Authorization.Has(Claims.User.ShowComments);
var canShowJobs = Authorization.Has(Claims.User.ShowJobs);
var jobCount = (Model.User.Jobs == null ? 0 : Model.User.Jobs.Count).ToString();
string label;
if (canShowComments & canShowJobs)
{
label = "Comments and Jobs [" + jobCount + "]";
}
else if (canShowComments)
{
label = "Comments";
}
else if (canShowJobs)
{
label = "Jobs [" + jobCount + "]";
}
else
{
return;
}
}
<div id="UserDetailTab-CommentsAndJobs" class="UserPart @(canShowComments ? "canShowComments" : "cannotShowComments") @(canShowJobs ? "canShowJobs" : "cannotShowJobs")">
@if (canShowComments)
{
<div id="UserDetailTab-CommentsContainer">
@Html.Partial(MVC.User.Views.UserParts.Comments, Model)
</div>
}
@if (canShowJobs)
{
<div id="UserDetailTab-JobsContainer">
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
</div>
}
<script>
$('#UserDetailTabItems').append('<li><a href="#UserDetailTab-CommentsAndJobs">@label</a></li>');
</script>
</div>