Lots of small fixes and tweaks

pull/733/head
Jamie.Rees 8 years ago
parent 0185e8238d
commit d8e7693d8d

@ -9,7 +9,10 @@
<input id="email" type="email" placeholder="email address" ng-model="user.email" class="form-control form-control-custom" /> <input id="email" type="email" placeholder="email address" ng-model="user.email" class="form-control form-control-custom" />
</div> </div>
<div class="row"> <div class="row">
<h3>Permissions: </h3> <div>
<h3 class="col-md-5">Permissions: </h3>
<h3 class="col-md-5">Features: </h3>
</div>
<div class="col-md-5"> <div class="col-md-5">
<div class="checkbox" ng-repeat="permission in permissions"> <div class="checkbox" ng-repeat="permission in permissions">
<input id="permission_{{$id}}" class="checkbox-custom" name="permission[]" <input id="permission_{{$id}}" class="checkbox-custom" name="permission[]"
@ -18,7 +21,6 @@
</div> </div>
</div> </div>
<h3>Features: </h3>
<div class="col-md-5"> <div class="col-md-5">
<div class="checkbox" ng-repeat="f in features"> <div class="checkbox" ng-repeat="f in features">
<input id="features_{{$id}}" class="checkbox-custom" name="f[]" <input id="features_{{$id}}" class="checkbox-custom" name="f[]"

@ -18,22 +18,25 @@
<br /> <br />
<div ng-show="selectedUser"> <div ng-show="selectedUser">
<!--Edit--> <!--Edit-->
<div class="row" style="margin-left: 0; margin-right: 0;">
<div class="col-md-6">
<strong>Modify Permissions:</strong> <strong>Modify Permissions:</strong>
<!--Load all permissions--> <!--Load all permissions-->
<div class="checkbox" ng-repeat="p in selectedUser.permissions"> <div class="checkbox small-checkbox" ng-repeat="p in selectedUser.permissions">
<input id="permissionsCheckbox_{{$id}}" class="checkbox-custom" name="permissions[]" ng-checked="p.selected" ng-model="p.selected" type="checkbox" value="{{p.value}}" /> <input id="permissionsCheckbox_{{$id}}" class="checkbox-custom" name="permissions[]" ng-checked="p.selected" ng-model="p.selected" type="checkbox" value="{{p.value}}" />
<label for="permissionsCheckbox_{{$id}}">{{p.name}}</label> <label class="small-label" for="permissionsCheckbox_{{$id}}">{{p.name}}</label>
</div> </div>
</div>
<div class="col-md-6">
<strong>Modify Features:</strong> <strong>Modify Features:</strong>
<!--Load all features--> <!--Load all features-->
<div class="checkbox" ng-repeat="p in selectedUser.features"> <div class="checkbox small-checkbox" ng-repeat="p in selectedUser.features">
<input id="featuresCheckbox_{{$id}}" class="checkbox-custom" name="features[]" ng-checked="p.selected" ng-model="p.selected" type="checkbox" value="{{p.value}}" /> <input id="featuresCheckbox_{{$id}}" class="checkbox-custom" name="features[]" ng-checked="p.selected" ng-model="p.selected" type="checkbox" value="{{p.value}}" />
<label for="featuresCheckbox_{{$id}}">{{p.name}}</label> <label class="small-label" for="featuresCheckbox_{{$id}}">{{p.name}}</label>
</div>
</div>
</div> </div>
<strong>Email Address</strong> <strong>Email Address</strong>
<div class="form-group"> <div class="form-group">
<input id="emailAddress" type="email" ng-model="selectedUser.emailAddress" ng-disabled="selectedUser.type === 0" class="form-control form-control-custom" /> <input id="emailAddress" type="email" ng-model="selectedUser.emailAddress" ng-disabled="selectedUser.type === 0" class="form-control form-control-custom" />

@ -21,12 +21,6 @@
$scope.hideColumns = false; $scope.hideColumns = false;
$scope.error = {
error: false,
errorMessage: ""
};
var ReadOnlyPermission = "Read Only User"; var ReadOnlyPermission = "Read Only User";
var open = false; var open = false;
@ -64,24 +58,18 @@
// Create a user, do some validation too // Create a user, do some validation too
$scope.addUser = function () { $scope.addUser = function () {
if (!$scope.user.username || !$scope.user.password) { if (!$scope.user.username || !$scope.user.password) {
$scope.error.error = true; generateNotify("Please provide a username and password", 'warning');
$scope.error.errorMessage = "Please provide a correct username and password";
generateNotify($scope.error.errorMessage, 'warning');
return; return;
} }
if ($scope.selectedPermissions.length === 0) { if ($scope.selectedPermissions.length === 0) {
$scope.error.error = true; generateNotify("Please select a permission", 'warning');
$scope.error.errorMessage = "Please select a permission";
generateNotify($scope.error.errorMessage, 'warning');
return; return;
} }
var hasReadOnly = $scope.selectedPermissions.indexOf(ReadOnlyPermission) !== -1; var hasReadOnly = $scope.selectedPermissions.indexOf(ReadOnlyPermission) !== -1;
if (hasReadOnly) { if (hasReadOnly) {
if ($scope.selectedPermissions.length > 1) { if ($scope.selectedPermissions.length > 1) {
$scope.error.error = true; generateNotify("Cannot have the " + ReadOnlyPermission + " permission with other permissions.", 'danger');
$scope.error.errorMessage = "Cannot have the " + ReadOnlyPermission + " permission with other permissions.";
generateNotify($scope.error.errorMessage, 'danger');
return; return;
} }
} }
@ -89,8 +77,7 @@
userManagementService.addUser($scope.user, $scope.selectedPermissions, $scope.selectedFeatures) userManagementService.addUser($scope.user, $scope.selectedPermissions, $scope.selectedFeatures)
.then(function (data) { .then(function (data) {
if (data.message) { if (data.message) {
$scope.error.error = true; generateNotify(data.message, 'warning');
$scope.error.errorMessage = data.message;
} else { } else {
$scope.users.push(data.data); // Push the new user into the array to update the DOM $scope.users.push(data.data); // Push the new user into the array to update the DOM
$scope.user = {}; $scope.user = {};

@ -16,6 +16,13 @@
return null; return null;
} }
if (!isArray(permissions)) {
permissions = [];
}
if (!isArray(features)) {
features = [];
}
var url = createBaseUrl(getBaseUrl(), '/usermanagement/createuser'); var url = createBaseUrl(getBaseUrl(), '/usermanagement/createuser');
return $http({ return $http({
@ -38,6 +45,14 @@
var updateUser = function (id, permissions, features, alias, email) { var updateUser = function (id, permissions, features, alias, email) {
if (!isArray(permissions)) {
permissions = [];
}
if (!isArray(features)) {
features = [];
}
var url = createBaseUrl(getBaseUrl(), '/usermanagement/updateUser'); var url = createBaseUrl(getBaseUrl(), '/usermanagement/updateUser');
return $http({ return $http({
url: url, url: url,
@ -69,6 +84,10 @@
return $('#baseUrl').text(); return $('#baseUrl').text();
} }
function isArray(obj) {
return !!obj && Array === obj.constructor;
}
angular.module('PlexRequests').factory('userManagementService', ["$http", userManagementService]); angular.module('PlexRequests').factory('userManagementService', ["$http", userManagementService]);
}()); }());

@ -56,6 +56,17 @@ label {
margin-bottom: 0.5rem !important; margin-bottom: 0.5rem !important;
font-size: 16px !important; } font-size: 16px !important; }
.small-label {
display: inline-block !important;
margin-bottom: 0.5rem !important;
font-size: 11px !important; }
.small-checkbox {
min-height: 0 !important; }
.round-checkbox {
border-radius: 8px; }
.nav-tabs > li { .nav-tabs > li {
font-size: 13px; font-size: 13px;
line-height: 21px; } line-height: 21px; }
@ -294,6 +305,45 @@ label {
text-align: center; text-align: center;
line-height: 13px; } line-height: 13px; }
.small-checkbox label {
display: inline-block;
cursor: pointer;
position: relative;
padding-left: 25px;
margin-right: 15px;
font-size: 13px;
margin-bottom: 10px; }
.small-checkbox label:before {
content: "";
display: inline-block;
width: 18px;
height: 18px;
margin-right: 10px;
position: absolute;
left: 0;
bottom: 1px;
border: 2px solid #eee;
border-radius: 8px;
min-height: 0px !important; }
.small-checkbox input[type=checkbox] {
display: none; }
.small-checkbox input[type=checkbox]:checked + label:before {
content: "\2713";
font-size: 13px;
color: #fafafa;
text-align: center;
line-height: 13px; }
.small-checkbox label {
min-height: 0 !important;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer; }
.input-group-sm { .input-group-sm {
padding-top: 2px; padding-top: 2px;
padding-bottom: 2px; } padding-bottom: 2px; }

File diff suppressed because one or more lines are too long

@ -86,6 +86,21 @@ label {
margin-bottom: .5rem $i; margin-bottom: .5rem $i;
font-size: 16px $i; font-size: 16px $i;
} }
.small-label {
display: inline-block $i;
margin-bottom: .5rem $i;
font-size: 11px $i;
}
.small-checkbox{
min-height:0 $i;
}
.round-checkbox {
border-radius:8px;
}
.nav-tabs > li { .nav-tabs > li {
font-size: 13px; font-size: 13px;
@ -369,6 +384,50 @@ $border-radius: 10px;
line-height: 13px; line-height: 13px;
} }
.small-checkbox label {
display: inline-block;
cursor: pointer;
position: relative;
padding-left: 25px;
margin-right: 15px;
font-size: 13px;
margin-bottom: 10px;
}
.small-checkbox label:before {
content: "";
display: inline-block;
width: 18px;
height: 18px;
margin-right: 10px;
position: absolute;
left: 0;
bottom: 1px;
border: 2px solid #eee;
border-radius: 8px;
min-height:0px $i;
}
.small-checkbox input[type=checkbox] {
display: none;
}
.small-checkbox input[type=checkbox]:checked + label:before {
content: "\2713";
font-size: 13px;
color: #fafafa;
text-align: center;
line-height: 13px;
}
.small-checkbox label {
min-height: 0 $i;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.input-group-sm { .input-group-sm {
padding-top: 2px; padding-top: 2px;
padding-bottom: 2px; padding-bottom: 2px;

@ -685,7 +685,7 @@
<Content Include="Views\Admin\EmailNotifications.cshtml"> <Content Include="Views\Admin\EmailNotifications.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Views\Admin\Status.cshtml"> <Content Include="Views\SystemStatus\Status.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Views\Admin\PushbulletNotifications.cshtml"> <Content Include="Views\Admin\PushbulletNotifications.cshtml">
@ -706,7 +706,7 @@
<Content Include="Views\Admin\Headphones.cshtml"> <Content Include="Views\Admin\Headphones.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Views\Admin\_Sidebar.cshtml"> <Content Include="Views\Shared\Partial\_Sidebar.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Views\Admin\SlackNotifications.cshtml"> <Content Include="Views\Admin\SlackNotifications.cshtml">
@ -751,10 +751,10 @@
<None Include="Views\Admin\NewsletterSettings.cshtml"> <None Include="Views\Admin\NewsletterSettings.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<Content Include="Views\Admin\RequestFaultQueue.cshtml"> <Content Include="Views\FaultQueue\RequestFaultQueue.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Views\Admin\UserManagementSettings.cshtml"> <Content Include="Views\UserManagementSettings\UserManagementSettings.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<None Include="Web.Debug.config"> <None Include="Web.Debug.config">

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
var baseUrl = Html.GetBaseUrl(); var baseUrl = Html.GetBaseUrl();
@ -50,7 +50,7 @@
<br /> <br />
<a href="~/usermanagement/" class="btn btn-info-outline">User Management</a> <a href="/@Html.GetBaseUrl()/usermanagement/" class="btn btn-info-outline">User Management</a>
<br /> <br />
<br /> <br />

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.CouchPotatoSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.CouchPotatoSettings>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
int port; int port;
if (Model.Port == 0) if (Model.Port == 0)

@ -2,7 +2,7 @@
@using PlexRequests.Core.Models @using PlexRequests.Core.Models
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.EmailNotificationSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.EmailNotificationSettings>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
int port; int port;
if (Model.EmailPort == 0) if (Model.EmailPort == 0)

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
int port; int port;
if (Model.Port == 0) if (Model.Port == 0)

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.LandingPageSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.LandingPageSettings>
@Html.LoadDateTimePickerAsset() @Html.LoadDateTimePickerAsset()
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@Html.LoadTableAssets() @Html.LoadTableAssets()
@{ @{

@ -2,7 +2,7 @@
@using PlexRequests.Core.Models @using PlexRequests.Core.Models
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.NewletterSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.NewletterSettings>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">

@ -2,7 +2,7 @@
@using PlexRequests.Core.Models @using PlexRequests.Core.Models
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.NotificationSettingsV2> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.NotificationSettingsV2>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.PlexSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.PlexSettings>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
int port; int port;
if (Model.Port == 0) if (Model.Port == 0)

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.UI.Models.ScheduledJobsViewModel> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.UI.Models.ScheduledJobsViewModel>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.PlexRequestSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.PlexRequestSettings>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
int port; int port;
if (Model.Port == 0) if (Model.Port == 0)

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
int port; int port;
if (Model.Port == 0) if (Model.Port == 0)

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
@{ @{
int port; int port;
if (Model.Port == 0) if (Model.Port == 0)

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<IEnumerable<PlexRequests.UI.Models.FaultedRequestsViewModel>> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<IEnumerable<PlexRequests.UI.Models.FaultedRequestsViewModel>>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<fieldset> <fieldset>
<legend>Release Fault Queue</legend> <legend>Release Fault Queue</legend>

@ -5,6 +5,7 @@
@Html.GetSidebarUrl(Context, "/admin", "Plex Request") @Html.GetSidebarUrl(Context, "/admin", "Plex Request")
@Html.GetSidebarUrl(Context, "/admin/landingpage", "Landing Page") @Html.GetSidebarUrl(Context, "/admin/landingpage", "Landing Page")
@Html.GetSidebarUrl(Context, "/admin/authentication", "Authentication") @Html.GetSidebarUrl(Context, "/admin/authentication", "Authentication")
@Html.GetSidebarUrl(Context, "/admin/usermanagementsettings", "User Management Settings")
@Html.GetSidebarUrl(Context, "/admin/plex", "Plex") @Html.GetSidebarUrl(Context, "/admin/plex", "Plex")
@Html.GetSidebarUrl(Context, "/admin/couchpotato", "CouchPotato") @Html.GetSidebarUrl(Context, "/admin/couchpotato", "CouchPotato")
@Html.GetSidebarUrl(Context, "/admin/sonarr", "Sonarr") @Html.GetSidebarUrl(Context, "/admin/sonarr", "Sonarr")

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.SystemSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.SystemSettings>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div id="lightbox" style="display:none"></div> <div id="lightbox" style="display:none"></div>
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<fieldset> <fieldset>

@ -16,9 +16,6 @@
<br /> <br />
<br /> <br />
<div class="col-md-12"> <div class="col-md-12">
<br>
<br>
<div ng-show="error.error" ng-bind="error.errorMessage"></div>
<br /> <br />
<br /> <br />
<br /> <br />

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.UserManagementSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.UserManagementSettings>
@Html.Partial("_Sidebar") @Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">
Loading…
Cancel
Save