diff --git a/tubearchivist/home/templates/home/settings.html b/tubearchivist/home/templates/home/settings.html
index e9c2311..d9e1860 100644
--- a/tubearchivist/home/templates/home/settings.html
+++ b/tubearchivist/home/templates/home/settings.html
@@ -1,441 +1,11 @@
-{% extends "home/base.html" %}
+{% extends "home/base_settings.html" %}
{% load static %}
-{% block content %}
-
-
-
-
User Configurations
-
-
-
-
Application Configurations
-
-
-
-
Scheduler Setup
-
-
Schedule settings expect a cron like format, where the first value is minute, second is hour and third is day of the week.
-
Examples:
-
- 0 15 * : Run task every day at 15:00 in the afternoon.
- 30 8 */2 : Run task every second day of the week (Sun, Tue, Thu, Sat) at 08:30 in the morning.
- auto : Sensible default.
- 0 : (zero), deactivate that task.
-
-
Note:
-
- Changes in the scheduler settings require a container restart to take effect.
- Avoid an unnecessary frequent schedule to not get blocked by YouTube. For that reason, the scheduler doesn't support schedules that trigger more than once per hour.
-
-
-
-
-
-
Actions
-
-
-
Delete download queue
-
Delete your pending or previously ignored videos from your download queue.
- Delete all ignored
- Delete all queued
-
-
-
Manual media files import.
-
Add files to the cache/import folder. Make sure to follow the instructions in the Github Wiki .
-
- Start import
-
-
-
-
Embed thumbnails into media file.
-
Set extracted youtube thumbnail as cover art of the media file.
-
- Start process
-
-
-
-
ZIP file index backup
-
Export your database to a zip file stored at cache/backup .
-
Zip file backups are very slow for large archives and consistency is not guaranteed, use snapshots instead. Make sure no other tasks are running when creating a Zip file backup.
-
- Start backup
-
-
-
-
Restore from backup
-
Danger Zone : This will replace your existing index with the backup.
-
Restore from available backup files from cache/backup .
- {% if available_backups %}
-
-
- Timestamp
- Source
- Filename
-
- {% for backup in available_backups %}
-
- Restore
- {{ backup.timestamp }}
- {{ backup.reason }}
- {{ backup.filename }}
-
- {% endfor %}
- {% else %}
-
No backups found.
- {% endif %}
-
-
-
Rescan filesystem
-
Danger Zone : This will delete the metadata of deleted videos from the filesystem.
-
Rescan your media folder looking for missing videos and clean up index. More infos on the Github Wiki .
-
- Rescan filesystem
-
-
- {% if request.user.is_superuser %}
-
-
Users
-
-
-
User Management
-
Access the admin interface for basic user management functionality like adding and deleting users, changing passwords and more.
-
Admin Interface
-
- {% endif %}
+{% block settings_content %}
+
+
Dashboard Coming Soon
-
-{% endblock content %}
+
+
Tube Archivist settings have been moved to their own pages!
+
You can now find them by selecting an item from the sub-menu at the top of the page.
+
+{% endblock settings_content %}
diff --git a/tubearchivist/home/templates/home/settings_actions.html b/tubearchivist/home/templates/home/settings_actions.html
new file mode 100644
index 0000000..74405f7
--- /dev/null
+++ b/tubearchivist/home/templates/home/settings_actions.html
@@ -0,0 +1,66 @@
+{% extends "home/base_settings.html" %}
+{% load static %}
+{% block settings_content %}
+
+
Actions
+
+
+
Delete download queue
+
Delete your pending or previously ignored videos from your download queue.
+ Delete all ignored
+ Delete all queued
+
+
+
Manual media files import.
+
Add files to the cache/import folder. Make sure to follow the instructions in the Github Wiki .
+
+ Start import
+
+
+
+
Embed thumbnails into media file.
+
Set extracted youtube thumbnail as cover art of the media file.
+
+ Start process
+
+
+
+
ZIP file index backup
+
Export your database to a zip file stored at cache/backup .
+
Zip file backups are very slow for large archives and consistency is not guaranteed, use snapshots instead. Make sure no other tasks are running when creating a Zip file backup.
+
+ Start backup
+
+
+
+
Restore from backup
+
Danger Zone : This will replace your existing index with the backup.
+
Restore from available backup files from cache/backup .
+ {% if available_backups %}
+
+
+ Timestamp
+ Source
+ Filename
+
+ {% for backup in available_backups %}
+
+ Restore
+ {{ backup.timestamp }}
+ {{ backup.reason }}
+ {{ backup.filename }}
+
+ {% endfor %}
+ {% else %}
+
No backups found.
+ {% endif %}
+
+
+
Rescan filesystem
+
Danger Zone : This will delete the metadata of deleted videos from the filesystem.
+
Rescan your media folder looking for missing videos and clean up index. More infos on the Github Wiki .
+
+ Rescan filesystem
+
+
+{% endblock settings_content %}
diff --git a/tubearchivist/home/templates/home/settings_application.html b/tubearchivist/home/templates/home/settings_application.html
new file mode 100644
index 0000000..12f7cdb
--- /dev/null
+++ b/tubearchivist/home/templates/home/settings_application.html
@@ -0,0 +1,192 @@
+{% extends "home/base_settings.html" %}
+{% load static %}
+{% block settings_content %}
+
+
Application Configurations
+
+
+{% endblock settings_content %}
diff --git a/tubearchivist/home/templates/home/settings_scheduling.html b/tubearchivist/home/templates/home/settings_scheduling.html
new file mode 100644
index 0000000..b3b57a3
--- /dev/null
+++ b/tubearchivist/home/templates/home/settings_scheduling.html
@@ -0,0 +1,154 @@
+{% extends "home/base_settings.html" %}
+{% load static %}
+{% block settings_content %}
+
+
Scheduler Setup
+
+
Schedule settings expect a cron like format, where the first value is minute, second is hour and third is day of the week.
+
Examples:
+
+ 0 15 * : Run task every day at 15:00 in the afternoon.
+ 30 8 */2 : Run task every second day of the week (Sun, Tue, Thu, Sat) at 08:30 in the morning.
+ auto : Sensible default.
+ 0 : (zero), deactivate that task.
+
+
Note:
+
+ Changes in the scheduler settings require a container restart to take effect.
+ Avoid an unnecessary frequent schedule to not get blocked by YouTube. For that reason, the scheduler doesn't support schedules that trigger more than once per hour.
+
+
+
+
+{% endblock settings_content %}
diff --git a/tubearchivist/home/templates/home/settings_user.html b/tubearchivist/home/templates/home/settings_user.html
new file mode 100644
index 0000000..a12fc75
--- /dev/null
+++ b/tubearchivist/home/templates/home/settings_user.html
@@ -0,0 +1,37 @@
+{% extends "home/base_settings.html" %}
+{% load static %}
+{% block settings_content %}
+
+
User Configurations
+
+
+{% if request.user.is_superuser %}
+
+
Users
+
+
+
User Management
+
Access the admin interface for basic user management functionality like adding and deleting users, changing passwords and more.
+
Admin Interface
+
+{% endif %}
+{% endblock settings_content %}
diff --git a/tubearchivist/home/urls.py b/tubearchivist/home/urls.py
index 14e851b..614c29b 100644
--- a/tubearchivist/home/urls.py
+++ b/tubearchivist/home/urls.py
@@ -26,6 +26,26 @@ urlpatterns = [
login_required(views.SettingsView.as_view()),
name="settings",
),
+ path(
+ "settings/user/",
+ login_required(views.SettingsUserView.as_view()),
+ name="settings_user",
+ ),
+ path(
+ "settings/application/",
+ login_required(views.SettingsApplicationView.as_view()),
+ name="settings_application",
+ ),
+ path(
+ "settings/scheduling/",
+ login_required(views.SettingsSchedulingView.as_view()),
+ name="settings_scheduling",
+ ),
+ path(
+ "settings/actions/",
+ login_required(views.SettingsActionsView.as_view()),
+ name="settings_actions",
+ ),
path("process/", login_required(views.process), name="process"),
path(
"channel/",
diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py
index 507c933..8e9f89d 100644
--- a/tubearchivist/home/views.py
+++ b/tubearchivist/home/views.py
@@ -981,7 +981,21 @@ class SearchView(ArchivistResultsView):
class SettingsView(MinView):
"""resolves to /settings/
- handle the settings page, display current settings,
+ handle the settings dashboard
+ """
+
+ def get(self, request):
+ """read and display the dashboard"""
+ context = self.get_min_context(request)
+ context.update({"title": "Settings Dashboard"})
+
+ return render(request, "home/settings.html", context)
+
+
+class SettingsUserView(MinView):
+ """resolves to /settings/user/
+ handle the settings sub-page for user settings,
+ display current settings,
take post request from the form to update settings
"""
@@ -990,18 +1004,47 @@ class SettingsView(MinView):
context = self.get_min_context(request)
context.update(
{
- "title": "Settings",
+ "title": "User Settings",
+ "config": AppConfig(request.user.id).config,
+ "user_form": UserSettingsForm(),
+ }
+ )
+
+ return render(request, "home/settings_user.html", context)
+
+ def post(self, request):
+ """handle form post to update settings"""
+ user_form = UserSettingsForm(request.POST)
+ if user_form.is_valid():
+ user_form_post = user_form.cleaned_data
+ if any(user_form_post.values()):
+ AppConfig().set_user_config(user_form_post, request.user.id)
+
+ sleep(1)
+ return redirect("settings_user", permanent=True)
+
+
+class SettingsApplicationView(MinView):
+ """resolves to /settings/application/
+ handle the settings sub-page for application configuration,
+ display current settings,
+ take post request from the form to update settings
+ """
+
+ def get(self, request):
+ """read and display current application settings"""
+ context = self.get_min_context(request)
+ context.update(
+ {
+ "title": "Application Settings",
"config": AppConfig(request.user.id).config,
"api_token": self.get_token(request),
- "available_backups": ElasticBackup().get_all_backup_files(),
- "user_form": UserSettingsForm(),
"app_form": ApplicationSettingsForm(),
- "scheduler_form": SchedulerSettingsForm(),
"snapshots": ElasticSnapshot().get_snapshot_stats(),
}
)
- return render(request, "home/settings.html", context)
+ return render(request, "home/settings_application.html", context)
@staticmethod
def get_token(request):
@@ -1012,12 +1055,7 @@ class SettingsView(MinView):
def post(self, request):
"""handle form post to update settings"""
- user_form = UserSettingsForm(request.POST)
config_handler = AppConfig()
- if user_form.is_valid():
- user_form_post = user_form.cleaned_data
- if any(user_form_post.values()):
- config_handler.set_user_config(user_form_post, request.user.id)
app_form = ApplicationSettingsForm(request.POST)
if app_form.is_valid():
@@ -1027,15 +1065,8 @@ class SettingsView(MinView):
updated = config_handler.update_config(app_form_post)
self.post_process_updated(updated, config_handler.config)
- scheduler_form = SchedulerSettingsForm(request.POST)
- if scheduler_form.is_valid():
- scheduler_form_post = scheduler_form.cleaned_data
- if any(scheduler_form_post.values()):
- print(scheduler_form_post)
- ScheduleBuilder().update_schedule_conf(scheduler_form_post)
-
sleep(1)
- return redirect("settings", permanent=True)
+ return redirect("settings_application", permanent=True)
def post_process_updated(self, updated, config):
"""apply changes for config"""
@@ -1080,6 +1111,57 @@ class SettingsView(MinView):
RedisArchivist().set_message(key, message=message, expire=True)
+class SettingsSchedulingView(MinView):
+ """resolves to /settings/scheduling/
+ handle the settings sub-page for scheduling settings,
+ display current settings,
+ take post request from the form to update settings
+ """
+
+ def get(self, request):
+ """read and display current settings"""
+ context = self.get_min_context(request)
+ context.update(
+ {
+ "title": "Scheduling Settings",
+ "config": AppConfig(request.user.id).config,
+ "scheduler_form": SchedulerSettingsForm(),
+ }
+ )
+
+ return render(request, "home/settings_scheduling.html", context)
+
+ def post(self, request):
+ """handle form post to update settings"""
+ scheduler_form = SchedulerSettingsForm(request.POST)
+ if scheduler_form.is_valid():
+ scheduler_form_post = scheduler_form.cleaned_data
+ if any(scheduler_form_post.values()):
+ print(scheduler_form_post)
+ ScheduleBuilder().update_schedule_conf(scheduler_form_post)
+
+ sleep(1)
+ return redirect("settings_scheduling", permanent=True)
+
+
+class SettingsActionsView(MinView):
+ """resolves to /settings/actions/
+ handle the settings actions sub-page
+ """
+
+ def get(self, request):
+ """read and display current settings"""
+ context = self.get_min_context(request)
+ context.update(
+ {
+ "title": "Actions",
+ "available_backups": ElasticBackup().get_all_backup_files(),
+ }
+ )
+
+ return render(request, "home/settings_actions.html", context)
+
+
def process(request):
"""handle all the buttons calls via POST ajax"""
if request.method == "POST":
diff --git a/tubearchivist/static/css/style.css b/tubearchivist/static/css/style.css
index 9ece987..74b3285 100644
--- a/tubearchivist/static/css/style.css
+++ b/tubearchivist/static/css/style.css
@@ -960,15 +960,15 @@ video:-webkit-full-screen {
transform: translateX(-30%);
}
-.info-box-item.channel-nav {
+.info-box-item.child-page-nav {
justify-content: center;
}
-.info-box-item.channel-nav a {
+.info-box-item.child-page-nav a {
padding: 0 1rem;
}
-.info-box-item.channel-nav a:hover {
+.info-box-item.child-page-nav a:hover {
text-decoration: underline;
}