mirror of
https://github.com/writeas/writefreely
synced 2025-01-22 15:49:52 +01:00
Remove extra OwnUserPage field
Move logic into template, rather than add another field to the page. Ref T695
This commit is contained in:
parent
6e09fcb9e2
commit
6d4ec0b17d
6
admin.go
6
admin.go
@ -169,9 +169,8 @@ func handleViewAdminUser(app *App, u *User, w http.ResponseWriter, r *http.Reque
|
||||
|
||||
p := struct {
|
||||
*UserPage
|
||||
Config config.AppCfg
|
||||
Message string
|
||||
OwnUserPage bool
|
||||
Config config.AppCfg
|
||||
Message string
|
||||
|
||||
User *User
|
||||
Colls []inspectedCollection
|
||||
@ -196,7 +195,6 @@ func handleViewAdminUser(app *App, u *User, w http.ResponseWriter, r *http.Reque
|
||||
if err != nil {
|
||||
return impart.HTTPError{http.StatusInternalServerError, fmt.Sprintf("Could not get user: %v", err)}
|
||||
}
|
||||
p.OwnUserPage = u.ID == p.User.ID
|
||||
p.UserPage = NewUserPage(app, r, u, p.User.Username, nil)
|
||||
p.TotalPosts = app.db.GetUserPostsCount(p.User.ID)
|
||||
lp, err := app.db.GetUserLastPostTime(p.User.ID)
|
||||
|
@ -61,7 +61,7 @@ button[type="submit"].danger {
|
||||
<tr>
|
||||
<th>Password</th>
|
||||
<td>
|
||||
{{if not .OwnUserPage}}
|
||||
{{if ne .Username .User.Username}}
|
||||
<form id="reset-form" action="/admin/user/{{.User.Username}}/passphrase" method="post" autocomplete="false">
|
||||
<input type="hidden" name="user" value="{{.User.ID}}"/>
|
||||
<button
|
||||
|
Loading…
Reference in New Issue
Block a user