view_playlist_settings.html 9.2 KB

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