processing panel new looks
[mediagoblin.git] / mediagoblin / templates / mediagoblin / user_pages / processing_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 {% block mediagoblin_content %}
25
26 <h1>{% trans %}Media processing panel{% endtrans %}</h1>
27
28 <p>
29 {% trans %}You can track the state of media being processed for your gallery here.{% endtrans %}
30 </p>
31
32 <h2>{% trans %}Media in-processing{% endtrans %}</h2>
33 <style>
34 .thumb-overlay-status {
35 position: absolute;
36 margin: auto;
37 top: 0; bottom: 0; left: 0; right: 0;
38 width: 180px;
39 height: 20px;
40 display: inline;
41 text-align: center;
42 }
43
44 .thumb-processing {
45 color: black;
46 font-weight: bold;
47 background-color: rgba(255, 255, 255, 0.8);
48 }
49
50 .thumb-failed {
51 color: red;
52 font-weight: bold;
53 background-color: rgba(127, 0, 0, 0.5);
54 }
55
56 .thumb-wrapper {
57 position: relative;
58 /* for proportional thumb resizing */
59 width: auto;
60 height: auto;
61 display: inline-block;
62 }
63
64 .thumb-wrapper img {
65 max-height: 180px;
66 max-width: 180px;
67 }
68 .media_panel td {
69 vertical-align: middle;
70 }
71 </style>
72
73 {% if entries.count() %}
74 <table class="media_panel processing">
75 <tr>
76 <th>ID</th>
77 <th>Title</th>
78 <th>When submitted</th>
79 <th>Transcoding progress</th>
80 </tr>
81 {% for media_entry in entries %}
82 <tr>
83 {% if media_entry.state == 'processed' %}
84 {% set entry_url = media_entry.url_for_self(request.urlgen) %}
85 <td>
86 <div class="thumb-wrapper">
87 <a href="{{ entry_url }}">
88 <img src="{{ media_entry.thumb_url }}" alt="{{ media_entry.title }}" />
89 </a>
90 </div>
91 </td>
92 <td><a href="{{ entry_url }}">{{ media_entry.title }}</a></td>
93 <td>{{ media_entry.created.strftime("%F %R") }}</td>
94 <td>Ready</td>
95 {% else %}
96 <td>
97 <div class="thumb-wrapper">
98 <img src="{{ media_entry.thumb_url }}" alt="{{ media_entry.title }}" />
99 {% if media_entry.state == 'processing' %}
100 <div class="thumb-overlay-status thumb-processing">Processing...</div>
101 {% elif media_entry.state == 'failed' %}
102 <div class="thumb-overlay-status thumb-failed">Failed!</div>
103 {% endif %}
104 </div>
105 </td>
106 <td>{{ media_entry.title }}</td>
107 <td>{{ media_entry.created.strftime("%F %R") }}</td>
108 {% if media_entry.transcoding_progress %}
109 <td>{{ media_entry.transcoding_progress }}%</td>
110 {% else %}
111 <td>Unknown</td>
112 {% endif %}
113 {% endif %}
114 </tr>
115 {% endfor %}
116 </table>
117 {% else %}
118 <p><em>{% trans %}You have not uploaded anything yet!{% endtrans %}</em></p>
119 {% endif %}
120 {% endblock %}