processing panel new looks
This commit is contained in:
parent
45189f6dfb
commit
9ab3c66cf1
@ -30,8 +30,47 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>{% trans %}Media in-processing{% endtrans %}</h2>
|
<h2>{% trans %}Media in-processing{% endtrans %}</h2>
|
||||||
|
<style>
|
||||||
|
.thumb-overlay-status {
|
||||||
|
position: absolute;
|
||||||
|
margin: auto;
|
||||||
|
top: 0; bottom: 0; left: 0; right: 0;
|
||||||
|
width: 180px;
|
||||||
|
height: 20px;
|
||||||
|
display: inline;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
{% if processing_entries.count() %}
|
.thumb-processing {
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumb-failed {
|
||||||
|
color: red;
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: rgba(127, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumb-wrapper {
|
||||||
|
position: relative;
|
||||||
|
/* for proportional thumb resizing */
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumb-wrapper img {
|
||||||
|
max-height: 180px;
|
||||||
|
max-width: 180px;
|
||||||
|
}
|
||||||
|
.media_panel td {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
{% if entries.count() %}
|
||||||
<table class="media_panel processing">
|
<table class="media_panel processing">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
@ -39,9 +78,31 @@
|
|||||||
<th>When submitted</th>
|
<th>When submitted</th>
|
||||||
<th>Transcoding progress</th>
|
<th>Transcoding progress</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for media_entry in processing_entries %}
|
{% for media_entry in entries %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ media_entry.id }}</td>
|
{% if media_entry.state == 'processed' %}
|
||||||
|
{% set entry_url = media_entry.url_for_self(request.urlgen) %}
|
||||||
|
<td>
|
||||||
|
<div class="thumb-wrapper">
|
||||||
|
<a href="{{ entry_url }}">
|
||||||
|
<img src="{{ media_entry.thumb_url }}" alt="{{ media_entry.title }}" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td><a href="{{ entry_url }}">{{ media_entry.title }}</a></td>
|
||||||
|
<td>{{ media_entry.created.strftime("%F %R") }}</td>
|
||||||
|
<td>Ready</td>
|
||||||
|
{% else %}
|
||||||
|
<td>
|
||||||
|
<div class="thumb-wrapper">
|
||||||
|
<img src="{{ media_entry.thumb_url }}" alt="{{ media_entry.title }}" />
|
||||||
|
{% if media_entry.state == 'processing' %}
|
||||||
|
<div class="thumb-overlay-status thumb-processing">Processing...</div>
|
||||||
|
{% elif media_entry.state == 'failed' %}
|
||||||
|
<div class="thumb-overlay-status thumb-failed">Failed!</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td>{{ media_entry.title }}</td>
|
<td>{{ media_entry.title }}</td>
|
||||||
<td>{{ media_entry.created.strftime("%F %R") }}</td>
|
<td>{{ media_entry.created.strftime("%F %R") }}</td>
|
||||||
{% if media_entry.transcoding_progress %}
|
{% if media_entry.transcoding_progress %}
|
||||||
@ -49,61 +110,11 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<td>Unknown</td>
|
<td>Unknown</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
|
||||||
{% else %}
|
|
||||||
<p><em>{% trans %}No media in-processing{% endtrans %}</em></p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<h2>{% trans %}These uploads failed to process:{% endtrans %}</h2>
|
|
||||||
{% if failed_entries.count() %}
|
|
||||||
|
|
||||||
<table class="media_panel failed">
|
|
||||||
<tr>
|
|
||||||
<th>ID</th>
|
|
||||||
<th>Title</th>
|
|
||||||
<th>When submitted</th>
|
|
||||||
<th>Reason for failure</th>
|
|
||||||
<th>Failure metadata</th>
|
|
||||||
</tr>
|
|
||||||
{% for media_entry in failed_entries %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ media_entry.id }}</td>
|
|
||||||
<td>{{ media_entry.title }}</td>
|
|
||||||
<td>{{ media_entry.created.strftime("%F %R") }}</td>
|
|
||||||
{% if media_entry.get_fail_exception() %}
|
|
||||||
<td>{{ media_entry.get_fail_exception().general_message }}</td>
|
|
||||||
<td>{{ media_entry.fail_metadata }}</td>
|
|
||||||
{% else %}
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p><em>{% trans %}No failed entries!{% endtrans %}</em></p>
|
<p><em>{% trans %}You have not uploaded anything yet!{% endtrans %}</em></p>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<h2>{% trans %}Your last 10 successful uploads{% endtrans %}</h2>
|
|
||||||
{% if processed_entries.count() %}
|
|
||||||
|
|
||||||
<table class="media_panel processed">
|
|
||||||
<tr>
|
|
||||||
<th>ID</th>
|
|
||||||
<th>Title</th>
|
|
||||||
<th>Submitted</th>
|
|
||||||
</tr>
|
|
||||||
{% for entry in processed_entries %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ entry.id }}</td>
|
|
||||||
<td><a href="{{ entry.url_for_self(request.urlgen) }}">{{ entry.title }}</a></td>
|
|
||||||
<td>{{ entry.created.strftime("%F %R") }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
|
||||||
{% else %}
|
|
||||||
<p><em>{% trans %}No processed entries, yet!{% endtrans %}</em></p>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -672,6 +672,9 @@ def processing_panel(request):
|
|||||||
order_by(MediaEntry.created.desc()).\
|
order_by(MediaEntry.created.desc()).\
|
||||||
limit(10)
|
limit(10)
|
||||||
|
|
||||||
|
entries = (MediaEntry.query.filter_by(uploader=user.id)
|
||||||
|
.order_by(MediaEntry.created.desc()))
|
||||||
|
|
||||||
# Render to response
|
# Render to response
|
||||||
return render_to_response(
|
return render_to_response(
|
||||||
request,
|
request,
|
||||||
@ -679,7 +682,8 @@ def processing_panel(request):
|
|||||||
{'user': user,
|
{'user': user,
|
||||||
'processing_entries': processing_entries,
|
'processing_entries': processing_entries,
|
||||||
'failed_entries': failed_entries,
|
'failed_entries': failed_entries,
|
||||||
'processed_entries': processed_entries})
|
'processed_entries': processed_entries,
|
||||||
|
'entries': entries})
|
||||||
|
|
||||||
@allow_reporting
|
@allow_reporting
|
||||||
@get_user_media_entry
|
@get_user_media_entry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user