settings.tmpl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {{with .Data}}
  2. {{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
  3. <div class="page-title"> Settings </div>
  4. <form id="settings-form" action="/settings" method="POST">
  5. <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
  6. <div class="settings-form-field">
  7. <label for="visibility"> Default format </label>
  8. {{$defFormat := .Settings.DefaultFormat}}
  9. <select id="post-format" name="format">
  10. {{range .PostFormats}}
  11. <option value="{{.Type}}" {{if eq $defFormat .Type}}selected{{end}}>{{.Name}}</option>
  12. {{end}}
  13. </select>
  14. </div>
  15. <div class="settings-form-field">
  16. <label for="visibility"> Default scope </label>
  17. <select id="visibility" name="visibility">
  18. <option value="public" {{if eq .Settings.DefaultVisibility "public"}}selected{{end}}>Public</option>
  19. <option value="unlisted" {{if eq .Settings.DefaultVisibility "unlisted"}}selected{{end}}>Unlisted</option>
  20. <option value="private" {{if eq .Settings.DefaultVisibility "private"}}selected{{end}}>Private</option>
  21. <option value="direct" {{if eq .Settings.DefaultVisibility "direct"}}selected{{end}}>Direct</option>
  22. </select>
  23. </div>
  24. <div class="settings-form-field">
  25. <label for="notification-interval"> Refresh Notifications </label>
  26. <select id="notification-interval" name="notification_interval">
  27. <option value="0" {{if eq .Settings.NotificationInterval 0}}selected{{end}}>Disabled</option>
  28. <option value="30" {{if eq .Settings.NotificationInterval 30}}selected{{end}}>After 30s</option>
  29. <option value="60" {{if eq .Settings.NotificationInterval 60}}selected{{end}}>After 1m</option>
  30. <option value="120" {{if eq .Settings.NotificationInterval 120}}selected{{end}}>After 2m</option>
  31. <option value="300" {{if eq .Settings.NotificationInterval 300}}selected{{end}}>After 5m</option>
  32. <option value="600" {{if eq .Settings.NotificationInterval 600}}selected{{end}}>After 10m</option>
  33. </select>
  34. </div>
  35. <div class="settings-form-field">
  36. <input id="copy-scope" name="copy_scope" type="checkbox" value="true" {{if .Settings.CopyScope}}checked{{end}}>
  37. <label for="copy-scope"> Copy scope when replying </label>
  38. </div>
  39. <div class="settings-form-field">
  40. <input id="thread-tab" name="thread_in_new_tab" type="checkbox" value="true" {{if .Settings.ThreadInNewTab}}checked{{end}}>
  41. <label for="thread-tab"> Open threads in new tab from timeline </label>
  42. </div>
  43. <div class="settings-form-field">
  44. <input id="hide-attachments" name="hide_attachments" type="checkbox" value="true" {{if .Settings.HideAttachments}}checked{{end}}>
  45. <label for="hide-attachments"> Hide attachments </label>
  46. </div>
  47. <div class="settings-form-field">
  48. <input id="mask-nsfw" name="mask_nsfw" type="checkbox" value="true" {{if .Settings.MaskNSFW}}checked{{end}}>
  49. <label for="mask-nsfw"> Mask NSFW attachments </label>
  50. </div>
  51. <div class="settings-form-field">
  52. <input id="fluoride-mode" name="fluoride_mode" type="checkbox" value="true" {{if .Settings.FluorideMode}}checked{{end}}>
  53. <label for="fluoride-mode"> Enable <abbr title="Enable JavaScript based functionality, e.g., like/retweet without page reload and reply preview on thread page">fluoride mode</abbr> </label>
  54. </div>
  55. <div class="settings-form-field">
  56. <input id="anti-dopamine-mode" name="anti_dopamine_mode" type="checkbox"
  57. value="true" {{if .Settings.AntiDopamineMode}}checked{{end}}>
  58. <label for="anti-dopamine-mode"> Enable <abbr title="Remove like/retweet/unread notification count and disable like/retweet/follow notifications">anti-dopamine mode</abbr> </label>
  59. </div>
  60. <div class="settings-form-field">
  61. <input id="dark-mode" name="dark_mode" type="checkbox" value="true" {{if .Settings.DarkMode}}checked{{end}}>
  62. <label for="dark-mode"> Use dark theme </label>
  63. </div>
  64. <button type="submit"> Save </button>
  65. </form>
  66. {{template "footer.tmpl"}}
  67. {{end}}