2
0

settings.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 d-flex justify-content-center">
  8. <h1><span style="border-bottom: 3px #a35a5a dashed;">User Settings</span></h1>
  9. <div class="card bg-dark text-white visually-hidden">
  10. <div class="card-body">
  11. <!--
  12. <div class="d-flex flex-column align-items-center text-center">
  13. <img src="https://robohash.org/{{ user.username }}.png?set=set3" alt="{{ user.username }}" class="border border-5 border-primary rounded-circle" width="150">
  14. <div class="mt-3">
  15. <h4>{{ user.get_full_name }}</h4>
  16. <p class="text-white-50 mb-1">Full Stack Developer</p>
  17. <p class="text-white-50 font-size-sm">Bay Area, San Francisco, CA</p>
  18. <button class="btn btn-primary"><i class="fas fa-pencil-alt"></i></button>
  19. </div>
  20. </div>
  21. -->
  22. <div class="row">
  23. <div class="col-sm-3">
  24. <h6 class="mb-0">Pick a picture:</h6>
  25. </div>
  26. <div class="col-sm-9 text-white-50">
  27. <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">
  28. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault1">
  29. <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">
  30. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault2">
  31. <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">
  32. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault3">
  33. <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">
  34. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault4">
  35. </div>
  36. </div>
  37. <hr>
  38. <div class="row">
  39. <div class="col-sm-3">
  40. <h6 class="mb-0">Summary</h6>
  41. </div>
  42. <div class="col-sm-9 text-white-50">
  43. <textarea class="form-control form-text" id="summary">{{ user.profile.user_summary }}</textarea>
  44. </div>
  45. </div>
  46. <hr>
  47. <div class="row">
  48. <div class="col-sm-3">
  49. <h6 class="mb-0">Location</h6>
  50. </div>
  51. <div class="col-sm-9 text-white-50">
  52. <input type="text" class="form-control" id="location" value="{{ user.profile.user_location }}">
  53. </div>
  54. </div>
  55. <hr>
  56. <a href="{% url 'update_settings' %}" class="btn btn-success">Update</a>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="col-md-8">
  61. <div class="card bg-dark text-white mb-3">
  62. <div class="card-body">
  63. <form action="{% url 'update_settings' %}" method="post">
  64. {% csrf_token %}
  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>
  90. </div>
  91. </div>
  92. <hr>
  93. <div class="row">
  94. <div class="col-sm-3">
  95. <h6 class="mb-0">Global Preferences</h6>
  96. </div>
  97. <div class="col-sm-9 text-white">
  98. <div class="mb-3 form-check form-switch">
  99. <input class="form-check-input" name="open search in new tab" type="checkbox" id="openSearchCheckDefault" {% if user.profile.open_search_new_tab %} checked {% endif %}>
  100. <label class="form-check-label" for="openSearchCheckDefault">Open Search in new tab</label>
  101. </div>
  102. <div class="mb-3 form-check form-switch">
  103. <input class="form-check-input" name="enable gradient bg" type="checkbox" id="gradient-bg" {% if user.profile.enable_gradient_bg %}checked{% endif %}>
  104. <label class="form-check-label" for="gradient-bg">Use a gradient background</label>
  105. </div>
  106. <div class="mb-3 form-check form-switch">
  107. <input class="form-check-input" name="auto refresh playlists" type="checkbox" id="auto-update-playlists" {% if user.profile.auto_check_for_updates %}checked{% endif %}>
  108. <label class="form-check-label" for="auto-update-playlists" >Automatically check for playlist updates on visit (this might slow down the playlist page for a bit)</label>
  109. </div>
  110. <div class="mb-3 form-check form-switch">
  111. <input class="form-check-input" name="hide videos" type="checkbox" id="hide-videos" {% if user.profile.hide_unavailable_videos %}checked{% endif %}>
  112. <label class="form-check-label" for="hide-videos">Hide deleted/private videos</label>
  113. </div>
  114. <div class="mb-3 form-check form-switch">
  115. <input class="form-check-input" name="confirm before deleting" type="checkbox" id="confirm-before-delete" {% if user.profile.confirm_before_deleting %}checked{% endif %}>
  116. <label class="form-check-label" for="confirm-before-delete">Confirm before deleting</label>
  117. </div>
  118. </div>
  119. </div>
  120. <hr>
  121. <div class="row">
  122. <div class="col-sm-12">
  123. <button type="submit" class="btn btn-success">Save</button>
  124. <a class="btn btn-outline-danger" href="{% url 'delete_account' %}">Delete UnTube account</a>
  125. </div>
  126. </div>
  127. </form>
  128. </div>
  129. </div>
  130. <div class="card mt-3 bg-dark ">
  131. <ul class="list-group list-group-flush">
  132. <li class="list-group-item bg-dark d-flex justify-content-between align-items-center flex-wrap">
  133. <h6 class="mb-0 text-white">Access Token</h6>
  134. <span class="text-white-50">{{ user.profile.access_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">
  138. Refresh Token</h6>
  139. <span class="text-white-50">{{ user.profile.refresh_token }}</span>
  140. </li>
  141. <li class="list-group-item bg-dark d-flex justify-content-between align-items-center flex-wrap">
  142. <h6 class="mb-0 text-white">Expires At</h6>
  143. <span class="text-white-50">{{ user.profile.expires_at }}</span>
  144. </li>
  145. </ul>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. {% endblock %}