border: 1px solid #ddd;
padding: 3px;
}
+
+
+.list-published-tag, .list-publishing-tag {
+ padding-left: 2em;
+ font-size: .8em;
+}
+.list-publishing-tag {
+ color: #aaa;
+}
{% 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>
<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 %}
{% 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 %}
{% 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 %}
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"),
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
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'