view_playlist_settings.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. {% extends 'base.html' %}
  2. {% load humanize %}
  3. {% load static %}
  4. {% block content %}
  5. <div id="view_playlist">
  6. <br>
  7. {% if playlist.is_user_owned %}
  8. <div class="table-responsive" id="videos-div">
  9. <div id="settings-status-div" class="text-dark">
  10. </div>
  11. <div class="card bg-dark text-white mb-3">
  12. <div class="card-body">
  13. <div id="settings-form">
  14. <div class="row">
  15. <div class="col-sm-3">
  16. <h6 class="mb-0">Playlist Name</h6>
  17. </div>
  18. <div class="col-sm-9 text-white-50">
  19. <input type="text" class="form-control" name="playlistTitle" value="{{ playlist.name }}" aria-describedby="plTitleHelp">
  20. <div id="plTitleHelp" class="form-text">Maximum of 150 characters. Make sure the title does not contain '>' or '<'. They will be replaced by 'greater than' or 'less than' if found.</div>
  21. </div>
  22. </div>
  23. <hr>
  24. <div class="row">
  25. <div class="col-sm-3">
  26. <h6 class="mb-0">Created By</h6>
  27. </div>
  28. <div class="col-sm-9 text-white-50">
  29. <input type="text" class="form-control" id="fullname" value="{{ playlist.channel_name }}" disabled>
  30. </div>
  31. </div>
  32. <hr>
  33. <div class="row">
  34. <div class="col-sm-3">
  35. <h6 class="mb-0">Playlist Description</h6>
  36. </div>
  37. <div class="col-sm-9 text-white-50">
  38. <textarea class="form-control form-text" name="playlistDesc" rows="6" placeholder="Enter a playlist description here!" aria-describedby="plDescHelp">{{ playlist.description }}</textarea>
  39. <div id="plDescHelp" class="form-text">Maximum of 5000 characters. Make sure the description does not contain '>' or '<'. They will be replaced by 'greater than' or 'less than' if found.</div>
  40. </div>
  41. </div>
  42. <hr>
  43. <div class="row">
  44. <div class="col-sm-3">
  45. <h6 class="mb-0">Playlist Privacy</h6>
  46. </div>
  47. <div class="col-sm-9 text-white-50">
  48. <select class="form-select w-25" name="playlistPrivacy">
  49. <option value="Public" {% if not playlist.is_private_on_yt %}selected{% endif %}>Public</option>
  50. <option value="Private" {% if playlist.is_private_on_yt %}selected{% endif %}>Private</option>
  51. </select>
  52. </div>
  53. </div>
  54. <hr>
  55. <div class="row">
  56. <div class="col-sm-3">
  57. <h6 class="mb-0">Preferences</h6>
  58. </div>
  59. <div class="col-sm-9 text-white">
  60. <div class="mb-3 form-check form-switch">
  61. <input class="form-check-input" name="hide videos" type="checkbox" id="flexSwitchCheckChecked" {% if playlist.hide_unavailable_videos %}checked{% endif %}>
  62. <label class="form-check-label" for="flexSwitchCheckChecked">Hide deleted/private videos</label>
  63. </div>
  64. <div class="mb-3 form-check form-switch">
  65. <input class="form-check-input" name="confirm before deleting" type="checkbox" id="flexSwitchCheckChecked" {% if playlist.confirm_before_deleting %}checked{% endif %}>
  66. <label class="form-check-label" for="flexSwitchCheckChecked">Confirm before deleting</label>
  67. </div>
  68. </div>
  69. </div>
  70. <hr>
  71. <div class="row">
  72. <div class="col-sm-3">
  73. <h6 class="mb-0">Danger Zone</h6>
  74. </div>
  75. <div class="col-sm-9 text-white-50">
  76. <button type="button" class="btn btn-outline-danger">Delete Playlist From YouTube</button>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="d-flex justify-content-center">
  83. <div class="btn-group">
  84. <a href="{% url 'playlist' playlist.playlist_id %}" class="btn btn-secondary me-2">Back</a>
  85. <button href="#navbar" hx-post="{% url 'update_playlist_settings' playlist.playlist_id %}" hx-include="[id='settings-form']" hx-target="#settings-status-div"
  86. type="button" class="btn btn-success me-2">Save</button>
  87. </div>
  88. </div>
  89. </div>
  90. {% else %}
  91. <div class="table-responsive" id="videos-div">
  92. <div id="settings-status-div" class="text-dark">
  93. </div>
  94. <div class="card bg-dark text-white mb-3">
  95. <div class="card-body">
  96. <div id="settings-form">
  97. <div class="row">
  98. <div class="col-sm-3">
  99. <h6 class="mb-0">Playlist Name on YouTube</h6>
  100. </div>
  101. <div class="col-sm-9 text-white-50">
  102. <input type="text" class="form-control" name="username" id="username" value="{{ playlist.name }}" disabled>
  103. </div>
  104. </div>
  105. <hr>
  106. <div class="row">
  107. <div class="col-sm-3">
  108. <h6 class="mb-0">Playlist User Label</h6>
  109. </div>
  110. <div class="col-sm-9 text-white-50">
  111. <input type="text" class="form-control" name="user_label" id="user_label" placeholder="Enter a personal label you want to identify this playlist with" value="{{ playlist.user_label }}">
  112. </div>
  113. </div>
  114. <hr>
  115. <div class="row">
  116. <div class="col-sm-3">
  117. <h6 class="mb-0">Created By</h6>
  118. </div>
  119. <div class="col-sm-9 text-white-50">
  120. <input type="text" class="form-control" id="fullname" value="{{ playlist.channel_name }}" disabled>
  121. </div>
  122. </div>
  123. <hr>
  124. <div class="row">
  125. <div class="col-sm-3">
  126. <h6 class="mb-0">Preferences</h6>
  127. </div>
  128. <div class="col-sm-9 text-white">
  129. <div class="mb-3 form-check form-switch">
  130. <input class="form-check-input" name="hide videos" type="checkbox" id="flexSwitchCheckChecked" checked>
  131. <label class="form-check-label" for="flexSwitchCheckChecked">Hide deleted/private videos</label>
  132. </div>
  133. <div class="mb-3 form-check form-switch">
  134. <input class="form-check-input" name="confirm before deleting" type="checkbox" id="flexSwitchCheckChecked" checked>
  135. <label class="form-check-label" for="flexSwitchCheckChecked">Confirm before deleting</label>
  136. </div>
  137. </div>
  138. </div>
  139. <hr>
  140. <div class="row">
  141. <div class="col-sm-3">
  142. <h6 class="mb-0">Danger Zone</h6>
  143. </div>
  144. <div class="col-sm-9 text-white-50">
  145. <a href="{% url 'delete_playlist' playlist.playlist_id %}" class="btn btn-outline-danger">Remove Playlist From UnTube</a>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. <div class="d-flex justify-content-center">
  152. <div class="btn-group">
  153. <a href="{% url 'playlist' playlist.playlist_id %}" class="btn btn-secondary me-2">Back</a>
  154. <button href="#navbar" hx-post="{% url 'update_playlist_settings' playlist.playlist_id %}" hx-include="[id='settings-form']" hx-target="#settings-status-div"
  155. type="button" class="btn btn-success me-2">Save</button>
  156. </div>
  157. </div>
  158. </div>
  159. {% endif %}
  160. </div>
  161. {% endblock %}