From: Radek Czajka Date: Fri, 5 Jun 2020 22:24:37 +0000 (+0200) Subject: Start to reorganize views a little. X-Git-Url: https://git.mdrn.pl/audio.git/commitdiff_plain/133902ac65400d9a129d0cba3db3392b925d54e6 Start to reorganize views a little. --- diff --git a/requirements.txt b/requirements.txt index fe95850..c355845 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ Django==3.0.6 django-cas-ng==4.1.1 django-bootstrap4==1.1.1 django-pglocks==1.0.4 +fnp-django-pagination==2.2.4 celery[redis]==4.4.2 diff --git a/src/archive/constants.py b/src/archive/constants.py index 3493e00..a5527ec 100644 --- a/src/archive/constants.py +++ b/src/archive/constants.py @@ -1,8 +1,9 @@ from django.utils.translation import gettext_lazy as _ + class status: - QUEUED = 1 - WAITING = 10 + WAITING = 1 + QUEUED = 10 ENCODING = 20 TAGGING = 30 CONVERTING_AUDIO = 40 @@ -14,8 +15,8 @@ class status: SETTING_THUMBNAIL = 110 choices = [ - (QUEUED, _('Queued')), (WAITING, _('Waiting')), + (QUEUED, _("Queued")), (ENCODING, _('Encoding')), (TAGGING, _('Tagging')), (CONVERTING_AUDIO, _('Converting audio')), diff --git a/src/archive/templates/archive/audiobook_list.html b/src/archive/templates/archive/audiobook_list.html new file mode 100644 index 0000000..1521b42 --- /dev/null +++ b/src/archive/templates/archive/audiobook_list.html @@ -0,0 +1,73 @@ +{% extends "archive/list.html" %} +{% load i18n %} +{% load pagination_tags %} + + +{% block menu-active-audiobooks %}active{% endblock %} + + +{% block file-list-title %} + {% trans "Audiobooks" %} +{% endblock %} + + +{% block file-list-info %} +{% endblock %} + +{% block file-list-wrapper %} + {% autopaginate object_list 50 %} + {{ block.super }} + {% paginate %} +{% endblock %} + + +{% block file-list %} + + + Slug + {% trans "Title" %} + {% trans "YouTube volume" %} + MP3 + Ogg + YouTube + + + {% for audiobook in object_list %} + + + {% if audiobook.slug %} + {{ audiobook.slug }} + {% endif %} + + {{ audiobook }} + + + {{ audiobook.youtube_volume }} + + + {% if audiobook.mp3_status %} + + MP3: + {{ audiobook.get_mp3_status_display }} + + {% endif %} + + + {% if audiobooks.ogg_status_display %} + + Ogg: + {{ audiobook.get_ogg_status_display }} + + {% endif %} + + + {% if audiobooks.youtube_status %} + + YT: + {{ audiobook.get_youtube_status_display }} + + {% endif %} + + + {% endfor %} +{% endblock %} diff --git a/src/archive/templates/archive/base.html b/src/archive/templates/archive/base.html index 9eeaf8c..f7e5ad7 100644 --- a/src/archive/templates/archive/base.html +++ b/src/archive/templates/archive/base.html @@ -3,11 +3,10 @@ {% block repo-zones-nav %}