[13740] | 1 | @using HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User;
|
---|
[13754] | 2 | @using HeuristicLab.Clients.Access;
|
---|
| 3 | @model UserViewModel
|
---|
[13740] | 4 |
|
---|
| 5 | <div>
|
---|
| 6 |
|
---|
| 7 | @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User"))
|
---|
| 8 |
|
---|
| 9 | <ul class="nav nav-pills nav-justified">
|
---|
| 10 | <li role="presentation"
|
---|
| 11 | class="">
|
---|
| 12 | <a asp-controller="User"
|
---|
| 13 | asp-action="Index">
|
---|
[13754] | 14 | <i class="fa fa-user"></i> Users
|
---|
[13740] | 15 | </a>
|
---|
| 16 | </li>
|
---|
| 17 | <li role="presentation"
|
---|
| 18 | class="">
|
---|
| 19 | <a asp-controller="User"
|
---|
| 20 | asp-action="Groups">
|
---|
[13754] | 21 | <i class="fa fa-users"></i> Groups
|
---|
[13740] | 22 | </a>
|
---|
| 23 | </li>
|
---|
| 24 | <li role="presentation"
|
---|
| 25 | class="active">
|
---|
| 26 | <a asp-controller="User"
|
---|
| 27 | asp-action="Roles">
|
---|
[13754] | 28 | <i class="fa fa-gavel"></i> Roles
|
---|
[13740] | 29 | </a>
|
---|
| 30 | </li>
|
---|
| 31 | </ul>
|
---|
| 32 | <div class="row"
|
---|
| 33 | style="text-align:center">
|
---|
[13754] | 34 | @Model.message
|
---|
[13740] | 35 | </div>
|
---|
| 36 | <div class="row"
|
---|
| 37 | style="padding:10px; margin-right:0px!important">
|
---|
| 38 |
|
---|
[13754] | 39 | <div class="col-sm-4">
|
---|
| 40 | <div class="btn-group-vertical btn-block">
|
---|
| 41 | <a class="btn btn-info btn-lg btn-block disabled"
|
---|
| 42 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
---|
| 43 | text-shadow:2px 2px black;">
|
---|
| 44 | <i class="fa fa-gavel"></i> @Model.roles.Count Role@(Model.roles.Count != 1 ? "s" : "")
|
---|
| 45 | </a>
|
---|
| 46 | <a class="btn btn-success btn-block
|
---|
| 47 | @(Model.SelectedRole.Name == "" ? "active" : "")
|
---|
| 48 | "
|
---|
| 49 | asp-controller="User"
|
---|
| 50 | asp-action="SelectRole"
|
---|
| 51 | asp-route-name=""
|
---|
| 52 | onclick="showRole()"
|
---|
| 53 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
---|
| 54 | text-shadow:2px 2px black;">
|
---|
| 55 | <i class="fa fa-plus-circle"></i> Add new role
|
---|
| 56 | </a>
|
---|
| 57 | @foreach (var role in Model.roles)
|
---|
| 58 | {
|
---|
| 59 | <a class="btn btn-default @( role.Name == Model.SelectedRole.Name ? "active" : "" )"
|
---|
| 60 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"
|
---|
| 61 | asp-controller="User"
|
---|
| 62 | asp-action="SelectRole"
|
---|
| 63 | asp-route-name="@role.Name"
|
---|
| 64 | onclick="showRole()">
|
---|
| 65 | @role.Name
|
---|
| 66 | </a>
|
---|
| 67 | }
|
---|
| 68 | </div>
|
---|
| 69 | </div>
|
---|
| 70 | <p style="display:none"
|
---|
| 71 | id="saver"
|
---|
| 72 | class="text-center">
|
---|
| 73 | <br /><br /><br /><br /><br /><br /><br />
|
---|
| 74 | <i class="fa fa-save fa-spin fa-5x" id="spinner">
|
---|
| 75 | </i>
|
---|
| 76 | </p>
|
---|
| 77 | <p style="display:none"
|
---|
| 78 | id="role"
|
---|
| 79 | class="text-center">
|
---|
| 80 | <br /><br /><br /><br /><br /><br /><br />
|
---|
| 81 | <i class="fa fa-gavel fa-spin fa-5x" id="spinner">
|
---|
| 82 | </i>
|
---|
| 83 | </p>
|
---|
| 84 | <p style="display:none"
|
---|
| 85 | id="deleter"
|
---|
| 86 | class="text-center">
|
---|
| 87 | <br /><br /><br /><br /><br /><br /><br />
|
---|
| 88 | <i class="fa fa-trash-o fa-spin fa-5x" id="spinner">
|
---|
| 89 | </i>
|
---|
| 90 | </p>
|
---|
| 91 | <div class="col-sm-8"
|
---|
| 92 | id="content"
|
---|
| 93 | style="padding:5px; padding-left:10px;">
|
---|
| 94 | <div class="panel panel-default"
|
---|
| 95 | style="border-width:2px!important;padding:17px;
|
---|
| 96 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
|
---|
| 97 | <div class="row">
|
---|
| 98 | <h2 style="padding-left:20px">
|
---|
| 99 | @if (Model.SelectedRole.Name != "")
|
---|
| 100 | {
|
---|
| 101 | <i class="fa fa-gavel "></i> @Model.SelectedRole.Name;
|
---|
| 102 | }
|
---|
| 103 | else
|
---|
| 104 | {
|
---|
| 105 | <i class="fa fa-plus-circle "></i> @("Add new role")
|
---|
| 106 |
|
---|
| 107 | }
|
---|
| 108 | </h2>
|
---|
| 109 | <form class="form-horizontal"
|
---|
| 110 | method="post"
|
---|
| 111 | asp-action="saveRole"
|
---|
| 112 | asp-controller="User" enctype="multipart/form-data">
|
---|
| 113 | <div class="form-group">
|
---|
| 114 | <label class="col-sm-3 control-label">
|
---|
| 115 | Role name
|
---|
| 116 | </label>
|
---|
| 117 | <label class="col-sm-8 control-label"
|
---|
| 118 | style="text-align:left; @(Model.SelectedRole.Name == "" ? "display:none" : "")">
|
---|
| 119 | @Model.SelectedRole.Name
|
---|
| 120 | </label>
|
---|
| 121 | <div class="col-sm-8"
|
---|
| 122 | style="@(Model.SelectedRole.Name == "" ? "" : "display:none")">
|
---|
| 123 | <input type="text"
|
---|
| 124 | class="form-control"
|
---|
| 125 | id="inprolename"
|
---|
| 126 | name="inprolename"
|
---|
| 127 | placeholder="Role name"
|
---|
| 128 | value="@Model.SelectedRole.Name"
|
---|
| 129 | onkeydown="triggerSave()" />
|
---|
| 130 | </div>
|
---|
| 131 | </div>
|
---|
| 132 |
|
---|
| 133 | @if (Model.SelectedRole.Name == "")
|
---|
| 134 | {
|
---|
| 135 | <div class="form-group">
|
---|
| 136 | <div class="col-sm-offset-3 col-sm-9">
|
---|
| 137 | <button type="submit"
|
---|
| 138 | id="inpsaver"
|
---|
| 139 | disabled
|
---|
| 140 | class="btn btn-default"
|
---|
| 141 | onclick="showSaver()">
|
---|
| 142 | <i class="fa fa-plus-square-o"></i> Add role
|
---|
| 143 | </button>
|
---|
| 144 | </div>
|
---|
| 145 | </div>
|
---|
| 146 |
|
---|
| 147 |
|
---|
| 148 | }
|
---|
| 149 | else
|
---|
| 150 | {
|
---|
| 151 |
|
---|
| 152 | <div class="form-group">
|
---|
| 153 | <label class="col-sm-3 control-label">
|
---|
| 154 | Users
|
---|
| 155 | </label>
|
---|
| 156 | <div class="col-sm-8 control-label" style="text-align:left">
|
---|
| 157 | @foreach (var us in Model.SelectedRoleEnrolled)
|
---|
| 158 | {
|
---|
| 159 | <div class="row">
|
---|
| 160 | <p class="col-sm-10">
|
---|
| 161 | <i class="fa fa-user"></i> @(((User)us).UserName) (@(((User)us).FullName))
|
---|
| 162 | </p>
|
---|
| 163 | <p class="col-sm-2">
|
---|
| 164 | <a class="btn btn-danger pull-right"
|
---|
| 165 | asp-controller="User"
|
---|
| 166 | asp-action="deleteRoleUser"
|
---|
| 167 | asp-route-id="@us.Id"
|
---|
| 168 | asp-route-role="@Model.SelectedRole.Name"
|
---|
| 169 | onclick="showDeleter()">
|
---|
| 170 | <i class="fa fa-trash-o"></i>
|
---|
| 171 | </a>
|
---|
| 172 | </p>
|
---|
| 173 |
|
---|
| 174 | </div>
|
---|
| 175 | }
|
---|
| 176 | @if (Model.SelectedRoleEnrolled.Count == 0)
|
---|
| 177 | {
|
---|
| 178 | <p>
|
---|
| 179 | There are currently no users who have this role
|
---|
| 180 | </p>
|
---|
| 181 |
|
---|
| 182 | }
|
---|
| 183 | </div>
|
---|
| 184 | </div>
|
---|
| 185 | <div class="form-group">
|
---|
| 186 | <div class="col-sm-offset-3 col-sm-3">
|
---|
| 187 | <button type="submit"
|
---|
| 188 | id="inpsaver"
|
---|
| 189 | disabled
|
---|
| 190 | class="btn btn-default"
|
---|
| 191 | onclick="showSaver()">
|
---|
| 192 | <i class="fa fa-save"></i> Save changes
|
---|
| 193 | </button>
|
---|
| 194 | </div>
|
---|
| 195 | <div class="col-sm-5">
|
---|
| 196 | <a class="btn btn-danger pull-right"
|
---|
| 197 | asp-controller="User"
|
---|
| 198 | asp-action="deleteRole"
|
---|
| 199 | asp-route-name="@Model.SelectedRole.Name"
|
---|
| 200 |
|
---|
| 201 | onclick="showDeleter()">
|
---|
| 202 | <i class="fa fa-trash-o"></i> Delete role
|
---|
| 203 | </a>
|
---|
| 204 | </div>
|
---|
| 205 | </div>
|
---|
| 206 |
|
---|
| 207 |
|
---|
| 208 |
|
---|
| 209 | }
|
---|
| 210 | <script type="text/javascript">
|
---|
| 211 | function triggerSave() {
|
---|
| 212 | if ($("#inprolename").val() != "") {
|
---|
| 213 | document.getElementById("inpsaver").className = "btn btn-lg btn-success";
|
---|
| 214 | document.getElementById("inpsaver").disabled = false;
|
---|
| 215 | }
|
---|
| 216 | else {
|
---|
| 217 | document.getElementById("inpsaver").className = "btn btn-default";
|
---|
| 218 | document.getElementById("inpsaver").disabled = true;
|
---|
| 219 |
|
---|
| 220 | }
|
---|
| 221 |
|
---|
| 222 | }
|
---|
| 223 | </script>
|
---|
| 224 | </form>
|
---|
| 225 | </div>
|
---|
| 226 | </div>
|
---|
| 227 | </div>
|
---|
[13740] | 228 | </div>
|
---|
[13754] | 229 | <script type="text/javascript">
|
---|
| 230 | function showSaver() {
|
---|
| 231 | document.getElementById("content").style.display = "none";
|
---|
| 232 | document.getElementById("saver").style.display = "";
|
---|
| 233 |
|
---|
| 234 | }
|
---|
| 235 | function showRole() {
|
---|
| 236 | document.getElementById("content").style.display = "none";
|
---|
| 237 | document.getElementById("role").style.display = "";
|
---|
| 238 |
|
---|
| 239 | }
|
---|
| 240 | function showDeleter() {
|
---|
| 241 | document.getElementById("content").style.display = "none";
|
---|
| 242 | document.getElementById("deleter").style.display = "";
|
---|
| 243 | }
|
---|
| 244 | </script>
|
---|
[13740] | 245 | </div>
|
---|