From c353e5c849cabf4b46e8ddf38ea2513555884b58 Mon Sep 17 00:00:00 2001
From: meeb
Date: Sat, 28 Nov 2020 15:06:46 +1100
Subject: [PATCH] colour tweaks and pagination
---
app/common/static/styles/_colours.scss | 16 +++++++++--
app/common/static/styles/_template.scss | 38 ++++++++++++++++++++++++-
app/common/templates/base.html | 6 ++--
app/common/templates/pagination.html | 7 +++++
app/common/third_party_versions.py | 2 +-
app/sync/templates/sync/source.html | 2 +-
app/sync/templates/sync/sources.html | 9 +++++-
app/tubesync/settings.py | 2 +-
8 files changed, 72 insertions(+), 10 deletions(-)
create mode 100644 app/common/templates/pagination.html
diff --git a/app/common/static/styles/_colours.scss b/app/common/static/styles/_colours.scss
index 153cf92..68d5d5b 100644
--- a/app/common/static/styles/_colours.scss
+++ b/app/common/static/styles/_colours.scss
@@ -2,9 +2,9 @@ $colour-white: #ffffff;
$colour-black: #000000;
$colour-near-black: #011627;
$colour-near-white: #fdfffc;
-$colour-light-blue: #2ec4b6;
+$colour-light-blue: #2e8ac4;
$colour-red: #e71d36;
-$colour-orange: #ff9f1c;
+$colour-orange: #f69e12;
$background-colour: $colour-near-white;
$text-colour: $colour-near-black;
@@ -19,6 +19,8 @@ $nav-link-background-hover-colour: $colour-orange;
$main-button-background-colour: $colour-light-blue;
$main-button-background-hover-colour: $colour-orange;
$main-button-text-colour: $colour-near-white;
+$main-link-colour: $colour-light-blue;
+$main-link-hover-colour: $colour-orange;
$footer-background-colour: $colour-red;
$footer-text-colour: $colour-near-white;
@@ -40,3 +42,13 @@ $collection-text-hover-colour: $colour-near-white;
$box-error-background-colour: $colour-red;
$box-error-text-colour: $colour-near-white;
+
+$pagination-background-colour: $colour-near-white;
+$pagination-text-colour: $colour-near-black;
+$pagination-border-colour: $colour-light-blue;
+$pagination-background-hover-colour: $colour-light-blue;
+$pagination-text-hover-colour: $colour-near-white;
+$pagination-border-hover-colour: $colour-light-blue;
+$pagination-current-background-colour: $colour-orange;
+$pagination-current-text-colour: $colour-near-white;
+$pagination-current-border-colour: $colour-orange;
diff --git a/app/common/static/styles/_template.scss b/app/common/static/styles/_template.scss
index d81429a..f7ee5c9 100644
--- a/app/common/static/styles/_template.scss
+++ b/app/common/static/styles/_template.scss
@@ -32,7 +32,6 @@ header {
font-size: 3rem;
line-height: 2.7rem;
}
-
}
nav {
@@ -62,6 +61,14 @@ main {
padding: 2rem 0 2rem 0;
+ a {
+ color: $main-link-colour;
+ text-decoration: underline;
+ &:hover {
+ color: $main-link-hover-colour;
+ }
+ }
+
h1 {
margin: 0;
padding: 0 0 0.5rem 0;
@@ -85,6 +92,8 @@ main {
display: block;
}
a.collection-item {
+ color: $main-link-colour;
+ text-decoration: none;
&:hover {
background-color: $collection-background-hover-colour !important;
color: $collection-text-hover-colour !important;
@@ -95,6 +104,33 @@ main {
}
}
+
+ .pagination {
+ width: 100%;
+ padding-top: 1rem;
+ text-align: center;
+ a {
+ display: inline-block;
+ font-weight: bold;
+ text-decoration: none;
+ padding: 5px 10px 5px 10px;
+ margin: 0 3px 0 3px;
+ background-color: $pagination-background-colour;
+ color: $pagination-text-colour;
+ border: 2px $pagination-border-colour solid;
+ &:hover {
+ background-color: $pagination-background-hover-colour;
+ color: $pagination-text-hover-colour;
+ border: 2px $pagination-border-hover-colour solid;
+ }
+ }
+ .currentpage {
+ background-color: $pagination-current-background-colour;
+ color: $pagination-current-text-colour;
+ border: 2px $pagination-current-border-colour solid;
+ }
+ }
+
}
footer {
diff --git a/app/common/templates/base.html b/app/common/templates/base.html
index 22354b8..fd7c244 100644
--- a/app/common/templates/base.html
+++ b/app/common/templates/base.html
@@ -52,9 +52,9 @@
https://github.com/meeb/tubesync.
- TubeSync version {{ app_version }} with
- youtube-dl version {{ youtube_dl_version }} and
- FFmpeg version {{ ffmpeg_version }}.
+ TubeSync version {{ app_version }} with
+ youtube-dl version {{ youtube_dl_version }} and
+ FFmpeg version {{ ffmpeg_version }}.
diff --git a/app/common/templates/pagination.html b/app/common/templates/pagination.html
new file mode 100644
index 0000000..70a11c5
--- /dev/null
+++ b/app/common/templates/pagination.html
@@ -0,0 +1,7 @@
+{% if paginator.num_pages > 1 %}
+
+{% endif %}
diff --git a/app/common/third_party_versions.py b/app/common/third_party_versions.py
index 4351040..6622ce0 100644
--- a/app/common/third_party_versions.py
+++ b/app/common/third_party_versions.py
@@ -2,7 +2,7 @@ from youtube_dl import version as yt_version
youtube_dl_version = str(yt_version.__version__)
-ffmpeg_version = '[shared system install]'
+ffmpeg_version = '(shared install)'
# This file may contain data dynamically written during the container build process
diff --git a/app/sync/templates/sync/source.html b/app/sync/templates/sync/source.html
index 3b3b3c3..f030823 100644
--- a/app/sync/templates/sync/source.html
+++ b/app/sync/templates/sync/source.html
@@ -5,7 +5,7 @@
{% block content %}
+{% if sources %}
+
+
+ {% include 'pagination.html' with pagination=sources.paginator %}
+
+
+{% endif %}
{% endblock %}
diff --git a/app/tubesync/settings.py b/app/tubesync/settings.py
index 2189fd3..0e8256c 100644
--- a/app/tubesync/settings.py
+++ b/app/tubesync/settings.py
@@ -116,7 +116,7 @@ HEALTHCHECK_ALLOWED_IPS = ('127.0.0.1',)
DJANGO_SIMPLE_TASK_WORKERS = 2
-SOURCES_PER_PAGE = 50
+SOURCES_PER_PAGE = 25
try: