A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

120 lines
2.2 KiB

  1. {{define "view-user"}}
  2. {{template "header" .}}
  3. <style>
  4. table.classy th {
  5. text-align: left;
  6. }
  7. h3 {
  8. font-weight: normal;
  9. }
  10. td.active-suspend {
  11. display: flex;
  12. align-items: center;
  13. }
  14. td.active-suspend > input[type="submit"] {
  15. margin-left: auto;
  16. margin-right: 5%;
  17. }
  18. @media only screen and (max-width: 500px) {
  19. td.active-suspend {
  20. flex-wrap: wrap;
  21. }
  22. td.active-suspend > input[type="submit"] {
  23. margin: auto;
  24. }
  25. }
  26. </style>
  27. <div class="snug content-container">
  28. {{template "admin-header" .}}
  29. <h2 id="posts-header">{{.User.Username}}</h2>
  30. <table class="classy export">
  31. <tr>
  32. <th>No.</th>
  33. <td>{{.User.ID}}</td>
  34. </tr>
  35. <tr>
  36. <th>Type</th>
  37. <td>{{if .User.IsAdmin}}Admin{{else}}User{{end}}</td>
  38. </tr>
  39. <tr>
  40. <th>Username</th>
  41. <td>{{.User.Username}}</td>
  42. </tr>
  43. <tr>
  44. <th>Joined</th>
  45. <td>{{.User.CreatedFriendly}}</td>
  46. </tr>
  47. <tr>
  48. <th>Total Posts</th>
  49. <td>{{.TotalPosts}}</td>
  50. </tr>
  51. <tr>
  52. <th>Last Post</th>
  53. <td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td>
  54. </tr>
  55. <tr>
  56. <form action="/admin/user/{{.User.Username}}" method="POST">
  57. <a id="status"/>
  58. <th>Status</th>
  59. {{if .User.Suspended}}
  60. <td class="active-suspend"><p>User is currently Suspended</p><input type="submit" value="Activate"/></td>
  61. {{else}}
  62. <td class="active-suspend">
  63. <p>User is currently Active</p>
  64. <input class="danger" type="submit" value="Suspend" {{if .User.IsAdmin}}disabled{{end}}/>
  65. </td>
  66. {{end}}
  67. </form>
  68. </tr>
  69. </table>
  70. <h2>Blogs</h2>
  71. {{range .Colls}}
  72. <h3><a href="/{{.Alias}}/">{{.Title}}</a></h3>
  73. <table class="classy export">
  74. <tr>
  75. <th>Alias</th>
  76. <td>{{.Alias}}</td>
  77. </tr>
  78. <tr>
  79. <th>Title</th>
  80. <td>{{.Title}}</td>
  81. </tr>
  82. <tr>
  83. <th>Description</th>
  84. <td>{{.Description}}</td>
  85. </tr>
  86. <tr>
  87. <th>Visibility</th>
  88. <td>{{.FriendlyVisibility}}</td>
  89. </tr>
  90. <tr>
  91. <th>Views</th>
  92. <td>{{.Views}}</td>
  93. </tr>
  94. <tr>
  95. <th>Posts</th>
  96. <td>{{.TotalPosts}}</td>
  97. </tr>
  98. <tr>
  99. <th>Last Post</th>
  100. <td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td>
  101. </tr>
  102. {{if $.Config.Federation}}
  103. <tr>
  104. <th>Fediverse Followers</th>
  105. <td>{{.Followers}}</td>
  106. </tr>
  107. {{end}}
  108. </table>
  109. {{end}}
  110. </div>
  111. {{template "footer" .}}
  112. {{end}}