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.
 
 
 
 
 

85 lines
2.2 KiB

  1. {{define "invite"}}
  2. {{template "header" .}}
  3. <style>
  4. .half {
  5. margin-right: 0.5em;
  6. }
  7. .half + .half {
  8. margin-left: 0.5em;
  9. margin-right: 0;
  10. }
  11. table.classy {
  12. width: 100%;
  13. }
  14. table.classy.export a {
  15. text-transform: initial;
  16. }
  17. table td {
  18. font-size: 0.86em;
  19. }
  20. </style>
  21. <div class="snug content-container">
  22. {{if .Silenced}}
  23. {{template "user-silenced"}}
  24. {{end}}
  25. <h1>Invite people</h1>
  26. <p>Invite others to join <em>{{.SiteName}}</em> by generating and sharing invite links below.</p>
  27. <form style="margin: 2em 0" class="prominent" action="/api/me/invites" method="post">
  28. <div class="row">
  29. <div class="half">
  30. <label for="uses">Maximum number of uses:</label>
  31. <select id="uses" name="uses" {{if .Silenced}}disabled{{end}}>
  32. <option value="0">No limit</option>
  33. <option value="1">1 use</option>
  34. <option value="5">5 uses</option>
  35. <option value="10">10 uses</option>
  36. <option value="25">25 uses</option>
  37. <option value="50">50 uses</option>
  38. <option value="100">100 uses</option>
  39. </select>
  40. </div>
  41. <div class="half">
  42. <label for="expires">Expire after:</label>
  43. <select id="expires" name="expires" {{if .Silenced}}disabled{{end}}>
  44. <option value="0">Never</option>
  45. <option value="30">30 minutes</option>
  46. <option value="60">1 hour</option>
  47. <option value="360">6 hours</option>
  48. <option value="720">12 hours</option>
  49. <option value="1440">1 day</option>
  50. <option value="4320">3 days</option>
  51. <option value="10080">1 week</option>
  52. </select>
  53. </div>
  54. </div>
  55. <div class="row">
  56. <input type="submit" value="Generate" {{if .Silenced}}disabled title="You cannot generate invites while your account is silenced."{{end}} />
  57. </div>
  58. </form>
  59. <table class="classy export">
  60. <tr>
  61. <th>Link</th>
  62. <th>Uses</th>
  63. <th>Expires</th>
  64. </tr>
  65. {{range .Invites}}
  66. <tr>
  67. <td><a href="{{$.Host}}/invite/{{.ID}}">{{$.Host}}/invite/{{.ID}}</a></td>
  68. <td>{{.Uses}}{{if gt .MaxUses.Int64 0}} / {{.MaxUses.Int64}}{{end}}</td>
  69. <td>{{ if .Expires }}{{if .Expired}}Expired{{else}}{{.ExpiresFriendly}}{{end}}{{ else }}&infin;{{ end }}</td>
  70. </tr>
  71. {{else}}
  72. <tr>
  73. <td colspan="3">No invites generated yet.</td>
  74. </tr>
  75. {{end}}
  76. </table>
  77. </div>
  78. {{template "footer" .}}
  79. {{end}}