Lots of small fixes and tweaks

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

@ -9,20 +9,22 @@
<input id="email" type="email" placeholder="email address" ng-model="user.email" class="form-control form-control-custom" />
</div>
<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="checkbox" ng-repeat="permission in permissions">
<input id="permission_{{$id}}" class="checkbox-custom" name="permission[]"
ng-checked="permission.selected" ng-model="permission.selected" type="checkbox" value="{{permission.value}}" />
ng-checked="permission.selected" ng-model="permission.selected" type="checkbox" value="{{permission.value}}"/>
<label for="permission_{{$id}}">{{permission.name}}</label>
</div>
</div>
<h3>Features: </h3>
<div class="col-md-5">
<div class="checkbox" ng-repeat="f in features">
<input id="features_{{$id}}" class="checkbox-custom" name="f[]"
ng-checked="f.selected" ng-model="f.selected" type="checkbox" value="{{f.value}}" />
ng-checked="f.selected" ng-model="f.selected" type="checkbox" value="{{f.value}}"/>
<label for="features_{{$id}}">{{f.name}}</label>
</div>
</div>

@ -18,26 +18,29 @@
<br />
<div ng-show="selectedUser">
<!--Edit-->
<div class="row" style="margin-left: 0; margin-right: 0;">
<div class="col-md-6">
<strong>Modify Permissions:</strong>
<!--Load all permissions-->
<strong>Modify Permissions:</strong>
<!--Load all permissions-->
<div class="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}}" />
<label for="permissionsCheckbox_{{$id}}">{{p.name}}</label>
</div>
<strong>Modify Features:</strong>
<!--Load all features-->
<div class="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}}" />
<label for="featuresCheckbox_{{$id}}">{{p.name}}</label>
</div>
<strong>Email Address</strong>
<div class="form-group">
<input id="emailAddress" type="email" ng-model="selectedUser.emailAddress" ng-disabled="selectedUser.type === 0" class="form-control form-control-custom" />
<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}}" />
<label class="small-label" for="permissionsCheckbox_{{$id}}">{{p.name}}</label>
</div>
</div>
<div class="col-md-6">
<strong>Modify Features:</strong>
<!--Load all 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}}" />
<label class="small-label" for="featuresCheckbox_{{$id}}">{{p.name}}</label>
</div>
</div>
</div>
<strong>Email Address</strong>
<div class="form-group">
<input id="emailAddress" type="email" ng-model="selectedUser.emailAddress" ng-disabled="selectedUser.type === 0" class="form-control form-control-custom" />
</div>
<strong>Alias</strong>
<div class="form-group">

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

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

@ -56,6 +56,17 @@ label {
margin-bottom: 0.5rem !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 {
font-size: 13px;
line-height: 21px; }
@ -294,6 +305,45 @@ label {
text-align: center;
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 {
padding-top: 2px;
padding-bottom: 2px; }

File diff suppressed because one or more lines are too long

@ -86,6 +86,21 @@ label {
margin-bottom: .5rem $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 {
font-size: 13px;
@ -369,6 +384,50 @@ $border-radius: 10px;
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 {
padding-top: 2px;
padding-bottom: 2px;

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

@ -1,5 +1,5 @@
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@Html.Partial("Shared/Partial/_Sidebar")
@{
var baseUrl = Html.GetBaseUrl();
@ -50,7 +50,7 @@
<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 />

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

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

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

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

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

@ -2,7 +2,7 @@
@using PlexRequests.Core.Models
@using PlexRequests.UI.Helpers
@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">
<form class="form-horizontal" method="POST" id="mainForm">

@ -2,7 +2,7 @@
@using PlexRequests.Core.Models
@using PlexRequests.UI.Helpers
@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">
<form class="form-horizontal" method="POST" id="mainForm">

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

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

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

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers
@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">

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

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

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

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

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers
@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">
<fieldset>
<legend>Release Fault Queue</legend>

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

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers
@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 class="col-sm-8 col-sm-push-1">
<fieldset>

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

@ -1,6 +1,6 @@
@using PlexRequests.UI.Helpers
@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">
<form class="form-horizontal" method="POST" id="mainForm">
Loading…
Cancel
Save