@ -3,50 +3,91 @@
<script src="~/Content/app/controllers/userManagement/userManagementController.js"></script>
<script src="~/Content/app/services/userManagement/userManagementService.js"></script>
<div ng-controller="userManagementController" ng-init="getUsers()">
<br>
<br>
<fieldset>
<table class="table table-striped table-hover table-responsive">
<thead>
<tr>
<th>Id</th>
<th>Username</th>
<th>Email</th>
<th>User Type</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="u in users">
<td>
{{u.username}}
</td>
<td>
{{u.emailAddress}}
</td>
<td>
{{u.claims}}
</td>
<td>
{{u.type == 0 ? 'Local User' : 'Plex User'}}
{{u.type}}
</td>
</tr>
</tbody>
</table>
<div class="col-md-7">
<br>
<br>
<div ng-show="error.error" ng-bind="error.errorMessage"></div>
<form ng-submit="addUser()">
<div class="form-group">
<input id="username" type="text" placeholder="user" ng-model="user.username" class="form-control-custom"/>
<input id="username" type="text" placeholder="user" ng-model="user.username" class="form-control-custom" />
</div>
<div class="form-group">
<input id="password" type="password" placeholder="password" ng-model="user.password" class="form-control-custom"/>
<input id="password" type="password" placeholder="password" ng-model="user.password" class="form-control-custom" />
</div>
<input type="submit" class="btn btn-success-outline" value="Add"/>
<input type="submit" class="btn btn-success-outline" value="Add" />
</form>
</fieldset>
</div>
<form>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-search"></i>
</div>
<input type="text" class="form-control" placeholder="Search" ng-model="searchTerm">
</div>
</div>
</form>
<table class="table table-striped table-hover table-responsive table-condensed">
<thead>
<tr>
<th>
<a href="#" ng-click="sortType = 'username'; sortReverse = !sortReverse">
Username
<span ng-show="sortType == 'username' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'username' && sortReverse" class="fa fa-caret-up"></span>
</a>
</th>
<th>
<a href="#" ng-click="sortType = 'emailAddress'; sortReverse = !sortReverse">
Email
<span ng-show="sortType == 'emailAddress' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'emailAddress' && sortReverse" class="fa fa-caret-up"></span>
</a>
</th>
<th>
<a href="#" ng-click="sortType = 'type'; sortReverse = !sortReverse">
User Type
<span ng-show="sortType == 'type' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'type' && sortReverse" class="fa fa-caret-up"></span>
</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="u in users | orderBy:sortType:sortReverse | filter:searchTerm">
<td>
{{u.username}}
</td>
<td>
{{u.emailAddress}}
</td>
<td>
{{u.claims}}
</td>
<td>
{{u.type === 1 ? 'Local User' : 'Plex User'}}
</td>
<td>
<a href="#" ng-click="selectUser(u.id)" class="btn btn-info-outline">Details/Edit</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-5">
<img ng-src="{{selectedUser.plexInfo.thumb}}"/>
<div ng-bind="selectedUser.id"></div>
<div ng-bind="selectedUser.username"></div>
<div ng-bind="selectedUser.emailAddress"></div>
<div ng-bind="selectedUser.claims"></div>
<div ng-bind="selectedUser.type === 1 ? 'Local User' : 'Plex User'"></div>
</div>
</div>