diff --git a/PlexRequests.UI/Content/app/userManagement/userManagementController.js b/PlexRequests.UI/Content/app/userManagement/userManagementController.js
index a577b1380..88a85e7aa 100644
--- a/PlexRequests.UI/Content/app/userManagement/userManagementController.js
+++ b/PlexRequests.UI/Content/app/userManagement/userManagementController.js
@@ -9,6 +9,7 @@
$scope.selectedUser = {}; // User on the right side
$scope.selectedClaims = {};
+
$scope.sortType = "username";
$scope.sortReverse = false;
$scope.searchTerm = "";
@@ -27,20 +28,20 @@
// Get all users in the system
$scope.getUsers = function () {
$scope.users = userManagementService.getUsers()
- .then(function (data) {
- $scope.users = data.data;
- });
+ .then(function (data) {
+ $scope.users = data.data;
+ });
};
// Get the claims and populate the create dropdown
$scope.getClaims = function () {
userManagementService.getClaims()
- .then(function (data) {
- $scope.claims = data.data;
- });
+ .then(function (data) {
+ $scope.claims = data.data;
+ });
}
- // Create a user, do some validation too
+ // Create a user, do some validation too
$scope.addUser = function () {
if (!$scope.user.username || !$scope.user.password) {
@@ -50,23 +51,35 @@
return;
}
- userManagementService.addUser($scope.user, $scope.selectedClaims).then(function (data) {
- if (data.message) {
- $scope.error.error = true;
- $scope.error.errorMessage = data.message;
- } else {
- $scope.users.push(data); // Push the new user into the array to update the DOM
- $scope.user = {};
- $scope.selectedClaims = {};
- }
- });
+ userManagementService.addUser($scope.user, $scope.selectedClaims)
+ .then(function (data) {
+ if (data.message) {
+ $scope.error.error = true;
+ $scope.error.errorMessage = data.message;
+ } else {
+ $scope.users.push(data); // Push the new user into the array to update the DOM
+ $scope.user = {};
+ $scope.selectedClaims = {};
+ }
+ });
};
- $scope.$watch('claims|filter:{selected:true}', function (nv) {
- $scope.selectedClaims = nv.map(function (claim) {
- return claim.name;
- });
- }, true);
+ $scope.$watch('claims|filter:{selected:true}',
+ function (nv) {
+ $scope.selectedClaims = nv.map(function (claim) {
+ return claim.name;
+ });
+ },
+ true);
+
+
+ $scope.updateUser = function () {
+
+ }
+
+ function getBaseUrl() {
+ return $('#baseUrl').val();
+ }
// On page load
diff --git a/PlexRequests.UI/Content/search.js b/PlexRequests.UI/Content/search.js
index bf5eea9db..932a68cca 100644
--- a/PlexRequests.UI/Content/search.js
+++ b/PlexRequests.UI/Content/search.js
@@ -5,6 +5,21 @@
return opts.inverse(this);
});
+Function.prototype.bind = function (parent) {
+ var f = this;
+ var args = [];
+
+ for (var a = 1; a < arguments.length; a++) {
+ args[args.length] = arguments[a];
+ }
+
+ var temp = function () {
+ return f.apply(parent, args);
+ }
+
+ return (temp);
+}
+
$(function () {
diff --git a/PlexRequests.UI/Content/site.js b/PlexRequests.UI/Content/site.js
index 70639cf3e..85cae41f8 100644
--- a/PlexRequests.UI/Content/site.js
+++ b/PlexRequests.UI/Content/site.js
@@ -8,21 +8,6 @@
return s;
}
-Function.prototype.bind = function (parent) {
- var f = this;
- var args = [];
-
- for (var a = 1; a < arguments.length; a++) {
- args[args.length] = arguments[a];
- }
-
- var temp = function () {
- return f.apply(parent, args);
- }
-
- return (temp);
-}
-
$(function() {
$('[data-toggle="tooltip"]').tooltip();
});
diff --git a/PlexRequests.UI/Helpers/BaseUrlHelper.cs b/PlexRequests.UI/Helpers/BaseUrlHelper.cs
index ee821f7ac..8c55ccac8 100644
--- a/PlexRequests.UI/Helpers/BaseUrlHelper.cs
+++ b/PlexRequests.UI/Helpers/BaseUrlHelper.cs
@@ -206,6 +206,20 @@ namespace PlexRequests.UI.Helpers
return helper.Raw(asset);
}
+
+ public static IHtmlString LoadUserManagementAssets(this HtmlHelpers helper)
+ {
+ var assetLocation = GetBaseUrl();
+ var content = GetContentUrl(assetLocation);
+
+ var controller = $"";
+ controller += $"";
+
+
+ return helper.Raw(controller);
+ }
+
+
public static IHtmlString LoadTableAssets(this HtmlHelpers helper)
{
var sb = new StringBuilder();
diff --git a/PlexRequests.UI/Models/UserManagementUsersViewModel.cs b/PlexRequests.UI/Models/UserManagementUsersViewModel.cs
index 3fbc936ec..915f90075 100644
--- a/PlexRequests.UI/Models/UserManagementUsersViewModel.cs
+++ b/PlexRequests.UI/Models/UserManagementUsersViewModel.cs
@@ -16,6 +16,7 @@ namespace PlexRequests.UI.Models
public UserType Type { get; set; }
public string EmailAddress { get; set; }
public UserManagementPlexInformation PlexInfo { get; set; }
+ public string[] ClaimsArray { get; set; }
}
public class UserManagementPlexInformation
diff --git a/PlexRequests.UI/Modules/UserManagementModule.cs b/PlexRequests.UI/Modules/UserManagementModule.cs
index efcaeaa39..1e9909565 100644
--- a/PlexRequests.UI/Modules/UserManagementModule.cs
+++ b/PlexRequests.UI/Modules/UserManagementModule.cs
@@ -63,7 +63,8 @@ namespace PlexRequests.UI.Modules
Claims = claimsString,
Username = user.UserName,
Type = UserType.LocalUser,
- EmailAddress = userProps.EmailAddress
+ EmailAddress = userProps.EmailAddress,
+ ClaimsArray = claims
});
}
diff --git a/PlexRequests.UI/NinjectModules/ConfigurationModule.cs b/PlexRequests.UI/NinjectModules/ConfigurationModule.cs
index 5bb10dca3..ae55786e1 100644
--- a/PlexRequests.UI/NinjectModules/ConfigurationModule.cs
+++ b/PlexRequests.UI/NinjectModules/ConfigurationModule.cs
@@ -50,6 +50,7 @@ namespace PlexRequests.UI.NinjectModules
Bind().To();
Bind().To().InSingletonScope();
+ Bind().To();
}
}
}
\ No newline at end of file
diff --git a/PlexRequests.UI/Views/UserManagement/Index.cshtml b/PlexRequests.UI/Views/UserManagement/Index.cshtml
index 8307ef491..abdc5821b 100644
--- a/PlexRequests.UI/Views/UserManagement/Index.cshtml
+++ b/PlexRequests.UI/Views/UserManagement/Index.cshtml
@@ -1,8 +1,7 @@
@using PlexRequests.UI.Helpers
@inherits PlexRequests.UI.Helpers.AngularViewBase
-
-
+@Html.LoadUserManagementAssets()
@@ -110,9 +109,27 @@
User Type:
-
+
+
+
+
+
+
Modify Roles:
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file