-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.html
executable file
·73 lines (67 loc) · 2 KB
/
upload.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<script type="text/javascript">
$(document).ready( function() {
$("#addupForm").validate({
// Define as regras
rules:{
riffName:{
required: true, minlength: 2
},
file: {
required: true,
accept: "wav|mp3|m4v|aac|3gp|mp4|caf"
},
},
// Define as mensagens de erro para cada regra
messages:{
riffName:{
required: "You must to enter a riff name",
minlength: "The riff name must have 4 characters at least."
}
}
});
});
</script>
<h2>{% if riff %}Edit your riff {% else %} Upload your riff {% endif %}</h2>
<br/>
<form enctype="multipart/form-data" action="/upload/" method="post">
<label>riff name</label>
<input name="riffName" type="text"
{% if riff %}
value="{{ riff.name }}" />
{% else %}
value="" />
{% endif %}
<label>musical instrument</label>
<select name="musicalInstrument">
{% for i in InstrumentsList %}
<option
{% if riff %}
{% ifequal riff.instrument i %}
SELECTED
{% endifequal %}
{% endif %}
value="{{i}}"> {{i}} </option>
{% endfor %}
</select>
<label>musical genre</label>
<select name="musicalGenre">
{% for i in GenresList %}
<option
{% if riff %}
{% ifequal riff.genre i %}
SELECTED
{% endifequal %}
{% endif %}
value="{{i}}"> {{i}} </option>
{% endfor %}
</select>
<br/>
{% if not riff %}
<label>riff file</label>
<input type="file" name="file" /><br/>
<input type="hidden" name="id" id="id" value="none"/>
{% else %}
<input type="hidden" name="id" id="id" value="{{ riff.key.id }}"/>
{% endif %}
<input type="submit" class="submit" value="Enviar" />
</form>