Moved timestamps to footer for user cards
This commit is contained in:
+39
-33
@@ -1,23 +1,40 @@
|
||||
<%- include('top') %>
|
||||
<script id="profileTemplate" type="text/html">
|
||||
<h2><i>User Name:</i> <b>{{uid}}</b></h2>
|
||||
<i>Name:</i> <b>{{givenName}} {{sn}}</b><br />
|
||||
<i>Email:</i> <b>{{mail}} </b><br />
|
||||
<i>Joined:</i> <b>{{createTimestamp}} </b>, <i>Edited:</i> <b>{{modifyTimestamp}} </b><br />
|
||||
<i>Phone:</i> <b>{{mobile}} </b><br />
|
||||
<i>LDAP DN:</i> <b>{{dn}} </b><br />
|
||||
<i>Home Directory:</i> <b>{{homeDirectory}} </b><br />
|
||||
<i>Login Shell:</i> <b>{{loginShell}} </b><br />
|
||||
<i>SSH Public Key:</i> <b>{{sshPublicKey}}</b><br />
|
||||
<i>Unix User ID:</i> <b>{{uidNumber}} </b><br />
|
||||
<i>Unix Group ID:</i> <b>{{gidNumber}} </b><br />
|
||||
<i>Description:</i><br>
|
||||
<p>
|
||||
{{description}}
|
||||
</p>
|
||||
<img id="profile_photo" >
|
||||
<div class="card-body profile-body-{{uid}}">
|
||||
<h2><i>User Name:</i> <b>{{uid}}</b></h2>
|
||||
<i>Name:</i> <b>{{givenName}} {{sn}}</b><br />
|
||||
<i>Email:</i> <b>{{mail}} </b><br />
|
||||
<i>Phone:</i> <b>{{mobile}} </b><br />
|
||||
<i>LDAP DN:</i> <b>{{dn}} </b><br />
|
||||
<i>Home Directory:</i> <b>{{homeDirectory}} </b><br />
|
||||
<i>Login Shell:</i> <b>{{loginShell}} </b><br />
|
||||
<i>SSH Public Key:</i> <b>{{sshPublicKey}}</b><br />
|
||||
<i>Unix User ID:</i> <b>{{uidNumber}} </b><br />
|
||||
<i>Unix Group ID:</i> <b>{{gidNumber}} </b><br />
|
||||
<i>Description:</i><br>
|
||||
<p>
|
||||
{{description}}
|
||||
</p>
|
||||
<!-- <img id="profile_photo" /> -->
|
||||
</div>
|
||||
<div class="card-footer profile-body-{{uid}}">
|
||||
<div class="float-left">
|
||||
<i>Joined:</i> <b>{{createTimestamp}} </b> <br/>
|
||||
<i>Edited:</i> <b>{{modifyTimestamp}} </b>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<button type="button" onclick="editUser()" class="btn btn-warning btn shadow ">
|
||||
<i class="fad fa-user-edit"></i>
|
||||
</button>
|
||||
<button type="submit" class="btn btn btn-danger" action="user/{{uid}}" method="delete" onsubmit="formAJAX(this)" evalAJAX="window.location.href = '/users'">
|
||||
<i class="fad fa-user-slash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
<script id="groupRowTemplate" type="text/html">
|
||||
<tr>
|
||||
<td>{{cn}}</td>
|
||||
@@ -85,7 +102,9 @@
|
||||
function renderProfile(user, message){
|
||||
var profileTemplate = $('#profileTemplate').html();
|
||||
var paswordResetTemplate = $('#paswordResetTemplate').html();
|
||||
var $target = $('#userProfile div.card-body');
|
||||
var $target = $('#userProfile div.actionMessage');
|
||||
|
||||
$('.profile-body-'+user.uid).remove();
|
||||
|
||||
app.util.actionMessage(message, $target, 'success')
|
||||
|
||||
@@ -93,7 +112,7 @@
|
||||
user.createTimestamp = moment(user.createTimestamp, "YYYYMMDDHHmmssZ").fromNow();
|
||||
user.modifyTimestamp = moment(user.modifyTimestamp, "YYYYMMDDHHmmssZ").fromNow();
|
||||
|
||||
$target.html(Mustache.render(profileTemplate, user));
|
||||
$target.after(Mustache.render(profileTemplate, user));
|
||||
|
||||
$('#passwordReset').html(Mustache.render(paswordResetTemplate, user))
|
||||
};
|
||||
@@ -141,7 +160,7 @@
|
||||
|
||||
function editUserSeccess(message){
|
||||
console.log('edit done')
|
||||
$('#editProfile').slideUp();;
|
||||
$('#editProfile').slideUp();
|
||||
app.auth.isLoggedIn(function(){
|
||||
determinUser(function(user){
|
||||
currentUser = user;
|
||||
@@ -262,20 +281,7 @@
|
||||
</div>
|
||||
<div class="card-header shadow actionMessage" style="display:none">
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- User profile inserted by JS -->
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" onclick="editUser()" class="btn btn-warning btn-lg shadow ">
|
||||
<i class="fad fa-user-edit"></i>
|
||||
</button>
|
||||
|
||||
<form action="user/{{uid}}" method="delete" onsubmit="formAJAX(this)" evalAJAX="window.location.href = '/users'" class="float-right">
|
||||
<button type="submit" class="btn btn-lg btn-danger">
|
||||
<i class="fad fa-user-slash"></i>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="profile-body">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user