2019-01-05 04:28:29 +01:00
|
|
|
{{define "view-user"}}
|
|
|
|
{{template "header" .}}
|
|
|
|
<style>
|
|
|
|
table.classy th {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
h3 {
|
|
|
|
font-weight: normal;
|
|
|
|
}
|
2019-10-03 22:41:50 +02:00
|
|
|
input.copy-text {
|
|
|
|
text-align: center;
|
|
|
|
font-size: 1.2em;
|
|
|
|
color: #555;
|
|
|
|
margin-left: 1rem;
|
|
|
|
}
|
|
|
|
button[type="submit"].danger {
|
|
|
|
padding-left: 2rem;
|
|
|
|
padding-right: 2rem;
|
|
|
|
}
|
2019-01-05 04:28:29 +01:00
|
|
|
</style>
|
|
|
|
<div class="snug content-container">
|
|
|
|
{{template "admin-header" .}}
|
|
|
|
|
|
|
|
<h2 id="posts-header">{{.User.Username}}</h2>
|
2019-10-03 22:41:50 +02:00
|
|
|
{{if .NewPassword}}<p class="alert success">New password for user <strong>{{.User.Username}}</strong> is
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="copy-text"
|
|
|
|
value="{{.NewPassword}}"
|
|
|
|
onfocus="if (this.select) this.select(); else this.setSelectionRange(0, this.value.length);"
|
|
|
|
readonly />
|
|
|
|
<br/><br/>
|
|
|
|
You must share this new password with the user, this is the only time it will be displayed.
|
|
|
|
</p>
|
|
|
|
{{end}}
|
2019-01-05 04:28:29 +01:00
|
|
|
<table class="classy export">
|
|
|
|
<tr>
|
|
|
|
<th>No.</th>
|
|
|
|
<td>{{.User.ID}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Type</th>
|
|
|
|
<td>{{if .User.IsAdmin}}Admin{{else}}User{{end}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Username</th>
|
|
|
|
<td>{{.User.Username}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Joined</th>
|
|
|
|
<td>{{.User.CreatedFriendly}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Total Posts</th>
|
|
|
|
<td>{{.TotalPosts}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Last Post</th>
|
|
|
|
<td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td>
|
|
|
|
</tr>
|
2019-10-03 22:41:50 +02:00
|
|
|
<tr>
|
|
|
|
<th>Password</th>
|
|
|
|
<td>
|
2019-11-11 08:06:03 +01:00
|
|
|
{{if ne .Username .User.Username}}
|
2019-11-11 08:02:22 +01:00
|
|
|
<form id="reset-form" action="/admin/user/{{.User.Username}}/passphrase" method="post" autocomplete="false">
|
2019-10-03 22:41:50 +02:00
|
|
|
<input type="hidden" name="user" value="{{.User.ID}}"/>
|
|
|
|
<button
|
|
|
|
class="danger"
|
|
|
|
type="submit">Reset</button>
|
|
|
|
</form>
|
|
|
|
{{else}}
|
|
|
|
<a href="/me/settings" title="Go to reset password page">Change your password</a>
|
|
|
|
{{end}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
2019-01-05 04:28:29 +01:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<h2>Blogs</h2>
|
|
|
|
|
|
|
|
{{range .Colls}}
|
|
|
|
<h3><a href="/{{.Alias}}/">{{.Title}}</a></h3>
|
|
|
|
<table class="classy export">
|
|
|
|
<tr>
|
|
|
|
<th>Alias</th>
|
|
|
|
<td>{{.Alias}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Title</th>
|
|
|
|
<td>{{.Title}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Description</th>
|
|
|
|
<td>{{.Description}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Visibility</th>
|
|
|
|
<td>{{.FriendlyVisibility}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Views</th>
|
|
|
|
<td>{{.Views}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Posts</th>
|
|
|
|
<td>{{.TotalPosts}}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Last Post</th>
|
|
|
|
<td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td>
|
|
|
|
</tr>
|
|
|
|
{{if $.Config.Federation}}
|
|
|
|
<tr>
|
|
|
|
<th>Fediverse Followers</th>
|
|
|
|
<td>{{.Followers}}</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
</table>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
2019-10-03 22:41:50 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
form = document.getElementById("reset-form");
|
|
|
|
form.addEventListener('submit', function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
agreed = confirm("Really reset password for {{.User.Username}}?\nYou will have to record and share the new password with them.");
|
|
|
|
if (agreed === true) { form.submit();}
|
|
|
|
});
|
|
|
|
</script>
|
2019-01-05 04:28:29 +01:00
|
|
|
{{template "footer" .}}
|
|
|
|
{{end}}
|