list.tmpl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {{with .Data}}
  2. {{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
  3. <div class="page-title"> List {{.List.Title}} </div>
  4. <form action="/list/{{.List.ID}}/rename" method="POST">
  5. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  6. <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
  7. <input id="title" name="title" value="{{.List.Title}}">
  8. <button type="submit"> Rename </button>
  9. </form>
  10. <div class="page-title"> Users </div>
  11. {{if .Accounts}}
  12. <table>
  13. {{range .Accounts}}
  14. <tr>
  15. <td class="p-0"> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td>
  16. <td class="p-0">
  17. <form class="user-list-action" action="/list/{{$.Data.List.ID}}/removeuser?uid={{.ID}}" method="POST">
  18. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  19. <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
  20. <button type="submit"> Remove </button>
  21. </form>
  22. </td>
  23. </tr>
  24. {{end}}
  25. </table>
  26. {{else}}
  27. <div class="no-data-found">No data found</div>
  28. {{end}}
  29. <div class="page-title"> Add user </div>
  30. <form class="search-form" action="/list/{{.List.ID}}" method="GET">
  31. <span class="post-form-field">
  32. <label for="query"> Query </label>
  33. <input id="query" name="q" value="{{.Q}}">
  34. </span>
  35. <button type="submit"> Search </button>
  36. </form>
  37. <div class="page-title"> Add user by their ID </div>
  38. <span>some times it can works, some times not</span>
  39. <form class="user-list-action" action="/list/{{$.Data.List.ID}}/adduser?" method="POST">
  40. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  41. <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
  42. <input name="uid">
  43. <button type="submit"> Add </button>
  44. </form>
  45. {{if .Q}}
  46. {{if .SearchAccounts}}
  47. <table>
  48. {{range .SearchAccounts}}
  49. <tr>
  50. <td> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td>
  51. <td>
  52. <form class="user-list-action" action="/list/{{$.Data.List.ID}}/adduser?uid={{.ID}}" method="POST">
  53. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  54. <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
  55. <button type="submit"> Add </button>
  56. </form>
  57. </td>
  58. </tr>
  59. {{end}}
  60. </table>
  61. {{else}}
  62. <div class="no-data-found">No data found</div>
  63. {{end}}
  64. {{end}}
  65. {{template "footer.tmpl"}}
  66. {{end}}