blob: 4c2b5a0cb171f0768f98116d0a7c086b0ab56662 (
plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
{% extends "base.html" %}
{% block title %}Simple Fileupload (Photos){% endblock %}
{% block content %}
{% if folder %}
<h2>Upload photos into /photos/{{folder}}/</h2>
{% else %}
<h2>Upload photos into /photos/{{year}}/</h2>
{% endif %}
<div style = "max-width:35%; margin-left:20%; text-align: center; " >
<form method ='post' enctype ="multipart/form-data">
{% csrf_token %}
<br>
<input class="fancybutton2" type = "file" multiple="multiple"
name = "uploadfiles" id="uploadfiles" />
<br><br><br>
<input class="fancybutton2" style="padding: 0.5em 25px; margin-left: 125px"
label = "Rename to" name = "renameto" id="renameto"
pattern="[A-Za-z][A-Za-z0-9_-\.]*"/>
<label
style="padding: 0.5em 25px; margin-left: 110px"
for="renameto">If uploading a single file, you can rename it<br></label>
<br><br><br>
<button class="fancybutton2" style="padding: 0.5em 25px; margin-left: 155px" type = "submit" value = "Upload" >
Upload
</button>
</form>
</div>
<div style = "max-width:29%; margin-left:20%; text-align: left" >
{% if filesaved %}
<p>
<b>File(s) saved as <br>
{% for f in actual_saved %}
<em>{{f}}</em> <br>
{% endfor %}
</p>
{% endif %}
<strong style="font-size: 110%;">Files:</strong><br>
{% for f in files %}
<a href="{{urlfile|urlencode}}/{{f|urlencode}}">{{f}}</a><br />
{% empty %}
<p><No files here>
{% endfor %}
<p><strong style="font-size: 110%;">Photographer Directories:</strong><br>
{% if folder %}
<a href="{{urldir}}/..">[up]</a><br />
{% endif %}
{% for f in dirs %}
<a href="{{urldir}}/{{f}}">/{{f}}/</a><br />
{% empty %}
<p><No subdirectories>
{% endfor %}
</div>
{% if folder %}
<p>You can upload your photographs here.
<p>You cannot create sub-folders here.
<p>Note that only photo image files are accepted: all other types of files are refused.
{% else %}
<p>You can upload your photographs to any of these folders, and you can create a new folder in your name for your photos.
<p>Note that only photo image files are accepted: all other types of files are refused.
<hr>
<h2>Create new Photographer folder in /photos/{{year}}/</h2>
<div style = "max-width:35%; margin-left:20%; text-align: center; " >
<form method ='post'>
{% csrf_token %}
<br>
<input class="fancybutton2" style="padding: 0.5em 25px; margin-left: 125px"
label = "Photographer" name = "photographer" id="photographer"
pattern="[A-Za-z]+"
placeholder="{{placeholder}}" required />
<label
style="padding: 0.5em 25px; margin-left: 110px"
for="photographer">Photographer's name<br></label>
<label
style="padding: 0.5em 25px; margin-left: 110px"
for="photographer">(no spaces, only letters)</label>
<br><br><br>
<button class="fancybutton2" style="padding: 0.5em 25px; margin-left: 155px" type = "submit" value = "Create" >
Create folder
</button>
</form>
</div>
<p>
{% endif %}
<hr />
{% endblock %}
|