{#This injects some information about entries in processing #}
{% if request.user and request.user.has_privilege('active') %}
{% if num_queued is defined and num_queued != 0 %}
-{% set panel_url = request.urlgen('mediagoblin.user_pages.processing_panel',
- user=request.user.username) %}
<span class="num_queued status_icon">
- <a href="{{ panel_url }}">⏳ {{ num_queued }}</a>
+ <a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
+ user=request.user.username, state="processing") }}">⏳ {{ num_queued }}</a>
</span>
{% endif %}
{% if num_failed is defined and num_failed != 0 %}
<span class="num_failed status_icon">
- <a href="{{ panel_url }}">☹ {{ num_failed }}</a>
+ <a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
+ user=request.user.username, state="failed") }}">☹ {{ num_failed }}</a>
</span>
{% endif %}
{% endif %}
<p>
{% trans %}You can track the state of media being processed for your gallery here.{% endtrans %}
</p>
+
+<p>
+Show:
+<a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
+ user=request.user.username) }}">All</a>,
+<a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
+ user=request.user.username, state="processing") }}">In processing</a>,
+<a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
+ user=request.user.username, state="failed") }}">Failed</a>,
+<a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
+ user=request.user.username, state="processed") }}">Succesful</a>
+</p>
{% if entries.count() %}
<table class="media_panel processing">
'/u/<string:user>/panel/',
'mediagoblin.user_pages.views:processing_panel')
+add_route('mediagoblin.user_pages.processing_panel',
+ '/u/<string:user>/panel/<any(processed, processing, failed):state>/',
+ 'mediagoblin.user_pages.views:processing_panel')
+
+
# Stray edit routes
add_route('mediagoblin.edit.edit_media',
'/u/<string:user>/m/<int:media_id>/edit/',
return redirect(
request, 'mediagoblin.user_pages.user_home',
user=user.username)
-
# Get media entries which are in-processing
entries = (MediaEntry.query.filter_by(uploader=user.id)
.order_by(MediaEntry.created.desc()))
+ try:
+ state = request.matchdict['state']
+ # no exception was thrown, filter entries by state
+ entries = entries.filter_by(state=state)
+ except KeyError:
+ # show all entries
+ pass
+
# Render to response
return render_to_response(
request,