settings.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <!-- Template taken from https://www.bootdey.com/snippets/view/profile-with-data-and-skills#html -->
  4. <div class="container-fluid text-black">
  5. <div class="main-body" style="padding: 15px">
  6. <div class="row g-5">
  7. <div class="col-md-4 mb-3">
  8. <div class="card bg-dark text-white">
  9. <div class="card-body">
  10. <!--
  11. <div class="d-flex flex-column align-items-center text-center">
  12. <img src="https://robohash.org/{{ user.username }}.png?set=set3" alt="{{ user.username }}" class="border border-5 border-primary rounded-circle" width="150">
  13. <div class="mt-3">
  14. <h4>{{ user.get_full_name }}</h4>
  15. <p class="text-white-50 mb-1">Full Stack Developer</p>
  16. <p class="text-white-50 font-size-sm">Bay Area, San Francisco, CA</p>
  17. <button class="btn btn-primary"><i class="fas fa-pencil-alt"></i></button>
  18. </div>
  19. </div>
  20. -->
  21. <div class="row">
  22. <div class="col-sm-3">
  23. <h6 class="mb-0">Pick a picture:</h6>
  24. </div>
  25. <div class="col-sm-9 text-white-50">
  26. <img src="https://robohash.org/{{ user.username }}.png?set=set1" alt="{{ user.username }}" class="border border-3 {% if user.profile.robohash_set == 1 %}border-primary{% endif %} rounded-circle" width="65">
  27. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault1">
  28. <img src="https://robohash.org/{{ user.username }}.png?set=set2" alt="{{ user.username }}" class="border border-3 {% if user.profile.robohash_set == 2 %}border-primary{% endif %} rounded-circle" width="65">
  29. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault2">
  30. <img src="https://robohash.org/{{ user.username }}.png?set=set3" alt="{{ user.username }}" class="border border-3 {% if user.profile.robohash_set == 3 %}border-primary{% endif %} rounded-circle" width="65">
  31. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault3">
  32. <img src="https://robohash.org/{{ user.username }}.png?set=set4" alt="{{ user.username }}" class="border border-3 {% if user.profile.robohash_set == 4 %}border-primary{% endif %} rounded-circle" width="65">
  33. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault4">
  34. </div>
  35. </div>
  36. <hr>
  37. <div class="row">
  38. <div class="col-sm-3">
  39. <h6 class="mb-0">Summary</h6>
  40. </div>
  41. <div class="col-sm-9 text-white-50">
  42. <textarea class="form-control form-text" id="summary">{{ user.profile.user_summary }}</textarea>
  43. </div>
  44. </div>
  45. <hr>
  46. <div class="row">
  47. <div class="col-sm-3">
  48. <h6 class="mb-0">Location</h6>
  49. </div>
  50. <div class="col-sm-9 text-white-50">
  51. <input type="text" class="form-control" id="location" value="{{ user.profile.user_location }}">
  52. </div>
  53. </div>
  54. <hr>
  55. <a href="#navbar" hx-post="{% url 'update_settings' %}" hx-include="[id='settings-form']" hx-target="#settings-status-div" class="btn btn-success">Update</a>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="col-md-8">
  60. <div id="settings-status-div" class="text-dark">
  61. </div>
  62. <div class="card bg-dark text-white mb-3">
  63. <div class="card-body">
  64. <div id="settings-form">
  65. <div class="row">
  66. <div class="col-sm-3">
  67. <h6 class="mb-0">Username</h6>
  68. </div>
  69. <div class="col-sm-9 text-white-50">
  70. <input type="text" class="form-control" name="username" id="username" value="{{ user.username }}">
  71. </div>
  72. </div>
  73. <hr>
  74. <div class="row">
  75. <div class="col-sm-3">
  76. <h6 class="mb-0">Full Name</h6>
  77. </div>
  78. <div class="col-sm-9 text-white-50">
  79. <input type="text" class="form-control" id="fullname" value="{{ user.get_full_name }}" disabled>
  80. </div>
  81. </div>
  82. <hr>
  83. <div class="row">
  84. <div class="col-sm-3">
  85. <h6 class="mb-0">Email</h6>
  86. </div>
  87. <div class="col-sm-9 text-white-50">
  88. <input type="email" class="form-control" id="email" aria-describedby="emailHelp" value="{{ user.email }}" disabled>
  89. <div id="emailHelp" class="form-text">This is the google account you logged in with.</div> </div>
  90. </div>
  91. <hr>
  92. <div class="row">
  93. <div class="col-sm-3">
  94. <h6 class="mb-0">Preferences</h6>
  95. </div>
  96. <div class="col-sm-9 text-white">
  97. <div class="mb-3 form-check form-switch">
  98. <input class="form-check-input" name="open search in new tab" type="checkbox" id="openSearchCheckDefault" {% if user.profile.open_search_new_tab %} checked {% endif %}>
  99. <label class="form-check-label" for="openSearchCheckDefault">Open Search in new tab</label>
  100. </div>
  101. <div class="mb-3 form-check form-switch">
  102. <input class="form-check-input" name="auto refresh playlists" type="checkbox" id="flexSwitchCheckDefault">
  103. <label class="form-check-label" for="flexSwitchCheckDefault">Automatically refresh playlists on visit</label>
  104. </div>
  105. <div class="mb-3 form-check form-switch">
  106. <input class="form-check-input" name="hide videos" type="checkbox" id="flexSwitchCheckChecked" checked>
  107. <label class="form-check-label" for="flexSwitchCheckChecked">Hide deleted/private videos</label>
  108. </div>
  109. <div class="mb-3 form-check form-switch">
  110. <input class="form-check-input" name="confirm before deleting" type="checkbox" id="flexSwitchCheckChecked" checked>
  111. <label class="form-check-label" for="flexSwitchCheckChecked">Confirm before deleting</label>
  112. </div>
  113. </div>
  114. </div>
  115. <hr>
  116. </div>
  117. <div class="row">
  118. <div class="col-sm-12">
  119. <a href="#navbar" hx-post="{% url 'update_settings' %}" hx-include="[id='settings-form']" hx-target="#settings-status-div" class="btn btn-success">Save</a>
  120. <a class="btn btn-outline-danger" href="{% url 'delete_account' %}">Delete account</a>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="card mt-3 bg-dark ">
  126. <ul class="list-group list-group-flush">
  127. <li class="list-group-item bg-dark d-flex justify-content-between align-items-center flex-wrap">
  128. <h6 class="mb-0 text-white">Access Token</h6>
  129. <span class="text-white-50">{{ user.profile.access_token }}</span>
  130. </li>
  131. <li class="list-group-item bg-dark d-flex justify-content-between align-items-center flex-wrap">
  132. <h6 class="mb-0 text-white">
  133. Refresh Token</h6>
  134. <span class="text-white-50">{{ user.profile.refresh_token }}</span>
  135. </li>
  136. <li class="list-group-item bg-dark d-flex justify-content-between align-items-center flex-wrap">
  137. <h6 class="mb-0 text-white">Expires At</h6>
  138. <span class="text-white-50">{{ user.profile.expires_at }}</span>
  139. </li>
  140. </ul>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <!--
  147. <div class="container-fluid">
  148. <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
  149. <h1 class="h2">Settings</h1>
  150. <span><small>Logged in as <b>{{ user.username }}</b></small></span>
  151. </div>
  152. <div id="settings-status-div" class="text-dark">
  153. </div>
  154. <div id="settings-form">
  155. <div class="mb-3">
  156. <label for="username" class="form-label">Username</label>
  157. <input type="text" class="form-control" name="username" id="username" value="{{ user.username }}">
  158. </div>
  159. <fieldset disabled>
  160. <div class="mb-3">
  161. <label for="email" class="form-label">Email Address</label>
  162. <input type="email" class="form-control" id="email" aria-describedby="emailHelp" value="{{ user.email }}">
  163. <div id="emailHelp" class="form-text">This is the google account you logged in with.</div>
  164. </div>
  165. <div class="mb-3">
  166. <label for="fullname" class="form-label">Full Name</label>
  167. <input type="text" class="form-control" id="fullname" value="{{ user.get_full_name }}">
  168. </div>
  169. <div class="mb-3">
  170. <label for="ytchannelid" class="form-label">YouTube Channel ID</label>
  171. <input type="text" class="form-control" id="ytchannelid" aria-describedby="emailHelp" value="{{ user.profile.yt_channel_id }}">
  172. </div>
  173. <div class="mb-3">
  174. <label for="accesstoken" class="form-label">Access Token</label>
  175. <input type="text" class="form-control" id="accesstoken" value="{{ user.profile.access_token }}">
  176. </div>
  177. <div class="mb-3">
  178. <label for="refreshtoken" class="form-label">Refresh Token</label>
  179. <input type="text" class="form-control" id="refreshtoken" value="{{ user.profile.refresh_token }}">
  180. </div>
  181. <div class="mb-3">
  182. <label for="expiresat" class="form-label">Expires At</label>
  183. <input type="datetime-local" class="form-control" id="expiresat" value="{{ user.profile.expires_at }}">
  184. </div>
  185. </fieldset>
  186. <div class="mb-3 form-check form-switch">
  187. <input class="form-check-input" name="auto refresh playlists" type="checkbox" id="flexSwitchCheckDefault">
  188. <label class="form-check-label" for="flexSwitchCheckDefault">Automatically refresh playlists on visit</label>
  189. </div>
  190. <div class="mb-3 form-check form-switch">
  191. <input class="form-check-input" name="hide videos" type="checkbox" id="flexSwitchCheckChecked" checked>
  192. <label class="form-check-label" for="flexSwitchCheckChecked">Hide deleted/private videos</label>
  193. </div>
  194. <div class="mb-3 form-check form-switch">
  195. <input class="form-check-input" name="confirm before deleting" type="checkbox" id="flexSwitchCheckChecked" checked>
  196. <label class="form-check-label" for="flexSwitchCheckChecked">Confirm before deleting</label>
  197. </div>
  198. </div>
  199. <div>
  200. <a class="btn btn-outline-danger" href="{% url 'delete_account' %}">Delete account</a>
  201. <button type="button" hx-post="{% url 'update_settings' %}" hx-include="[id='settings-form']" hx-target="#settings-status-div" class="btn btn-success">Save</button>
  202. </div>
  203. </div>
  204. -->
  205. {% endblock %}