This repository was archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
System admin user details #995
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5f0c914
User details from system admin
whaught e1750f7
fix admin text
whaught d5925ee
Merge remote-tracking branch 'upstream/main' into user-details
whaught b0114d5
period
whaught c296577
Merge remote-tracking branch 'upstream/main' into user-details
whaught 3ca2807
add breaks
whaught 797be90
notfound
whaught ac6cf83
use form group and stuff
whaught File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{{define "admin/users/show"}} | ||
{{$user := .user}} | ||
{{$stats := .stats}} | ||
|
||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
{{template "head" .}} | ||
</head> | ||
|
||
<body id="users-show" class="tab-content"> | ||
{{template "admin/navbar" .}} | ||
|
||
<main role="main" class="container"> | ||
{{template "flash" .}} | ||
|
||
<h1>{{$user.Name}}</h1> | ||
<p> | ||
Here is information about the user. | ||
</p> | ||
|
||
<div class="card mb-3 shadow-sm"> | ||
<div class="card-header">Details</div> | ||
<div class="card-body"> | ||
<h6 class="mb-2">Name</h6> | ||
<div class="form-group"> | ||
{{$user.Name}} | ||
</div> | ||
|
||
<hr> | ||
<h6 class="mb-2">Email</h6> | ||
<div class="form-group"> | ||
{{$user.Email}} | ||
</div> | ||
|
||
<hr> | ||
<h6 class="mb-2">Password</h6> | ||
<div class="form-group"> | ||
Password was last changed <span class="text-info">{{$user.PasswordAgeString}}</span> ago. | ||
</div> | ||
|
||
{{if $user.SystemAdmin}} | ||
<hr> | ||
<h6 class="mb-2">System admin</h6> | ||
<div class="form-group text-success">Enabled</div> | ||
{{end}} | ||
</div> | ||
</div> | ||
|
||
<div class="card mb-3 shadow-sm"> | ||
<div class="card"> | ||
<div class="card-header">Member of realms</div> | ||
<ul class="list-group list-group-flush"> | ||
{{range $realm := $user.Realms}} | ||
<li class="list-group-item"> | ||
{{$realm.Name}} | ||
|
||
{{range $admin := $user.AdminRealms}} | ||
{{if eq $admin.ID $realm.ID}} | ||
<span class="badge badge-primary">Admin</span> | ||
{{end}} | ||
{{end}} | ||
</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know you'll end up doing this, but do you want to link to things like disabling the user? Adding them additional realms, etc? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is all coming soon, but I want to start a new PR for it. The trouble is that the regular link assumes currentUser and passes a realm - we need to pass both a user and a realm for the system-admin case |
||
{{end}} | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<a class="card-link" href="/admin/users">← All users</a> | ||
</main> | ||
</body> | ||
</html> | ||
{{end}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.