Skip to content

Commit ae980f9

Browse files
committed
retheme admin user view
1 parent e331157 commit ae980f9

File tree

1 file changed

+197
-0
lines changed

1 file changed

+197
-0
lines changed
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
2+
3+
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
4+
{{-- of this software and associated documentation files (the "Software"), to deal --}}
5+
{{-- in the Software without restriction, including without limitation the rights --}}
6+
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
7+
{{-- copies of the Software, and to permit persons to whom the Software is --}}
8+
{{-- furnished to do so, subject to the following conditions: --}}
9+
10+
{{-- The above copyright notice and this permission notice shall be included in all --}}
11+
{{-- copies or substantial portions of the Software. --}}
12+
13+
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
14+
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
15+
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
16+
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
17+
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
18+
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
19+
{{-- SOFTWARE. --}}
20+
@extends('layouts.admin')
21+
22+
@section('title')
23+
Manager User: {{ $user->username }}
24+
@endsection
25+
26+
@section('content-header')
27+
<h1>{{ $user->name_first }} {{ $user->name_last}}<small>{{ $user->username }}</small></h1>
28+
<ol class="breadcrumb">
29+
<li><a href="{{ route('admin.index') }}">Admin</a></li>
30+
<li><a href="{{ route('admin.users') }}">Users</a></li>
31+
<li class="active">{{ $user->username }}</li>
32+
</ol>
33+
@endsection
34+
35+
@section('content')
36+
<div class="row">
37+
<div class="col-xs-6">
38+
<div class="box box-primary">
39+
<div class="box-header with-border">
40+
<h3 class="box-title">Identity</h3>
41+
</div>
42+
<form action="{{ route('admin.users.view', $user->id) }}" method="post">
43+
<div class="box-body">
44+
<div class="form-group">
45+
<label for="email" class="control-label">Email</label>
46+
<div>
47+
<input type="text" name="email" value="{{ $user->email }}" class="form-control">
48+
</div>
49+
</div>
50+
<div class="form-group">
51+
<label for="registered" class="control-label">Username</label>
52+
<div>
53+
<input type="text" name="username" value="{{ $user->username }}" class="form-control">
54+
</div>
55+
</div>
56+
<div class="form-group">
57+
<label for="registered" class="control-label">Client First Name</label>
58+
<div>
59+
<input type="text" name="name_first" value="{{ $user->name_first }}" class="form-control">
60+
</div>
61+
</div>
62+
<div class="form-group">
63+
<label for="registered" class="control-label">Client Last Name</label>
64+
<div>
65+
<input type="text" name="name_last" value="{{ $user->name_last }}" class="form-control">
66+
</div>
67+
</div>
68+
</div>
69+
<div class="box-footer">
70+
{!! csrf_field() !!}
71+
<input type="submit" value="Update Identity" class="btn btn-primary btn-sm">
72+
</div>
73+
</form>
74+
</div>
75+
</div>
76+
<div class="col-xs-6">
77+
<div class="box">
78+
<div class="box-header with-border">
79+
<h3 class="box-title">Password</h3>
80+
</div>
81+
<form action="{{ route('admin.users.view', $user->id) }}" method="post">
82+
<div class="box-body">
83+
<div class="alert alert-success" style="display:none;margin-bottom:10px;" id="gen_pass"></div>
84+
<div class="form-group">
85+
<label for="password" class="control-label">Password</label>
86+
<div>
87+
<input type="password" id="password" name="password" class="form-control">
88+
</div>
89+
</div>
90+
<div class="form-group">
91+
<button class="btn btn-default btn-sm" id="gen_pass_bttn" type="button">Generate Password</button>
92+
</div>
93+
</div>
94+
<div class="box-footer">
95+
{!! csrf_field() !!}
96+
<input type="submit" value="Update Password" class="btn btn-primary btn-sm">
97+
</div>
98+
</form>
99+
</div>
100+
</div>
101+
<div class="col-xs-6">
102+
<div class="box">
103+
<div class="box-header with-border">
104+
<h3 class="box-title">Permissions</h3>
105+
</div>
106+
<form action="{{ route('admin.users.view', $user->id) }}" method="post">
107+
<div class="box-body">
108+
<div class="form-group">
109+
<label for="root_admin" class="control-label">Administrator</label>
110+
<div>
111+
<select name="root_admin" class="form-control">
112+
<option value="0">{{ trans('strings.no') }}</option>
113+
<option value="1" {{ $user->root_admin ? 'selected="selected"' : '' }}>{{ trans('strings.yes') }}</option>
114+
</select>
115+
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
116+
</div>
117+
</div>
118+
</div>
119+
<div class="box-footer">
120+
{!! csrf_field() !!}
121+
<input type="submit" value="Update Permissions" class="btn btn-primary btn-sm">
122+
</div>
123+
</form>
124+
</div>
125+
</div>
126+
<div class="col-xs-12">
127+
<div class="box">
128+
<div class="box-header with-border">
129+
<h3 class="box-title">Associated Servers</h3>
130+
</div>
131+
<div class="box-body table-responsive no-padding">
132+
<table class="table table-hover">
133+
<thead>
134+
<tr>
135+
<th style="width:2%;"></th>
136+
<th>Identifier</th>
137+
<th>Server Name</th>
138+
<th>Node</th>
139+
<th style="width:10%;"></th>
140+
</tr>
141+
</thead>
142+
<tbody>
143+
@foreach($user->servers as $server)
144+
<tr>
145+
<td><a href="{{ route('server.index', $server->uuidShort) }}/"><i class="fa fa-tachometer"></i></a></td>
146+
<td><code>{{ $server->uuidShort }}</code></td>
147+
<td><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></td>
148+
<td><a href="{{ route('admin.nodes.view', $server->node->id) }}">{{ $server->node->name }}</a></td>
149+
<td class="centered">@if($server->suspended === 0)<span class="label muted muted-hover label-success">Active</span>@else<span class="label label-warning">Suspended</span>@endif</td>
150+
</td>
151+
@endforeach
152+
</tbody>
153+
</table>
154+
</div>
155+
</form>
156+
</div>
157+
</div>
158+
<div class="col-xs-12">
159+
<div class="box box-danger">
160+
<div class="box-header with-border">
161+
<h3 class="box-title">Delete User</h3>
162+
</div>
163+
<div class="box-body">
164+
<div class="alert alert-danger"><strong>Warning!</strong> There most be no servers associated with this account in order for it to be deleted.</div>
165+
<p></p>
166+
<form action="{{ route('admin.users.view', $user->id) }}" method="POST" class="text-center">
167+
{!! method_field('DELETE') !!}
168+
{!! csrf_field() !!}
169+
<input id="delete" type="submit" class="btn btn-sm btn-danger" value="Delete User" />
170+
</form>
171+
</div>
172+
</form>
173+
</div>
174+
</div>
175+
</div>
176+
@endsection
177+
178+
@section('footer-scripts')
179+
@parent
180+
<script>$("#gen_pass_bttn").click(function (event) {
181+
event.preventDefault();
182+
$.ajax({
183+
type: "GET",
184+
url: "/password-gen/12",
185+
headers: {
186+
'X-CSRF-TOKEN': '{{ csrf_token() }}'
187+
},
188+
success: function(data) {
189+
$("#gen_pass").html('You must click <em>Update Password</em> below for this password to be applied.<br /><br /><strong>Generated Password:</strong> ' + data).slideDown();
190+
$('input[name="password"], input[name="password_confirmation"]').val(data);
191+
return false;
192+
}
193+
});
194+
return false;
195+
});
196+
</script>
197+
@endsection

0 commit comments

Comments
 (0)