settings.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <!-- Template taken from https://www.bootdey.com/snippets/view/profile-with-data-and-skills#html -->
  4. {% if not user.profile.imported_yt_playlists %}
  5. <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  6. <symbol id="check-circle-fill" fill="currentColor" viewBox="0 0 16 16">
  7. <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
  8. </symbol>
  9. <symbol id="info-fill" fill="currentColor" viewBox="0 0 16 16">
  10. <path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
  11. </symbol>
  12. <symbol id="exclamation-triangle-fill" fill="currentColor" viewBox="0 0 16 16">
  13. <path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
  14. </symbol>
  15. </svg>
  16. <div class="alert alert-primary d-flex align-items-center" role="alert">
  17. <svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Info:"><use xlink:href="#info-fill"/></svg>
  18. <div>
  19. You have not imported your YouTube playlists yet!
  20. <a class="btn btn-success btn-sm" href="{% url 'import_user_yt_playlists' %}">Import</a>
  21. </div>
  22. </div>
  23. {% endif %}
  24. <div class="row g-5">
  25. <div class="col-md-3 mb-3 d-flex justify-content-start">
  26. <h1><span style="border-bottom: 3px #a35a5a dashed;">User Settings</span></h1>
  27. <div class="card bg-dark text-white visually-hidden">
  28. <div class="card-body">
  29. <div class="row">
  30. <div class="col-sm-3">
  31. <h6 class="mb-0">Pick a picture:</h6>
  32. </div>
  33. <div class="col-sm-9 text-white-50">
  34. <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">
  35. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault1">
  36. <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">
  37. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault2">
  38. <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">
  39. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault3">
  40. <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">
  41. <input class="form-check-input visually-hidden" type="radio" name="profilePicRadio" id="flexRadioDefault4">
  42. </div>
  43. </div>
  44. <hr>
  45. <div class="row">
  46. <div class="col-sm-3">
  47. <h6 class="mb-0">Summary</h6>
  48. </div>
  49. <div class="col-sm-9 text-white-50">
  50. <textarea class="form-control form-text" id="summary">{{ user.profile.user_summary }}</textarea>
  51. </div>
  52. </div>
  53. <hr>
  54. <div class="row">
  55. <div class="col-sm-3">
  56. <h6 class="mb-0">Location</h6>
  57. </div>
  58. <div class="col-sm-9 text-white-50">
  59. <input type="text" class="form-control" id="location" value="{{ user.profile.user_location }}">
  60. </div>
  61. </div>
  62. <hr>
  63. <a href="{% url 'update_settings' %}" class="btn btn-success">Update</a>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="col-md-9">
  68. <div class="card bg-dark text-white mb-3">
  69. <div class="card-body">
  70. <form action="{% url 'update_settings' %}" method="post">
  71. {% csrf_token %}
  72. <div class="row">
  73. <div class="col-sm-3">
  74. <h6 class="mb-0">Username</h6>
  75. </div>
  76. <div class="col-sm-9 text-white-50">
  77. <input type="text" class="form-control" name="username" id="username" value="{{ user.username }}">
  78. </div>
  79. </div>
  80. <hr>
  81. <div class="row">
  82. <div class="col-sm-3">
  83. <h6 class="mb-0">Full Name</h6>
  84. </div>
  85. <div class="col-sm-9 text-white-50">
  86. <input type="text" class="form-control" id="fullname" value="{{ user.get_full_name }}" disabled>
  87. </div>
  88. </div>
  89. <hr>
  90. <div class="row">
  91. <div class="col-sm-3">
  92. <h6 class="mb-0">Email</h6>
  93. </div>
  94. <div class="col-sm-9 text-white-50">
  95. <input type="email" class="form-control" id="email" aria-describedby="emailHelp" value="{{ user.email }}" disabled>
  96. <div id="emailHelp" class="form-text">This is the google account you logged in with.</div>
  97. </div>
  98. </div>
  99. <hr>
  100. <div class="row">
  101. <div class="col-sm-3">
  102. <h6 class="mb-0">Global Preferences</h6>
  103. </div>
  104. <div class="col-sm-9 text-white">
  105. <div class="mb-3 form-check form-switch">
  106. <input class="form-check-input" name="open search in new tab" type="checkbox" id="openSearchCheckDefault" {% if user.profile.open_search_new_tab %} checked {% endif %}>
  107. <label class="form-check-label" for="openSearchCheckDefault">Open Search in new tab</label>
  108. </div>
  109. <div class="mb-3 form-check form-switch">
  110. <input class="form-check-input" name="enable gradient bg" type="checkbox" id="gradient-bg" {% if user.profile.enable_gradient_bg %}checked{% endif %}>
  111. <label class="form-check-label" for="gradient-bg">Use a gradient background</label>
  112. </div>
  113. <!--
  114. <div class="mb-3 form-check form-switch">
  115. <input class="form-check-input" name="hide videos" type="checkbox" id="hide-videos" {% if user.profile.hide_unavailable_videos %}checked{% endif %}>
  116. <label class="form-check-label" for="hide-videos">Hide deleted/private videos</label>
  117. </div>
  118. -->
  119. <div class="mb-3 form-check form-switch">
  120. <input class="form-check-input" name="confirm before deleting" type="checkbox" id="confirm-before-delete" {% if user.profile.confirm_before_deleting %}checked{% endif %}>
  121. <label class="form-check-label" for="confirm-before-delete">Confirm before deleting</label>
  122. </div>
  123. </div>
  124. </div>
  125. <hr>
  126. <div class="row">
  127. <div class="col-sm-12">
  128. <button type="submit" class="btn btn-success me-1">Save</button>
  129. <a class="btn btn-outline-danger" href="{% url 'delete_account' %}">Delete UnTube account</a>
  130. </div>
  131. </div>
  132. </form>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. {% endblock %}