11
11
< link rel ="stylesheet " type ="text/css " href ="{{.RootRelPath}}?asset=index.css "/>
12
12
</ head >
13
13
< body class ="{{if .IsRoot}}root-dir{{else}}sub-dir{{end}} ">
14
- {{$contextQueryString := .Context.QueryString}}
15
- {{$isSimple := .IsSimple}}
16
- {{$SubItemPrefix := .SubItemPrefix}}
17
- {{if not $isSimple}}
14
+ {{$contextQueryString := .Context.QueryString - }}
15
+ {{$isSimple := .IsSimple - }}
16
+ {{$SubItemPrefix := .SubItemPrefix - }}
17
+ {{if not $isSimple - }}
18
18
< ol class ="path-list " translate ="no ">
19
- {{range .Paths}}
19
+ {{range .Paths - }}
20
20
< li > < a href ="{{.Path}}{{$contextQueryString}} "> {{fmtFilename .Name}}</ a > </ li >
21
- {{end}}
21
+ {{end - }}
22
22
</ ol >
23
- {{if .LoginAvail}}
23
+ {{if .LoginAvail - }}
24
24
< a class ="login " href ="{{if ne .Status 401}}{{.RootRelPath}}?auth={{.Path}}{{$contextQueryString}}{{end}} "> {{.Trans.LoginLabel}}</ a >
25
- {{else if .AuthUserName}}
25
+ {{else if .AuthUserName - }}
26
26
< span class ="login "> [{{.AuthUserName}}]</ span >
27
- {{end}}
28
- {{if .CanUpload}}
27
+ {{end - }}
28
+ {{if .CanUpload - }}
29
29
< div class ="upload-status ">
30
30
< span class ="label info ">
31
31
< span class ="content "> {{.Trans.UploadingLabel}}</ span >
35
35
</ span >
36
36
< span class ="progress "> </ span >
37
37
</ div >
38
- {{end}}
38
+ {{end - }}
39
39
40
- {{if .CanMkdir}}
40
+ {{if .CanMkdir - }}
41
41
< div class ="panel mkdir ">
42
42
< form method ="POST " action ="{{.SubItemPrefix}}?mkdir ">
43
43
< input type ="text " autocomplete ="off " name ="name " class ="name "/>
44
44
< input type ="hidden " name ="contextquerystring " value ="{{$contextQueryString}} "/>
45
45
< input type ="submit " value ="{{.Trans.MkdirLabel}} " class ="submit "/>
46
46
</ form >
47
47
</ div >
48
- {{end}}
48
+ {{end - }}
49
49
50
- {{if .CanUpload}}
50
+ {{if .CanUpload - }}
51
51
< script type ="text/javascript ">
52
52
function showUploadDirFailMessage ( ) {
53
53
alert ( '{{.Trans.UploadDirFailMessage}}' ) ;
@@ -66,17 +66,17 @@ <h3>{{.Trans.UploadLabel}}</h3>
66
66
< button type ="submit " class ="submit "> {{.Trans.UploadLabel}}</ button >
67
67
</ form >
68
68
</ div >
69
- {{end}}
69
+ {{end - }}
70
70
71
- {{if .CanArchive}}
71
+ {{if .CanArchive - }}
72
72
< div class ="archive ">
73
73
< a href ="{{.SubItemPrefix}}?tar "> .tar</ a >
74
74
< a href ="{{.SubItemPrefix}}?tgz "> .tar.gz</ a >
75
75
< a href ="{{.SubItemPrefix}}?zip "> .zip</ a >
76
76
</ div >
77
- {{end}}
77
+ {{end - }}
78
78
79
- {{if .CanDelete}}
79
+ {{if .CanDelete - }}
80
80
< script type ="text/javascript ">
81
81
function confirmDelete ( e ) {
82
82
var form = e . target ;
@@ -88,18 +88,18 @@ <h3>{{.Trans.UploadLabel}}</h3>
88
88
return proceed ;
89
89
}
90
90
</ script >
91
- {{end}}
92
- {{end}}
93
- {{if .SubItemsHtml}}
91
+ {{end - }}
92
+ {{end - }}
93
+ {{if .SubItemsHtml - }}
94
94
< div class ="panel filter ">
95
95
< div class ="form ">
96
96
< input type ="text " accesskey ="r " placeholder ="{{.Trans.FilterLabel}} "/>
97
97
< button type ="reset "> X</ button >
98
98
</ div >
99
99
</ div >
100
- {{end}}
100
+ {{end - }}
101
101
< ul class ="item-list{{if .HasDeletable}} has-deletable{{end}} ">
102
- {{if not $isSimple}}
102
+ {{if not $isSimple - }}
103
103
< li class ="header "> {{$dirSort := .SortState.DirSort}}{{$sortKey := .SortState.Key}}
104
104
< span class ="detail ">
105
105
< a class ="field dir " href ="{{.SubItemPrefix}}{{.Context.QueryStringOfSort .SortState.NextDirSort}} "> {{.Trans.ListDirLabel}}{{if eq $dirSort -1}}↑{{else if eq $dirSort 1}}↓{{end}}</ a >
@@ -116,8 +116,8 @@ <h3>{{.Trans.UploadLabel}}</h3>
116
116
< span class ="field time "> </ span >
117
117
</ a >
118
118
</ li >
119
- {{end}}
120
- {{range .SubItemsHtml}}
119
+ {{end - }}
120
+ {{range .SubItemsHtml - }}
121
121
< li class ="{{.Type}} ">
122
122
< a href ="{{.Url}} " class ="detail ">
123
123
< span class ="field name " translate ="no "> {{.DisplayName}}</ span >
@@ -126,20 +126,19 @@ <h3>{{.Trans.UploadLabel}}</h3>
126
126
</ a >
127
127
{{if and (not $isSimple) .DeleteUrl}}< form class ="delete " method ="post " action ="{{$SubItemPrefix}}?delete " onsubmit ="return confirmDelete(event) "> < input type ="hidden " name ="name " value ="{{.DeleteUrl}} "/> < input type ="hidden " name ="contextquerystring " value ="{{$contextQueryString}} "/> < button type ="submit "> x</ button > </ form > {{end}}
128
128
</ li >
129
- {{end}}
129
+ {{end - }}
130
130
</ ul >
131
131
132
132
{{if ne .Status 200}}< div class ="error "> {{.Status}}
133
- {{if eq .Status 401}}
134
- {{.Trans.Error401}}
135
- {{else if eq .Status 403}}
136
- {{.Trans.Error403}}
137
- {{else if eq .Status 404}}
138
- {{.Trans.Error404}}
139
- {{else}}
140
- {{.Trans.ErrorStatus}}
141
- {{end}}
142
- </ div > {{end}}
133
+ {{if eq .Status 401 -}}
134
+ {{.Trans.Error401 -}}
135
+ {{else if eq .Status 403 -}}
136
+ {{.Trans.Error403 -}}
137
+ {{else if eq .Status 404 -}}
138
+ {{.Trans.Error404 -}}
139
+ {{else -}}
140
+ {{.Trans.ErrorStatus -}}
141
+ {{end}}</ div > {{end}}
143
142
144
143
< script type ="text/javascript " src ="{{.RootRelPath}}?asset=index.js " defer ="defer " async ="async "> </ script >
145
144
</ body >
0 commit comments