1
1
{% extends "motionlab/base.html" %}
2
- {% load static %}
2
+ {% load static custom_filters %}
3
3
{% block content %}
4
4
5
5
{% get_media_prefix as MEDIA_URL %}
6
6
7
+ < style >
8
+ .console {
9
+ background-color : # 000 ;
10
+ color : # 0f0 ;
11
+ padding : 10px ;
12
+ font-family : monospace;
13
+ white-space : pre-wrap; /* Ensures long lines are wrapped */
14
+ border : 1px solid # 444 ;
15
+ border-radius : 4px ;
16
+ }
17
+ </ style >
18
+
7
19
< script >
20
+ var video_name = "{{ video_name|safe }}" ;
21
+
8
22
function copyToClipboard ( ) {
9
23
/* Get the text field */
10
24
var copyText = document . getElementById ( "link" ) ;
18
32
19
33
/* Alert the copied text */
20
34
alert ( "The results link " + copyText . value + "is now copied.\nSave it in a safe place to get access to your results." ) ;
35
+
36
+ console . log ( video_name )
21
37
}
22
38
</ script >
23
39
@@ -76,7 +92,11 @@ <h3 class="section-heading">
76
92
< h3 > Original video</ h3 >
77
93
< div class ="video-container " style ="margin-bottom: 2em; height: 20em; ">
78
94
< video controls style ="width: 100%; height: 100% " autoplay loop muted >
79
- < source src ="{{ video.file.url }} " type ="video/mp4 ">
95
+ {% if video and video.file and video.file.url %}
96
+ < source src ="{{ video.file.url }} " type ="video/mp4 ">
97
+ {% else %}
98
+ < p > File URL does not exist.</ p >
99
+ {% endif %}
80
100
Your browser does not support the video tag.
81
101
</ video >
82
102
</ div >
@@ -86,7 +106,11 @@ <h3>Motion Analysis</h3>
86
106
< div class ="video-container " style ="margin-bottom: 2em; height: 20em; ">
87
107
{% if annotation.status == "done" or annotation.status == "error" %}
88
108
< video controls style ="width: 100%; height: 100% " autoplay loop muted >
89
- < source src ="{{ annotation.file.url }} " type ="video/mp4 ">
109
+ {% if annotation and annotation.file and annotation.file.url %}
110
+ < source src ="{{ annotation.file.url }} " type ="video/mp4 ">
111
+ {% else %}
112
+ < p > File URL does not exist.</ p >
113
+ {% endif %}
90
114
Your browser does not support the video tag.
91
115
</ video >
92
116
{% else %}
@@ -132,15 +156,22 @@ <h3>Motion Analysis</h3>
132
156
{% if annotation.status == "done" or annotation.status == "error" %}
133
157
< div class ="section categories " id ="analyze " style ="padding: 6rem 0 6rem; ">
134
158
< div class ="container ">
135
- < h3 class ="section-heading ">
136
159
{% if annotation.status == "processing" or annotation.status == "submitted" %}
137
- The video is still processing, please visit this site later.
160
+ < h3 class =" section-heading " > The video is still processing, please visit this site later.</ h3 >
138
161
{% elif annotation.status == "error" %}
139
- Processing finished with an error, we are investigating it.
162
+ </ br >
163
+ < div >
164
+ {% for key, value in results.items %}
165
+ {% with parts=value|split:":" %}
166
+ < h3 class ="section-heading "> {{ parts.0 }}:</ h3 >
167
+ < div class ="console "> {{ parts.1|unquote_error }}</ div >
168
+ {% endwith %}
169
+ {% endfor %}
170
+ </ div >
140
171
{% else %}
141
- Results
172
+ < h3 class =" section-heading " > Results</ h3 >
142
173
{% endif %}
143
- </ h3 >
174
+
144
175
{% if annotation.status == "done" %}
145
176
< div style ="text-align: center ">
146
177
< table style ="margin-left:auto; margin-right:auto; ">
0 commit comments