diff --git a/Controllers/Vehicle/ReportController.cs b/Controllers/Vehicle/ReportController.cs index 6671c13..a003762 100644 --- a/Controllers/Vehicle/ReportController.cs +++ b/Controllers/Vehicle/ReportController.cs @@ -183,7 +183,7 @@ namespace CarCareTracker.Controllers Collaborators = result, CanModifyCollaborators = userCanModify }; - return PartialView("_Collaborators", result); + return PartialView("_Collaborators", viewModel); } [TypeFilter(typeof(CollaboratorFilter))] [HttpPost] diff --git a/Views/Vehicle/_Collaborators.cshtml b/Views/Vehicle/_Collaborators.cshtml index 7a4ce8f..a502eea 100644 --- a/Views/Vehicle/_Collaborators.cshtml +++ b/Views/Vehicle/_Collaborators.cshtml @@ -21,21 +21,27 @@
| @translator.Translate(userLanguage, "Username") | -@translator.Translate(userLanguage, "Delete") | +@translator.Translate(userLanguage, "Username") | + @if (Model.CanModifyCollaborators) + { +@translator.Translate(userLanguage, "Delete") | + }
|---|---|---|---|
| @user.UserName | -- @if(User.Identity.Name != user.UserName && Model.CanModifyCollaborators) - { - - } - | +@user.UserName | + @if (Model.CanModifyCollaborators) + { ++ @if (User.Identity.Name != user.UserName && Model.CanModifyCollaborators) + { + + } + | + }