From: Radek Czajka Date: Mon, 8 Aug 2011 11:43:59 +0000 (+0200) Subject: more info on publishing X-Git-Url: https://git.mdrn.pl/audio.git/commitdiff_plain/55085d3c5421cb05b1ec28943ca99a1751091744?hp=cc84536e2acc2a68cfca13b66d7bd3b84d44edfc more info on publishing --- diff --git a/apps/archive/static/style.css b/apps/archive/static/style.css index 2e7dbb3..88e075a 100755 --- a/apps/archive/static/style.css +++ b/apps/archive/static/style.css @@ -57,3 +57,12 @@ a { border: 1px solid #ddd; padding: 3px; } + + +.list-published-tag, .list-publishing-tag { + padding-left: 2em; + font-size: .8em; +} +.list-publishing-tag { + color: #aaa; +} diff --git a/apps/archive/templates/archive/base.html b/apps/archive/templates/archive/base.html index fbc5a18..5650ac7 100644 --- a/apps/archive/templates/archive/base.html +++ b/apps/archive/templates/archive/base.html @@ -4,6 +4,7 @@ {% block repo-zones-nav %} {% trans "New" %} {% trans "Unpublished" %} + {% trans "Publishing" %} {% trans "Published" %} {% trans "Archive" %} {% trans "Logout" %} diff --git a/apps/archive/templates/archive/list.html b/apps/archive/templates/archive/list.html index 9e3d85a..bcd85de 100644 --- a/apps/archive/templates/archive/list.html +++ b/apps/archive/templates/archive/list.html @@ -7,7 +7,9 @@

{% block file-list-title %}{% endblock %}

{% block file-list-info %}{% endblock %}
- + {% block file-list-wrapper %} + + {% endblock file-list-wrapper %}
{% endblock %} diff --git a/apps/archive/templates/archive/list_published.html b/apps/archive/templates/archive/list_published.html index 49544b4..6bbec9b 100755 --- a/apps/archive/templates/archive/list_published.html +++ b/apps/archive/templates/archive/list_published.html @@ -14,7 +14,7 @@ {% block file-list %} {% for file in objects %}
  • - {{ file }} + {{ file }}
  • {% endfor %} {% endblock %} diff --git a/apps/archive/templates/archive/list_unpublished.html b/apps/archive/templates/archive/list_unpublished.html index 466072c..d414b1d 100755 --- a/apps/archive/templates/archive/list_unpublished.html +++ b/apps/archive/templates/archive/list_unpublished.html @@ -14,7 +14,19 @@ {% block file-list %} {% for file in objects %}
  • - {{ file }} + {{ file }} + + {% if file.mp3_published %} + MP3 + {% else %}{% if file.mp3_status %} + MP3 + {% endif %}{% endif %} + + {% if file.ogg_published %} + Ogg + {% else %}{% if file.ogg_status %} + Ogg + {% endif %}{% endif %}
  • {% endfor %} {% endblock %} diff --git a/apps/archive/urls.py b/apps/archive/urls.py index c5fe97c..40730ba 100644 --- a/apps/archive/urls.py +++ b/apps/archive/urls.py @@ -8,6 +8,7 @@ urlpatterns = patterns('', url(r'^move_to_archive/([^/]+)/$', 'archive.views.move_to_archive', name="move_to_archive"), url(r'^unpublished/$', 'archive.views.list_unpublished', name="list_unpublished"), + url(r'^publishing/$', 'archive.views.list_publishing', name="list_publishing"), url(r'^published/$', 'archive.views.list_published', name="list_published"), url(r'^file/(\d+)/$', 'archive.views.file_managed', name="file"), url(r'^publish/(\d+)/$', 'archive.views.publish', name="publish"), diff --git a/apps/archive/views.py b/apps/archive/views.py index 575f5d9..41c71ea 100644 --- a/apps/archive/views.py +++ b/apps/archive/views.py @@ -8,9 +8,10 @@ from archive import settings from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse -from django.db.models import Q +from django.db.models import Q, Max from django.http import Http404 from django.shortcuts import render, redirect, get_object_or_404 +from django.utils.datastructures import SortedDict from django.views.decorators.http import require_POST import mutagen @@ -158,6 +159,23 @@ def list_unpublished(request): return render(request, "archive/list_unpublished.html", locals()) +@login_required +def list_publishing(request): + division = 'publishing' + + objects = models.Audiobook.objects.exclude(mp3_status=None, ogg_status=None) + objects_by_status = SortedDict() + for o in objects: + if o.mp3_status: + k = o.mp3_status, o.get_mp3_status_display() + objects_by_status.setdefault(k, []).append(o) + if o.ogg_status and o.ogg_status != o.mp3_status: + k = o.ogg_status, o.get_ogg_status_display() + objects_by_status.setdefault(k, []).append(o) + + return render(request, "archive/list_publishing.html", locals()) + + @login_required def list_published(request): division = 'published'