A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

127 строки
2.5 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}}/status" method="POST" {{if not .User.IsSilenced}}onsubmit="return confirmSilence()"{{end}}>
  57. <a id="status"/>
  58. <th>Status</th>
  59. <td class="active-suspend">
  60. {{if .User.IsSuspended}}
  61. <p>Silenced</p>
  62. <input type="submit" value="Unsilence"/>
  63. {{else}}
  64. <p>Active</p>
  65. <input class="danger" type="submit" value="Silence" {{if .User.IsAdmin}}disabled{{end}}/>
  66. {{end}}
  67. </td>
  68. </form>
  69. </tr>
  70. </table>
  71. <h2>Blogs</h2>
  72. {{range .Colls}}
  73. <h3><a href="/{{.Alias}}/">{{.Title}}</a></h3>
  74. <table class="classy export">
  75. <tr>
  76. <th>Alias</th>
  77. <td>{{.Alias}}</td>
  78. </tr>
  79. <tr>
  80. <th>Title</th>
  81. <td>{{.Title}}</td>
  82. </tr>
  83. <tr>
  84. <th>Description</th>
  85. <td>{{.Description}}</td>
  86. </tr>
  87. <tr>
  88. <th>Visibility</th>
  89. <td>{{.FriendlyVisibility}}</td>
  90. </tr>
  91. <tr>
  92. <th>Views</th>
  93. <td>{{.Views}}</td>
  94. </tr>
  95. <tr>
  96. <th>Posts</th>
  97. <td>{{.TotalPosts}}</td>
  98. </tr>
  99. <tr>
  100. <th>Last Post</th>
  101. <td>{{if .LastPost}}{{.LastPost}}{{else}}Never{{end}}</td>
  102. </tr>
  103. {{if $.Config.Federation}}
  104. <tr>
  105. <th>Fediverse Followers</th>
  106. <td>{{.Followers}}</td>
  107. </tr>
  108. {{end}}
  109. </table>
  110. {{end}}
  111. </div>
  112. <script type="text/javascript">
  113. function confirmSilence() {
  114. return confirm("Silence this user? They'll still be able to log in and access their posts, but no one else will be able to see them anymore. You can reverse this decision at any time.");
  115. }
  116. </script>
  117. {{template "footer" .}}
  118. {{end}}