more info on publishing
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 8 Aug 2011 11:43:59 +0000 (13:43 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 8 Aug 2011 11:44:25 +0000 (13:44 +0200)
apps/archive/static/style.css
apps/archive/templates/archive/base.html
apps/archive/templates/archive/list.html
apps/archive/templates/archive/list_published.html
apps/archive/templates/archive/list_unpublished.html
apps/archive/urls.py
apps/archive/views.py

index 2e7dbb3..88e075a 100755 (executable)
@@ -57,3 +57,12 @@ a {
     border: 1px solid #ddd;
     padding: 3px;
 }
     border: 1px solid #ddd;
     padding: 3px;
 }
+
+
+.list-published-tag, .list-publishing-tag {
+    padding-left: 2em;
+    font-size: .8em;
+}
+.list-publishing-tag {
+    color: #aaa;
+}
index fbc5a18..5650ac7 100644 (file)
@@ -4,6 +4,7 @@
 {% block repo-zones-nav %}
     <a {% if division = "new" %}class="active" {% endif %}href="{% url list_new %}">{% trans "New" %}</a>
     <a {% if division = "unpublished" %}class="active" {% endif %}href="{% url list_unpublished %}">{% trans "Unpublished" %}</a>
 {% block repo-zones-nav %}
     <a {% if division = "new" %}class="active" {% endif %}href="{% url list_new %}">{% trans "New" %}</a>
     <a {% if division = "unpublished" %}class="active" {% endif %}href="{% url list_unpublished %}">{% trans "Unpublished" %}</a>
+    <a {% if division = "publishing" %}class="active" {% endif %}href="{% url list_publishing %}">{% trans "Publishing" %}</a>
     <a {% if division = "published" %}class="active" {% endif %}href="{% url list_published %}">{% trans "Published" %}</a>
     <a {% if division = "unmanaged" %}class="active" {% endif %}href="{% url list_unmanaged %}">{% trans "Archive" %}</a>
     <a href="{% url logout %}" style='float: right;'>{% trans "Logout" %}</a>
     <a {% if division = "published" %}class="active" {% endif %}href="{% url list_published %}">{% trans "Published" %}</a>
     <a {% if division = "unmanaged" %}class="active" {% endif %}href="{% url list_unmanaged %}">{% trans "Archive" %}</a>
     <a href="{% url logout %}" style='float: right;'>{% trans "Logout" %}</a>
index 9e3d85a..bcd85de 100644 (file)
@@ -7,7 +7,9 @@
     <div id="file-list">
         <h1>{% block file-list-title %}{% endblock %}</h1>
         <div>{% block file-list-info %}{% endblock %}</div>
     <div id="file-list">
         <h1>{% block file-list-title %}{% endblock %}</h1>
         <div>{% block file-list-info %}{% endblock %}</div>
-        <ul>{% block file-list %}{% endblock %}</ul>
+        {% block file-list-wrapper %}
+            <ul>{% block file-list %}{% endblock %}</ul>
+        {% endblock file-list-wrapper %}
     </div>
 
 {% endblock %}
     </div>
 
 {% endblock %}
index 49544b4..6bbec9b 100755 (executable)
@@ -14,7 +14,7 @@
 {% block file-list %}
     {% for file in objects %}
         <li>
 {% block file-list %}
     {% for file in objects %}
         <li>
-            <a href='{% url file file.id %}'>{{ file }}</a></form>
+            <a href='{% url file file.id %}'>{{ file }}</a>
         </li>
     {% endfor %}
 {% endblock %}
         </li>
     {% endfor %}
 {% endblock %}
index 466072c..d414b1d 100755 (executable)
 {% block file-list %}
     {% for file in objects %}
         <li>
 {% block file-list %}
     {% for file in objects %}
         <li>
-            <a href='{% url file file.id %}'>{{ file }}</a></form>
+            <a href='{% url file file.id %}'>{{ file }}</a>
+
+            {% if file.mp3_published %}
+                <span class="list-published-tag" title="{{ file.mp3_published }}">MP3</span>
+            {% else %}{% if file.mp3_status %}
+                <span class="list-publishing-tag" title="{{ file.get_mp3_status_display }}">MP3</span>
+            {% endif %}{% endif %}
+
+            {% if file.ogg_published %}
+                <span class="list-published-tag" title="{{ file.ogg_published }}">Ogg</span>
+            {% else %}{% if file.ogg_status %}
+                <span class="list-publishing-tag" title="{{ file.get_ogg_status_display }}">Ogg</span>
+            {% endif %}{% endif %}
         </li>
     {% endfor %}
 {% endblock %}
         </li>
     {% endfor %}
 {% endblock %}
index c5fe97c..40730ba 100644 (file)
@@ -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'^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"),
     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"),
index 575f5d9..41c71ea 100644 (file)
@@ -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.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.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
 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())
 
 
     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'
 @login_required
 def list_published(request):
     division = 'published'