subscription_manager.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {% set page_title = 'Subscription Manager' %}
  2. {% extends "base.html" %}
  3. {% block style %}
  4. <link href="/youtube.com/static/subscription_manager.css" rel="stylesheet">
  5. {% endblock style %}
  6. {% macro subscription_list(sub_list) %}
  7. {% for subscription in sub_list %}
  8. <li class="sub-list-item {{ 'muted' if subscription['muted'] else '' }}">
  9. <input class="sub-list-checkbox" name="channel_ids" value="{{ subscription['channel_id'] }}" form="subscription-manager-form" type="checkbox">
  10. <a href="{{ subscription['channel_url'] }}" class="sub-list-item-name" title="{{ subscription['channel_name'] }}">{{ subscription['channel_name'] }}</a>
  11. <span class="tag-list">{{ ', '.join(subscription['tags']) }}</span>
  12. </li>
  13. {% endfor %}
  14. {% endmacro %}
  15. {% block main %}
  16. <div class="import-export">
  17. <form class="subscriptions-import-form" enctype="multipart/form-data" action="/youtube.com/import_subscriptions" method="POST">
  18. <h2>Import subscriptions</h2>
  19. <div class="subscriptions-import-options">
  20. <input type="file" id="subscriptions-import" accept="application/json, application/xml, text/x-opml, text/csv" name="subscriptions_file" required>
  21. <input type="submit" value="Import">
  22. </div>
  23. </form>
  24. <form class="subscriptions-export-form" action="/youtube.com/export_subscriptions" method="POST">
  25. <h2>Export subscriptions</h2>
  26. <div class="subscriptions-export-options">
  27. <select id="export-type" name="export_format" title="Export format">
  28. <option value="json_newpipe">JSON (NewPipe)</option>
  29. <option value="json_google_takeout">JSON (Old Google Takeout Format)</option>
  30. <option value="opml">OPML (RSS, no tags)</option>
  31. </select>
  32. <label for="include-muted">Include muted</label>
  33. <input id="include-muted" type="checkbox" name="include_muted" checked>
  34. <input type="submit" value="Export">
  35. </div>
  36. </form>
  37. </div>
  38. <hr>
  39. <form id="subscription-manager-form" class="sub-list-controls" method="POST">
  40. {% if group_by_tags %}
  41. <a class="sort-button" href="/https://www.youtube.com/subscription_manager?group_by_tags=0">Don't group</a>
  42. {% else %}
  43. <a class="sort-button" href="/https://www.youtube.com/subscription_manager?group_by_tags=1">Group by tags</a>
  44. {% endif %}
  45. <input type="text" name="tags">
  46. <button type="submit" name="action" value="add_tags">Add tags</button>
  47. <button type="submit" name="action" value="remove_tags">Remove tags</button>
  48. <button type="submit" name="action" value="unsubscribe_verify">Unsubscribe</button>
  49. <button type="submit" name="action" value="mute">Mute</button>
  50. <button type="submit" name="action" value="unmute">Unmute</button>
  51. <input type="reset" value="Clear Selection">
  52. </form>
  53. {% if group_by_tags %}
  54. <ul class="tag-group-list">
  55. {% for tag_name, sub_list in tag_groups %}
  56. <li class="tag-group">
  57. <h2 class="tag-group-name">{{ tag_name }}</h2>
  58. <ol class="sub-list">
  59. {{ subscription_list(sub_list) }}
  60. </ol>
  61. </li>
  62. {% endfor %}
  63. </ul>
  64. {% else %}
  65. <ol class="sub-list">
  66. {{ subscription_list(sub_list) }}
  67. </ol>
  68. {% endif %}
  69. {% endblock main %}