94d4a1a0fde772d57177b3997b602df2f62ad87b
[mediagoblin.git] / mediagoblin / templates / mediagoblin / moderation / media_panel.html
1 {#
2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
14 #
15 # You should have received a copy of the GNU Affero General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #}
18 {% extends "mediagoblin/base.html" %}
19
20 {% block title -%}
21 {% trans %}Media processing panel{% endtrans %} &mdash; {{ super() }}
22 {%- endblock %}
23
24
25 {% block mediagoblin_content %}
26
27 <h1>{% trans %}Media processing panel{% endtrans %}</h1>
28
29 <p>
30 {% trans %}Here you can track the state of media being processed on this instance.{% endtrans %}
31 </p>
32
33 <h2>{% trans %}Media in-processing{% endtrans %}</h2>
34
35 {% if processing_entries.count() %}
36 <table class="media_panel processing">
37 <tr>
38 <th>{% trans %}ID{% endtrans %}</th>
39 <th>{% trans %}User{% endtrans %}</th>
40 <th>{% trans %}Title{% endtrans %}</th>
41 <th>{% trans %}When submitted{% endtrans %}</th>
42 <th>{% trans %}Transcoding progress{% endtrans %}</th>
43 </tr>
44 {% for media_entry in processing_entries %}
45 <tr>
46 <td>
47 <div class="thumb-wrapper">
48 <img src="{{ media_entry.thumb_url }}" alt="{{ media_entry.title }}" />
49 <div class="thumb-overlay-status thumb-processing">Processing...</div>
50 </div>
51 </td>
52 <td>{{ media_entry.id }}</td>
53 <td>
54 <a href="{{ request.urlgen('mediagoblin.moderation.users_detail', user=media_entry.get_actor.username) }}">
55 {{ media_entry.get_actor.username }}
56 </a>
57 </td>
58 <td>{{ media_entry.title }}</td>
59 <td>{{ media_entry.created.strftime("%F %R") }}</td>
60 {% if media_entry.transcoding_progress %}
61 <td>{{ media_entry.transcoding_progress }}%</td>
62 {% else %}
63 <td>{% trans %}Unknown{% endtrans %}</td>
64 {% endif %}
65 </tr>
66 {% endfor %}
67 </table>
68 {% else %}
69 <p><em>{% trans %}No media in-processing{% endtrans %}</em></p>
70 {% endif %}
71
72 <h2>{% trans %}These uploads failed to process:{% endtrans %}</h2>
73 {% if failed_entries.count() %}
74
75 <table class="media_panel failed">
76 <tr>
77 <th>{% trans %}ID{% endtrans %}</th>
78 <th>{% trans %}User{% endtrans %}</th>
79 <th>{% trans %}Title{% endtrans %}</th>
80 <th>{% trans %}When submitted{% endtrans %}</th>
81 <th>{% trans %}Reason for failure{% endtrans %}</th>
82 <th>{% trans %}Failure metadata{% endtrans %}</th>
83 </tr>
84 {% for media_entry in failed_entries %}
85 <tr>
86 <td>{{ media_entry.id }}</td>
87 <td>{{ media_entry.get_actor.username }}</td>
88 <td>{{ media_entry.title }}</td>
89 <td>{{ media_entry.created.strftime("%F %R") }}</td>
90 {% if media_entry.get_fail_exception() %}
91 <td>{{ media_entry.get_fail_exception().general_message }}</td>
92 <td>{{ media_entry.fail_metadata }}</td>
93 {% else %}
94 <td>&nbsp;</td>
95 <td>&nbsp;</td>
96 {% endif %}
97 </tr>
98 {% endfor %}
99 </table>
100 {% else %}
101 <p><em>{% trans %}No failed entries!{% endtrans %}</em></p>
102 {% endif %}
103 <h2>{% trans %}Last 10 successful uploads{% endtrans %}</h2>
104 {% if processed_entries.count() %}
105
106 <table class="media_panel processed">
107 <tr>
108 <th>{% trans %}ID{% endtrans %}</th>
109 <th>{% trans %}User{% endtrans %}</th>
110 <th>{% trans %}Title{% endtrans %}</th>
111 <th>{% trans %}Submitted{% endtrans %}</th>
112 </tr>
113 {% for media_entry in processed_entries %}
114 <tr>
115 <td>{{ media_entry.id }}</td>
116 <td>{{ media_entry.get_actor.username }}</td>
117 <td><a href="{{ media_entry.url_for_self(request.urlgen) }}">{{ media_entry.title }}</a></td>
118 <td><span title='{{ media_entry.created.strftime("%F %R") }}'>{{ timesince(media_entry.created) }}</span></td>
119 </tr>
120 {% endfor %}
121 </table>
122 {% else %}
123 <p><em>{% trans %}No processed entries, yet!{% endtrans %}</em></p>
124 {% endif %}
125 {% endblock %}