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 and not playlist.playlist_id == "LL" %}
  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">Playlist User Label</h6>
  26. </div>
  27. <div class="col-sm-9 text-white-50">
  28. <input type="text" class="form-control" name="user_label" placeholder="Enter a user label to identify this playlist with" value="{{ playlist.user_label }}">
  29. </div>
  30. </div>
  31. <hr>
  32. <div class="row">
  33. <div class="col-sm-3">
  34. <h6 class="mb-0">Created By</h6>
  35. </div>
  36. <div class="col-sm-9 text-white-50">
  37. <input type="text" class="form-control" id="fullname" value="{{ playlist.channel_name }}" disabled>
  38. </div>
  39. </div>
  40. <hr>
  41. <div class="row">
  42. <div class="col-sm-3">
  43. <h6 class="mb-0">Playlist Description</h6>
  44. </div>
  45. <div class="col-sm-9 text-white-50">
  46. <textarea class="form-control form-text" name="playlistDesc" rows="6" placeholder="Enter a playlist description here!" aria-describedby="plDescHelp">{{ playlist.description }}</textarea>
  47. <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>
  48. </div>
  49. </div>
  50. <hr>
  51. <div class="row">
  52. <div class="col-sm-3">
  53. <h6 class="mb-0">Playlist Privacy</h6>
  54. </div>
  55. <div class="col-sm-9 text-white-50">
  56. <select class="form-select w-25" name="playlistPrivacy">
  57. <option value="Public" {% if not playlist.is_private_on_yt %}selected{% endif %}>Public</option>
  58. <option value="Private" {% if playlist.is_private_on_yt %}selected{% endif %}>Private</option>
  59. </select>
  60. </div>
  61. </div>
  62. <hr>
  63. <div class="row">
  64. <div class="col-sm-3">
  65. <h6 class="mb-0">Check for updates upon visit</h6>
  66. </div>
  67. <div class="col-sm-9 text-white-50">
  68. <input class="form-check-input" type="checkbox" value="" name="pl-auto-update" {% if playlist.auto_check_for_updates %}checked{% endif %}>
  69. </div>
  70. </div>
  71. <hr>
  72. <div class="row">
  73. <div class="col-sm-3">
  74. <h6 class="mb-0">Danger Zone</h6>
  75. </div>
  76. <div class="col-sm-9 text-white-50 d-flex justify-content-start">
  77. <div id="delete-box">
  78. <a hx-get="{% url 'delete_playlist' playlist.playlist_id %}" hx-target="#delete-box" hx-vals='{"confirmed": "no"}' class="btn btn-outline-danger" hx-indicator="#delete-pl-loader">Delete Playlist From YouTube</a>
  79. </div>
  80. <div id="delete-pl-loader">
  81. <img src="{% static 'svg-loaders/rings.svg' %}" height="40" width="40" class="htmx-indicator">
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="d-flex justify-content-center">
  89. <div class="btn-group">
  90. <a href="{% url 'playlist' playlist.playlist_id %}" class="btn btn-secondary me-2">Back</a>
  91. <a href="#navbar" hx-post="{% url 'update_playlist_settings' playlist.playlist_id %}" hx-include="[id='settings-form']" hx-target="#settings-status-div"
  92. type="button" class="btn btn-success me-2">Save</a>
  93. </div>
  94. </div>
  95. </div>
  96. {% else %}
  97. <div class="table-responsive" id="videos-div">
  98. <div id="settings-status-div" class="text-dark">
  99. </div>
  100. <div class="card bg-dark text-white mb-3">
  101. <div class="card-body">
  102. <div id="settings-form">
  103. <div class="row">
  104. <div class="col-sm-3">
  105. <h6 class="mb-0">Playlist Name on YouTube</h6>
  106. </div>
  107. <div class="col-sm-9 text-white-50">
  108. <input type="text" class="form-control" name="username" id="username" value="{{ playlist.name }}" disabled>
  109. </div>
  110. </div>
  111. <hr>
  112. <div class="row">
  113. <div class="col-sm-3">
  114. <h6 class="mb-0">Playlist User Label</h6>
  115. </div>
  116. <div class="col-sm-9 text-white-50">
  117. <input type="text" class="form-control" name="user_label" placeholder="Enter a user label to identify this playlist with" value="{{ playlist.user_label }}">
  118. </div>
  119. </div>
  120. <hr>
  121. <div class="row">
  122. <div class="col-sm-3">
  123. <h6 class="mb-0">Created By</h6>
  124. </div>
  125. <div class="col-sm-9 text-white-50">
  126. <input type="text" class="form-control" id="fullname" value="{{ playlist.channel_name }}" disabled>
  127. </div>
  128. </div>
  129. <hr>
  130. {% if not playlist.is_yt_mix %}
  131. <div class="row">
  132. <div class="col-sm-3">
  133. <h6 class="mb-0">Automatically check for updates upon visit</h6>
  134. </div>
  135. <div class="col-sm-9 text-white-50">
  136. <input class="form-check-input" type="checkbox" value="" name="pl-auto-update" {% if playlist.auto_check_for_updates %}checked{% endif %}>
  137. </div>
  138. </div>
  139. <hr>
  140. {% endif %}
  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 d-flex justify-content-start">
  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" hx-indicator="#delete-pl-loader">Remove Playlist From UnTube</a>
  148. </div>
  149. <div id="delete-pl-loader">
  150. <img src="{% static 'svg-loaders/rings.svg' %}" height="40" width="40" class="htmx-indicator">
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="d-flex justify-content-center">
  158. <div class="btn-group">
  159. <a href="{% url 'playlist' playlist.playlist_id %}" class="btn btn-secondary me-2">Back</a>
  160. <a href="#navbar" hx-post="{% url 'update_playlist_settings' playlist.playlist_id %}" hx-include="[id='settings-form']" hx-target="#settings-status-div"
  161. type="button" class="btn btn-success me-2">Save</a>
  162. </div>
  163. </div>
  164. </div>
  165. {% endif %}
  166. </div>
  167. {% endblock %}