- Timestamp:
- 04/01/16 16:34:14 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs
r13741 r13742 27 27 _environment = env; 28 28 } 29 #region Users30 29 private void init() 31 30 { … … 43 42 } 44 43 } 44 #region Users 45 45 46 public IActionResult Index() 46 47 { … … 75 76 { 76 77 vm.SelectedUser = vm.getUserById(curr); 78 vm.SelectedUserSubscriptions = accessClient.getSubscribedGroups(curr); 77 79 ViewBag.title = vm.SelectedUser.UserName; 78 80 } … … 97 99 user = accessClient.Users.Find(x => x.Id == uid); 98 100 99 user.Id = uid; 100 user.UserName = inpusername; 101 101 102 user.FullName = inpfullname; 102 103 user.Email = inpemail; … … 105 106 if (uid == Guid.Empty) 106 107 { 108 user.UserName = inpusername; 107 109 uid = accessClient.addUser(user); 108 ViewBag.Title = inpusername + " added - User";110 ViewBag.Title = user.UserName + " added - User"; 109 111 } 110 112 else 111 113 { 112 114 accessClient.updateUser(user); 113 ViewBag.Title = inpusername + " updated - User";115 ViewBag.Title = user.UserName + " updated - User"; 114 116 } 115 117 116 118 return RedirectToAction( "SelectUser", new { id = uid.ToString()}); 119 120 } 121 public IActionResult deleteUser(string id) 122 { 123 init(); 124 var uid = Guid.Parse(id); 125 UserViewModel vm = new UserViewModel(accessClient).refreshUsers(); 126 127 if (uid == Guid.Empty) 128 { 129 vm.message = "Something went wrong, user is not deleted"; 130 return View("Index", vm); 131 } 132 else 133 { 134 var user = vm.getUserById(uid); 135 vm.message = user.UserName + " ("+user.FullName+") has been deleted"; 136 accessClient.DeleteUser(user); 137 vm.refreshUsers(); 138 return View("Index", vm); 139 } 117 140 118 141 } … … 128 151 129 152 ViewBag.Title = "Groups"; 130 // accessClient.RefreshUsers(); 131 132 return View("Groups"); 133 } 134 else 135 { 136 return RedirectToAction("Index", "Home"); 137 } 153 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers(); 154 return View("Groups", vm); 155 } 156 else 157 { 158 return RedirectToAction("Index", "Home"); 159 } 160 } 161 public IActionResult SelectGroup(string id) 162 { 163 init(); 164 if (serviceLocator.CheckLogin()) 165 { 166 Guid curr = Guid.Parse(id); 167 168 UserViewModel vm = new UserViewModel(accessClient) 169 .refreshGroups() 170 .refreshUsers(); 171 if (curr == Guid.Empty) 172 { 173 ViewBag.Title = "Add group"; 174 } 175 else 176 { 177 vm.SelectedGroup = vm.getGroupById(curr); 178 vm.SelectedGroupMembers = accessClient.getGroupMembers(curr); 179 ViewBag.title = vm.SelectedGroup.Name; 180 } 181 ViewBag.Title += " - Group"; 182 return View("Groups", vm); 183 } 184 else 185 { 186 return RedirectToAction("Index", "Home"); 187 } 188 } 189 [HttpPost] 190 public IActionResult saveGroup(string inpgroupname, string u, string[] userstoadd, string[] groupstoadd) 191 { 192 init(); 193 var uid = Guid.Parse(u); 194 var vm = new UserViewModel(accessClient).refreshGroups().refreshUsers(); 195 196 Access.UserGroup group; 197 198 if (uid == Guid.Empty) 199 group = new Access.UserGroup(); 200 else 201 group = accessClient.Groups.Find(x => x.Id == uid); 202 203 group.Name = inpgroupname; 204 205 if (uid == Guid.Empty) 206 { 207 uid = accessClient.addGroup(group); 208 ViewBag.Title = group.Name + " added - Group"; 209 } 210 else 211 { 212 accessClient.updateGroup(group); 213 ViewBag.Title = group.Name + " updated - Group"; 214 } 215 vm.refreshGroups(); 216 group = vm.getGroupById(uid); 217 foreach(var s in userstoadd) 218 { 219 var tempid = Guid.Parse(s); 220 var member = vm.getUserById(tempid); 221 accessClient.addMember(member, group); 222 } 223 foreach (var g in groupstoadd) 224 { 225 var tempid = Guid.Parse(g); 226 var member = vm.getGroupById(tempid); 227 accessClient.addMember(member, group); 228 } 229 230 return RedirectToAction("SelectGroup", new { id = uid.ToString() }); 231 232 } 233 public IActionResult deleteGroup(string id) 234 { 235 init(); 236 var uid = Guid.Parse(id); 237 UserViewModel vm = new UserViewModel(accessClient).refreshGroups(); 238 239 if (uid == Guid.Empty) 240 { 241 vm.message = "Something went wrong, group is not deleted"; 242 return View("Groups", vm); 243 } 244 else 245 { 246 var group = vm.getGroupById(uid); 247 vm.message = group.Name + " has been deleted"; 248 accessClient.deleteUserGroup(group); 249 vm.refreshGroups(); 250 return View("Groups", vm); 251 } 252 253 } 254 public IActionResult deleteMember(string g, string m) 255 { 256 init(); 257 var gid = Guid.Parse(g); 258 var mid = Guid.Parse(m); 259 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers() ; 260 261 if (gid == Guid.Empty || mid == Guid.Empty) 262 { 263 vm.message = "Something went wrong, member is not deleted"; 264 return View("Groups", vm); 265 } 266 else 267 { 268 var group = vm.getGroupById(gid); 269 Access.UserGroupBase member = vm.getUserById(mid); 270 if(member == null) 271 { 272 member = vm.getGroupById(mid); 273 } 274 vm.message = " Member deleted"; 275 accessClient.deleteMember(member,group); 276 vm.refreshGroups(); 277 return RedirectToAction("SelectGroup", new { id = g }); 278 } 279 138 280 } 139 281 #endregion 282 140 283 #region Roles 141 284 public IActionResult Roles() -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/AccessAdministrationClient.cs
r13741 r13742 27 27 using HeuristicLab.Clients.Hive.WebJobManager.ViewModels; 28 28 using HeuristicLab.Clients.Hive.WebJobManager.Services; 29 using System.Collections.Generic; 29 30 30 31 namespace HeuristicLab.Clients.Access.Administration … … 169 170 } 170 171 172 /* BROKEN 171 173 public void DeleteUserGroup(UserGroup u) 172 174 { … … 179 181 ExecuteActionAsync(deleteUserGroupAction, exceptionCallback); 180 182 } 181 183 */ 182 184 public void DeleteRole(Role u) 183 185 { … … 233 235 #endregion 234 236 237 #region User 238 239 public string resetPassword(Guid id) 240 { 241 return CallAccessService<string>(s => s.ResetPassword(id)); 242 } 243 public Guid addUser(Access.User u) 244 { 245 return CallAccessService(s => s.AddUser(u).Id); 246 } 247 248 public void updateUser(Access.User u) 249 { 250 251 CallAccessService(s => s.UpdateUser(u)); 252 } 253 #endregion 254 255 #region Group 256 public Guid addGroup(Access.UserGroup g) 257 { 258 return CallAccessService(s => s.AddUserGroup(g)); 259 } 260 public void updateGroup(UserGroup g) 261 { 262 CallAccessService(s => s.UpdateUserGroup(g)); 263 } 264 public List<Access.UserGroup> getSubscribedGroups(Guid id) 265 { 266 var maps = CallAccessService(s => s.GetUserGroupMapping()); 267 maps = maps.FindAll(x => x.Child == id); 268 269 RefreshUserGroups(); 270 RefreshUsers(); 271 272 List<Access.UserGroup> members = new List<Access.UserGroup>(); 273 foreach (var map in maps) 274 { 275 UserGroup g = Groups.Find(x => x.Id == map.Parent); 276 if (g != null) 277 { 278 members.Add( g); 279 } 280 } 281 return members; 282 } 283 public List<Access.UserGroupBase> getGroupMembers(Guid id) 284 { 285 var maps = CallAccessService(s => s.GetUserGroupMapping()); 286 maps = maps.FindAll(x => x.Parent == id); 287 288 RefreshUserGroups(); 289 RefreshUsers(); 290 291 List<Access.UserGroupBase> members = new List<Access.UserGroupBase>(); 292 foreach (var map in maps) 293 { 294 User t = users.Find(x => x.Id == map.Child); 295 if (t == null) 296 { 297 UserGroup g = Groups.Find(x => x.Id == map.Child); 298 if (g != null) 299 { 300 members.Insert(0,g);//Groups always in the front 301 } 302 } 303 else 304 { 305 members.Add(t);//members in the back 306 } 307 } 308 return members; 309 } 310 311 public void deleteUserGroup(UserGroup group) 312 { 313 deleteAllMembers(group); 314 CallAccessService(s => s.DeleteUserGroup(group)); 315 } 316 private void deleteAllMembers(UserGroup group) 317 { 318 var list = getGroupMembers(group.Id); 319 foreach (var member in list) 320 {//Empties all member connections 321 CallAccessService(s => s.RemoveUserGroupBaseFromGroup(member, group)); 322 } 323 } 324 public void addMember(UserGroupBase member, UserGroup group) 325 { 326 CallAccessService(s => s.AddUserGroupBaseToGroup(member, group)); 327 } 328 public void deleteMember(UserGroupBase member,UserGroup group) 329 { 330 CallAccessService(s => s.RemoveUserGroupBaseFromGroup(member, group)); 331 } 332 #endregion 333 235 334 #region Helpers 236 public string resetPassword(Guid id)237 {238 return CallAccessService<string>(s => s.ResetPassword(id));239 }240 public Guid addUser(Access.User u)241 {242 return CallAccessService(s => s.AddUser(u).Id);243 }244 public void updateUser(Access.User u)245 {246 CallAccessService(s => s.UpdateUser(u));247 }248 public void deleteUser(Access.User u)249 {250 CallAccessService(s => s.DeleteUser(u));251 }252 335 private void getAccessClient() 253 336 { -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/User/UserViewModel.cs
r13741 r13742 17 17 18 18 public Access.User SelectedUser { get; set; } 19 public List<Access.UserGroup> SelectedUserSubscriptions { get; set; } 20 public Access.UserGroup SelectedGroup { get; set; } 21 public List<Access.UserGroupBase> SelectedGroupMembers { get; set; } 19 22 20 23 public UserViewModel(AccessAdministrationClient ac) … … 23 26 accessClient = ac; 24 27 SelectedUser = new Access.User(); 28 SelectedGroup = new Access.UserGroup(); 29 SelectedUserSubscriptions = new List<Access.UserGroup>(); 30 SelectedGroupMembers = new List<Access.UserGroupBase>(); 31 25 32 26 33 } … … 47 54 return users.Find(x => x.Id == id); 48 55 } 56 public Access.UserGroup getGroupById(Guid id) 57 { 58 return ugroups.Find(x => x.Id == id); 59 } 49 60 } 50 61 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml
r13740 r13742 10 10 <a asp-controller="Job" 11 11 asp-action="Index"> 12 Jobs12 <i class="fa fa-tasks"></i> Jobs 13 13 </a> 14 14 </li> … … 17 17 <a asp-controller="Job" 18 18 asp-action="Uploads"> 19 Uploads19 <i class="fa fa-cloud"></i> Uploads 20 20 </a> 21 21 </li> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFile.cshtml
r13740 r13742 19 19 <a asp-controller="Job" 20 20 asp-action="Index"> 21 Jobs21 <i class="fa fa-tasks"></i> Jobs 22 22 </a> 23 23 </li> … … 26 26 <a asp-controller="Job" 27 27 asp-action="Uploads"> 28 Uploads28 <i class="fa fa-cloud"></i> Uploads 29 29 </a> 30 30 </li> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Uploads.cshtml
r13739 r13742 10 10 <a asp-controller="Job" 11 11 asp-action="Index"> 12 Jobs12 <i class="fa fa-tasks"></i> Jobs 13 13 </a> 14 14 </li> … … 17 17 <a asp-controller="Job" 18 18 asp-action="Uploads"> 19 Uploads19 <i class="fa fa-cloud"></i> Uploads 20 20 </a> 21 21 </li> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Groups.cshtml
r13740 r13742 1 1 @using HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User; 2 2 @using HeuristicLab.Clients.Access; 3 @model UserViewModel 3 4 4 5 <div> … … 11 12 <a asp-controller="User" 12 13 asp-action="Index"> 13 Users14 <i class="fa fa-user"></i> Users 14 15 </a> 15 16 </li> … … 18 19 <a asp-controller="User" 19 20 asp-action="Groups"> 20 Groups21 <i class="fa fa-group"></i> Groups 21 22 </a> 22 23 </li> … … 25 26 <a asp-controller="User" 26 27 asp-action="Roles"> 27 Roles28 <i class="fa fa-sitemap"></i> Roles 28 29 </a> 29 30 </li> … … 31 32 <div class="row" 32 33 style="text-align:center"> 33 Model.message34 @Model.message 34 35 </div> 35 36 <div class="row" 36 37 style="padding:10px; margin-right:0px!important"> 37 38 <div class="col-sm-4"> 39 <div class="btn-group-vertical btn-block"> 40 <a class="btn btn-info btn-lg btn-block disabled" 41 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 42 text-shadow:2px 2px black;"> 43 <i class="fa fa-group"></i> @Model.ugroups.Count Group@(Model.ugroups.Count != 1 ? "s" : "") 44 </a> 45 <a class="btn btn-success btn-block 46 @(Model.SelectedGroup.Id == Guid.Empty ? "active" : "") 47 " 48 asp-controller="User" 49 asp-action="SelectGroup" 50 asp-route-id="@Guid.Empty" 51 onclick="showGroup()" 52 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 53 text-shadow:2px 2px black;"> 54 <i class="fa fa-plus-circle"></i> Add new group 55 </a> 56 @foreach (var group in Model.ugroups) 57 { 58 <a class="btn btn-default @( group.Id == Model.SelectedGroup.Id ? "active" : "" )" 59 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" 60 asp-controller="User" 61 asp-action="SelectGroup" 62 asp-route-id="@group.Id" 63 onclick="showGroup()"> 64 @group.Name 65 </a> 66 } 67 </div> 68 </div> 69 <p style="display:none" 70 id="saver" 71 class="text-center"> 72 <br /><br /><br /><br /><br /><br /><br /> 73 <i class="fa fa-save fa-spin fa-5x" id="spinner"> 74 </i> 75 </p> 76 <p style="display:none" 77 id="group" 78 class="text-center"> 79 <br /><br /><br /><br /><br /><br /><br /> 80 <i class="fa fa-group fa-spin fa-5x" id="spinner"> 81 </i> 82 </p> 83 <p style="display:none" 84 id="deleter" 85 class="text-center"> 86 <br /><br /><br /><br /><br /><br /><br /> 87 <i class="fa fa-trash-o fa-spin fa-5x" id="spinner"> 88 </i> 89 </p> 90 91 <div class="col-sm-8" 92 id="content" 93 style="padding:5px; padding-left:10px;"> 94 @if (Model.SelectedGroup != null) 95 { 96 <div class="panel panel-default" 97 style="border-width:2px!important;padding:17px; 98 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> 99 <div class="row"> 100 <h2 style="padding-left:20px"> 101 @if (Model.SelectedGroup.Id != Guid.Empty) 102 { 103 <i class="fa fa-group"></i> @Model.SelectedGroup.Name 104 } 105 else 106 { 107 <i class='fa fa-plus-circle'></i> @("Add new group") 108 109 } 110 </h2> 111 <form class="form-horizontal" 112 method="post" 113 asp-action="saveGroup" 114 asp-controller="User" enctype="multipart/form-data"> 115 <div class="form-group"> 116 <label for="inpgroupname" 117 class="col-sm-3 control-label"> 118 Group name 119 </label> 120 <div class="col-sm-8"> 121 <input type="text" 122 class="form-control" 123 id="inpgroupname" 124 name="inpgroupname" 125 placeholder="Group name" 126 onkeydown="triggerSave()" 127 value="@Model.SelectedGroup.Name"> 128 </div> 129 </div> 130 131 <div class="form-group"> 132 <label class="col-sm-3 control-label"> 133 Group id 134 </label> 135 <label class="col-sm-8 control-label" style="text-align:left"> 136 @Model.SelectedGroup.Id 137 </label> 138 <input type="text" 139 style="display:none" 140 id="u" 141 name="u" 142 value="@Model.SelectedGroup.Id" /> 143 </div> 144 @if (Model.SelectedGroup.Id != Guid.Empty) 145 { 146 <div style="padding-left:20px"> 147 <h3>@Model.SelectedGroupMembers.Count Member@(Model.SelectedGroupMembers.Count != 1 ? "s" : "")</h3> 148 @foreach (var member in Model.SelectedGroupMembers) 149 { 150 <p> 151 <a class="btn btn-danger" 152 asp-controller="User" 153 asp-action="deleteMember" 154 asp-route-g="@Model.SelectedGroup.Id" 155 asp-route-m="@member.Id" 156 onclick="showDeleter()"> 157 <i class="fa fa-trash-o"></i> 158 </a> 159 @if (member is User) 160 { 161 var umember = (User)member; 162 <i class="fa fa-user"></i> @(umember.UserName + "(" + umember.FullName + ")") 163 164 165 } 166 else if (member is UserGroup) 167 { 168 var gmember = (UserGroup)member; 169 <i class="fa fa-group"></i> @(gmember.Name) 170 171 } 172 173 </p> 174 } 175 @if (Model.SelectedGroupMembers.Count == 0) 176 { 177 <p>This group currently has no members</p> 178 179 } 180 </div> 181 } 182 <div class="row" style="margin-left:10px;margin-right:10px;margin-top:-10px"> 183 <a class="btn btn-primary" 184 data-toggle="collapse" 185 href="#addmembers" 186 aria-expanded="false" 187 aria-controls="addmembers" 188 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 189 text-shadow:2px 2px black;"> 190 Add members 191 </a> 192 <div class="collapse" 193 id="addmembers"> 194 <div class="panel panel-primary col-sm-6" style="padding:0px"> 195 <div class="panel-heading"> 196 <p> 197 <i class="fa fa-user"></i> Users 198 <button class="btn btn-sm btn-default" 199 type="button" 200 onclick="selectAll('userstoadd'); triggerSave()">Select all</button> 201 <button class="btn btn-sm btn-default" 202 type="button" 203 onclick="deselectAll('userstoadd'); triggerSave()">Deselect all</button> 204 </p> 205 </div> 206 <div class="panel-body"> 207 @foreach (var user in Model.users) 208 { 209 <div class="checkbox"> 210 <label> 211 <input type="checkbox" 212 name="userstoadd" 213 @(Model.SelectedGroupMembers.Contains(user) ? "checked disabled" : "") 214 value="@user.Id" 215 onclick="triggerSave()"> 216 @user.UserName (@user.FullName) 217 </label> 218 </div> 219 220 } 221 </div> 222 </div> 223 <div class="panel panel-primary col-sm-6" style="padding:0px"> 224 <div class="panel-heading"> 225 <p><i class="fa fa-group"></i> Groups 226 227 <button class="btn btn-sm btn-default" 228 type="button" 229 onclick="selectAll('groupstoadd'); triggerSave()"> 230 Select all 231 </button> 232 <button class="btn btn-sm btn-default" 233 type="button" 234 onclick="deselectAll('groupstoadd'); triggerSave()"> 235 Deselect all 236 </button> 237 </p> 238 </div> 239 <div class="panel-body"> 240 @foreach (var group in Model.ugroups) 241 { 242 <div class="checkbox"> 243 <label> 244 <input type="checkbox" 245 name="groupstoadd" 246 @(Model.SelectedGroupMembers.Contains(group) ? "checked disabled" : "") 247 value="@group.Id" 248 onclick="triggerSave()"> 249 @group.Name 250 </label> 251 </div> 252 253 } 254 </div> 255 </div> 256 </div> 257 </div> 258 @if (Model.SelectedGroup.Id == Guid.Empty) 259 {//New goup 260 <div class="form-group"> 261 <div class="col-sm-offset-3 col-sm-9"> 262 <button type="submit" 263 id="inpsaver" 264 disabled 265 class="btn btn-default" 266 onclick="showSaver()"> 267 <i class="fa fa-plus-circle"></i> Add group 268 </button> 269 </div> 270 </div> 271 272 273 } 274 else 275 {//Changing an existing group 276 277 <div class="form-group"> 278 <div class="col-sm-offset-3 col-sm-3"> 279 <button type="submit" 280 id="inpsaver" 281 disabled 282 class="btn btn-default" 283 onclick="showSaver()"> 284 <i class="fa fa-save"></i> Save changes 285 </button> 286 </div> 287 <div class="col-sm-5"> 288 <a class="btn btn-danger pull-right" 289 asp-controller="User" 290 asp-action="deleteGroup" 291 asp-route-id="@Model.SelectedGroup.Id" 292 onclick="showDeleter()"> 293 <i class="fa fa-trash-o"></i> Delete group 294 </a> 295 </div> 296 </div> 297 298 299 300 } 301 <script type="text/javascript"> 302 function triggerSave() { 303 if ($("#inpgroupname").val() != "") { 304 document.getElementById("inpsaver").className = "btn btn-lg btn-success"; 305 document.getElementById("inpsaver").disabled = false; 306 } 307 else { 308 document.getElementById("inpsaver").className = "btn btn-default"; 309 document.getElementById("inpsaver").disabled = true; 310 311 } 312 313 } 314 </script> 315 </form> 316 317 </div> 318 </div> 319 320 } 321 </div> 38 322 </div> 323 <script type="text/javascript"> 324 function showSaver() { 325 document.getElementById("content").style.display = "none"; 326 document.getElementById("saver").style.display = ""; 327 328 } 329 function showGroup() { 330 document.getElementById("content").style.display = "none"; 331 document.getElementById("group").style.display = ""; 332 333 } 334 function showDeleter() { 335 document.getElementById("content").style.display = "none"; 336 document.getElementById("deleter").style.display = ""; 337 } 338 function selectAll(name) { 339 checkboxes = document.getElementsByName(name); 340 for(var i=0, n=checkboxes.length;i<n;i++) { 341 checkboxes[i].checked = true; 342 } 343 } 344 function deselectAll(name) { 345 checkboxes = document.getElementsByName(name); 346 for (var i = 0, n = checkboxes.length; i < n; i++) { 347 if(checkboxes[i].disabled == false) 348 checkboxes[i].checked = false; 349 } 350 } 351 </script> 39 352 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml
r13741 r13742 11 11 <a asp-controller="User" 12 12 asp-action="Index"> 13 Users13 <i class="fa fa-user"></i> Users 14 14 </a> 15 15 </li> … … 18 18 <a asp-controller="User" 19 19 asp-action="Groups"> 20 Groups20 <i class="fa fa-group"></i> Groups 21 21 </a> 22 22 </li> … … 25 25 <a asp-controller="User" 26 26 asp-action="Roles"> 27 Roles27 <i class="fa fa-sitemap"></i> Roles 28 28 </a> 29 29 </li> … … 51 51 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 52 52 text-shadow:2px 2px black;"> 53 <i class="fa fa-user s"></i> Users53 <i class="fa fa-user"></i> @Model.users.Count User@(Model.users.Count != 1 ? "s" : "") 54 54 </a> 55 55 <a class="btn btn-success btn-block … … 110 110 @if (Model.SelectedUser.Id != Guid.Empty) 111 111 { 112 @Model.SelectedUser.UserName;112 <i class="fa fa-user "></i> @Model.SelectedUser.UserName; 113 113 } 114 114 else 115 115 { 116 @("Add new user")116 <i class="fa fa-user-plus "></i> @("Add new user") 117 117 118 118 } 119 119 </h2> 120 120 <form class="form-horizontal" 121 121 method="post" 122 122 asp-action="saveUser" 123 123 asp-controller="User" enctype="multipart/form-data"> 124 <div class="form-group" >124 <div class="form-group" style="@(Model.SelectedUser.Id == Guid.Empty ? "" : "display:none")"> 125 125 <label for="inpusername" 126 126 class="col-sm-3 control-label"> … … 133 133 name="inpusername" 134 134 placeholder="Username" 135 on change="triggerSave()"135 onkeydown="triggerSave()" 136 136 value="@Model.SelectedUser.UserName"> 137 137 </div> … … 148 148 name="inpfullname" 149 149 placeholder="Full name" 150 on change="triggerSave()"150 onkeydown="triggerSave()" 151 151 value="@Model.SelectedUser.FullName"> 152 152 </div> … … 163 163 name="inpemail" 164 164 placeholder="Email" 165 on change="triggerSave()"165 onkeydown="triggerSave()" 166 166 value="@Model.SelectedUser.Email"> 167 167 </div> … … 203 203 id="inpsaver" 204 204 disabled 205 class="btn btn-lg btn-default"> 206 Add user 205 class="btn btn-default" 206 onclick="showSaver()"> 207 <i class="fa fa-plus-square-o"></i> Add user 207 208 </button> 208 209 </div> … … 215 216 <div class="form-group"> 216 217 <label class="col-sm-3 control-label"> 217 Last activity218 Password 218 219 </label> 219 <div id="inppassreset" >220 <div id="inppassreset" class="col-sm-8"> 220 221 <button type="button" 221 222 onclick="resetPass('@(Model.SelectedUser.Id)')" 222 class="btn btn- lg btn-default">223 Reset password223 class="btn btn-default"> 224 <i class="fa fa-unlock"></i> Reset password 224 225 </button> 225 226 </div> 226 227 </div> 228 227 229 <div class="form-group"> 228 <div class="col-sm-offset-3 col-sm-9"> 230 <label class="col-sm-3 control-label"> 231 Member of 232 </label> 233 <div class="col-sm-8"> 234 @if (Model.SelectedUserSubscriptions.Count > 0) 235 { 236 @foreach (var g in Model.SelectedUserSubscriptions) 237 { 238 <p><i class="fa fa-group"></i> @g.Name</p> 239 } 240 } 241 else 242 { 243 <p>Not a member of any groups</p> 244 } 245 </div> 246 </div> 247 <div class="form-group"> 248 <div class="col-sm-offset-3 col-sm-3"> 229 249 <button type="submit" 230 250 id="inpsaver" 231 251 disabled 232 class="btn btn-lg btn-default"> 233 Save changes 252 class="btn btn-default" 253 onclick="showSaver()"> 254 <i class="fa fa-save"></i> Save changes 234 255 </button> 235 256 </div> 236 </div> 257 <div class="col-sm-5"> 258 <a class="btn btn-danger pull-right" 259 asp-controller="User" 260 asp-action="deleteUser" 261 asp-route-id="@Model.SelectedUser.Id" 262 onclick="showDeleter()"> 263 <i class="fa fa-trash-o"></i> Delete user 264 </a> 265 </div> 266 </div> 267 237 268 238 269 … … 240 271 <script type="text/javascript"> 241 272 function triggerSave() { 242 if ($("#inpusername").val() != "" && 243 $("#inpfullname").val() != "" && 273 if ($("#inpfullname").val() != "" && 244 274 $("#inpemail").val() != "") { 245 275 document.getElementById("inpsaver").className = "btn btn-lg btn-success"; … … 247 277 } 248 278 else { 249 document.getElementById("inpsaver").className = "btn btn- lg btn-default";279 document.getElementById("inpsaver").className = "btn btn-default"; 250 280 document.getElementById("inpsaver").disabled = true; 251 281 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/Scripts/UserInfoHubber.js
r13741 r13742 8 8 $.connection.hub.start(); 9 9 hubber.client.showNewPass = function (pass) { 10 $("#inppassreset").html("<label class=' col-sm-8control-label' style='text-align:left'>New password: " + pass + "</label>");10 $("#inppassreset").html("<label class=' control-label' style='text-align:left'>New password: " + pass + "</label>"); 11 11 12 12 };
Note: See TracChangeset
for help on using the changeset viewer.