forked from electricdusk/rushlink
meta: Fix CanDelete string
This commit is contained in:
parent
a4cec1e4b0
commit
b9119a0df5
@ -25,7 +25,7 @@ created: unknown
|
|||||||
{{else -}}
|
{{else -}}
|
||||||
created: {{.Paste.TimeCreated}}
|
created: {{.Paste.TimeCreated}}
|
||||||
{{end -}}
|
{{end -}}
|
||||||
delete token: {{.CanDelete}}
|
delete token: {{.CanDeleteString}}
|
||||||
<form action="delete?deleteToken={{.Paste.DeleteToken}}" method="post">
|
<form action="delete?deleteToken={{.Paste.DeleteToken}}" method="post">
|
||||||
<input type="submit" name="delete" value="Delete paste"
|
<input type="submit" name="delete" value="Delete paste"
|
||||||
{{- if or (eq .Paste.State.String "deleted") (not .CanDeleteBool) -}}
|
{{- if or (eq .Paste.State.String "deleted") (not .CanDeleteBool) -}}
|
||||||
|
@ -11,7 +11,7 @@ created: unknown
|
|||||||
{{else -}}
|
{{else -}}
|
||||||
created: {{.Paste.TimeCreated}}
|
created: {{.Paste.TimeCreated}}
|
||||||
{{end -}}
|
{{end -}}
|
||||||
delete token: {{.CanDelete}}
|
delete token: {{.CanDeleteString}}
|
||||||
|
|
||||||
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
|
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
|
||||||
```
|
```
|
||||||
|
@ -207,7 +207,7 @@ func templatesHtmlIndexHtmlTmpl() (*asset, error) {
|
|||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var _templatesHtmlPastemetaHtmlTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x94\xc1\x6e\xdb\x30\x0c\x86\xef\x7a\x0a\x42\x87\x36\x3d\x38\xbe\xb7\xb6\x07\x2c\xdd\x80\x61\x3d\x0c\x5d\x7b\xd9\x4d\xb1\x98\x5a\x8d\x22\x69\x12\xdd\xd6\x10\xf4\xee\x83\xec\x3a\xe9\xb6\x60\x4b\x2f\x01\x42\x51\x1f\xff\x9f\x22\x1d\xa3\xc4\x8d\x32\x08\x9c\x14\x69\xe4\x29\xb1\xf3\x18\x97\xdf\x44\x20\x5c\x7e\xc5\x21\xa5\x18\x97\x9f\x95\xc6\x4f\x2f\x94\xd2\x39\xec\x90\x84\x14\x24\xa0\x00\xdf\x87\x4e\x2b\xb3\x65\x31\xa2\x91\x29\x31\x76\x80\x75\x28\x64\x21\x9c\x43\x23\x33\xb2\x0a\xad\x57\x8e\x80\x06\x87\x35\x27\x7c\xa1\xf2\x51\x3c\x89\x29\xca\x21\xf8\xb6\xe6\xe5\x63\x28\x5b\xeb\x86\x56\x2b\xb7\xb6\xc2\xcb\xe5\x63\xe0\x20\x71\x83\xbe\xa9\xca\x29\xb5\x39\x56\x6b\x6d\xe5\x30\x16\x71\x1e\x41\xc9\x9a\x67\xca\x9d\x5d\xcd\x9c\x95\x35\x24\x94\x41\xcf\xa1\xd5\x22\x84\x9a\x77\x4a\x4a\x34\xbc\x61\xd5\xba\x27\xb2\x06\xac\x69\xb5\x6a\xb7\x7f\x5d\x5d\xe4\x5e\xdc\x5a\x4b\xf7\xb7\x37\x29\x95\xff\x68\xcc\x05\x6f\x56\xd6\x0d\x70\x7f\x7b\x03\x64\x61\x6f\xa2\x2a\xa7\x12\x0d\x54\xc1\x09\x73\x4c\xdf\x77\x12\xd4\x07\x9e\x4d\x3a\x61\x1a\x56\x95\xce\x63\x33\xda\x69\x58\x25\xa0\xf3\xb8\xa9\xf9\x89\x42\x78\x73\x62\x62\x55\x8a\x86\x15\x45\xc1\x62\x54\x1b\x10\x46\xc2\xc2\x20\xbc\x66\x67\x49\xf9\xd7\x2b\xf3\x00\x5c\xa2\x46\x42\xc9\x2f\x60\xb9\x12\xe6\x7a\xfc\xf7\xd1\x5a\x9d\x12\x7b\x56\xd4\xc1\x74\x0e\x64\xb7\x68\x2e\xe1\xbd\x8a\x3f\x4c\xd7\xef\xf2\xed\x7a\x9f\x76\x7d\x08\xbe\xc3\xd4\x09\xac\xd1\x77\x8c\xa8\x03\x42\x71\xdc\xc1\x99\xa6\xab\xde\x6c\x8d\x7d\x36\x67\x0f\x74\x35\xcd\xdc\x98\x9c\xe7\xf7\x12\xf6\xe0\xbb\xc1\x61\x4a\x2c\xe4\x6e\xbd\x09\x8f\xdd\x4b\x69\xea\xec\x9c\xaa\x76\xb8\xf2\x28\x08\xe5\xf2\x4b\xf8\x81\xde\x8e\xc0\x76\x0a\x5d\xc2\x6b\xbd\xb7\xca\xf6\x67\x87\x7a\x07\xc8\x88\x9f\x65\xfd\x2e\x3f\xc6\xc3\x33\xe5\xb5\xd8\x58\xbf\x03\xd1\x92\xb2\xa6\x7e\x7d\xcb\x53\x7a\x9e\x57\xbd\xb3\xb2\xe6\xce\x06\xca\xbb\xa2\x8c\xeb\xe7\x15\x0e\xfd\x7a\xa7\x88\x83\x11\x3b\x9c\xa1\x1c\x9e\x84\xee\xb1\xe6\x13\x07\x5c\x86\x72\x16\x63\x01\x6a\x03\xd6\xc3\x02\x7f\xfe\x6f\xc0\x16\xc6\xd2\x1f\x53\x76\x31\x59\x54\x41\xac\x35\xca\x11\x37\xfb\xce\xbb\x92\xdd\xed\x77\x66\xfe\x3a\xfc\x0a\x00\x00\xff\xff\x0b\x8d\xa7\x25\xd6\x04\x00\x00")
|
var _templatesHtmlPastemetaHtmlTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x94\xc1\x6e\xdb\x30\x0c\x86\xef\x7a\x0a\x42\x87\x36\x3d\x38\xbe\xb7\xb6\x07\x2c\xdd\x80\x61\x3d\x0c\x5d\x7b\xd9\x4d\xb1\x98\x5a\x8d\x22\x69\x12\xdd\xd6\x10\xf4\xee\x83\xec\x3a\xe9\xb6\x60\x4b\x2f\x01\x42\x51\x1f\xff\x9f\x22\x1d\xa3\xc4\x8d\x32\x08\x9c\x14\x69\xe4\x29\xb1\xf3\x18\x97\xdf\x44\x20\x5c\x7e\xc5\x21\xa5\x18\x97\x9f\x95\xc6\x4f\x2f\x94\xd2\x39\xec\x90\x84\x14\x24\xa0\x00\xdf\x87\x4e\x2b\xb3\x65\x31\xa2\x91\x29\x31\x76\x80\x75\x28\x64\x21\x9c\x43\x23\x33\xb2\x0a\xad\x57\x8e\x80\x06\x87\x35\x27\x7c\xa1\xf2\x51\x3c\x89\x29\xca\x21\xf8\xb6\xe6\xe5\x63\x28\x5b\xeb\x86\x56\x2b\xb7\xb6\xc2\xcb\xe5\x63\xe0\x20\x71\x83\xbe\xa9\xca\x29\xb5\x39\x56\x6b\x6d\xe5\x30\x16\x71\x1e\x41\xc9\x9a\x67\xca\x9d\x5d\xcd\x9c\x95\x35\x24\x94\x41\xcf\xa1\xd5\x22\x84\x9a\x77\x4a\x4a\x34\xbc\x61\xd5\xba\x27\xb2\x06\xac\x69\xb5\x6a\xb7\x7f\x5d\x5d\xe4\x5e\xdc\x5a\x4b\xf7\xb7\x37\x29\x95\xff\x68\xcc\x05\x6f\x56\xd6\x0d\x70\x7f\x7b\x03\x64\x61\x6f\xa2\x2a\xa7\x12\x0d\x54\xc1\x09\x73\x4c\xdf\x77\x12\xd4\x07\x9e\x4d\x3a\x61\x1a\x56\x95\xce\x63\x33\xda\x69\x58\x25\xa0\xf3\xb8\xa9\xf9\x89\x42\x78\x73\x62\x62\x55\x8a\x86\x15\x45\xc1\x62\x54\x1b\x10\x46\xc2\xc2\x20\xbc\x66\x67\x49\xf9\xd7\x2b\xf3\x00\x5c\xa2\x46\x42\xc9\x2f\x60\xb9\x12\xe6\x7a\xfc\xf7\xd1\x5a\x9d\x12\x7b\x56\xd4\xc1\x74\x0e\x64\xb7\x68\x2e\xe1\xbd\x8a\x3f\x4c\xd7\xef\xf2\xed\x7a\x9f\x76\x7d\x08\xbe\xc3\xd4\x09\xac\xd1\x77\x8c\xa8\x03\x42\x71\xdc\xc1\x99\xa6\xab\xde\x6c\x8d\x7d\x36\x67\x0f\x74\x35\xcd\xdc\x98\x9c\xe7\xf7\x12\xf6\xe0\xbb\xc1\x61\x4a\x2c\xe4\x6e\xbd\x09\x8f\xdd\x4b\x69\xea\xec\x9c\xaa\x76\xb8\xf2\x28\x08\xe5\xf2\x4b\xf8\x81\xde\x8e\xc0\x76\x0a\x5d\xc2\x6b\xbd\xb7\xca\xf6\x67\x87\x7a\x07\xc8\x88\x9f\x65\xfd\x2e\x3f\xc6\xc3\x33\x4d\x4f\x98\x97\x63\x63\xfd\x0e\x44\x4b\xca\x9a\xfa\xf5\x45\x4f\xe9\x7c\x5e\xf8\xce\xca\x9a\x3b\x1b\x28\x6f\x8c\x32\xae\x9f\x17\x39\xf4\xeb\x9d\x22\x0e\x46\xec\x70\x86\x72\x78\x12\xba\xc7\x9a\x4f\x1c\x70\x19\xca\x59\x8c\x05\xa8\x0d\x58\x0f\x0b\xfc\xf9\xbf\x31\x5b\x18\x4b\x7f\xcc\xda\xc5\x64\x54\x05\xb1\xd6\x28\x47\xdc\xec\x3e\x6f\x4c\x76\xb7\xdf\x9c\xf9\x1b\xf1\x2b\x00\x00\xff\xff\xf7\x78\x59\x94\xdc\x04\x00\x00")
|
||||||
|
|
||||||
func templatesHtmlPastemetaHtmlTmplBytes() ([]byte, error) {
|
func templatesHtmlPastemetaHtmlTmplBytes() ([]byte, error) {
|
||||||
return bindataRead(
|
return bindataRead(
|
||||||
@ -222,7 +222,7 @@ func templatesHtmlPastemetaHtmlTmpl() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "templates/html/pasteMeta.html.tmpl", size: 1238, mode: os.FileMode(420), modTime: time.Unix(1589228560, 0)}
|
info := bindataFileInfo{name: "templates/html/pasteMeta.html.tmpl", size: 1244, mode: os.FileMode(420), modTime: time.Unix(1589228935, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@ -287,7 +287,7 @@ func templatesTxtIndexTxtTmpl() (*asset, error) {
|
|||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var _templatesTxtPastemetaTxtTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x51\xcd\x4a\x03\x31\x10\xbe\xe7\x29\x86\x78\x51\x30\xf1\x5e\xfc\x01\xdb\x15\xc4\x1e\xa4\xae\x17\x4f\x5d\x76\xa7\x36\x74\x4d\xea\x66\x96\x76\x09\xf3\xee\xb2\x49\xdd\x2d\xea\x41\xd0\x4b\x20\x33\xdf\xcc\xf7\x33\x21\xe8\x85\x73\xf4\xbc\x98\x33\x5f\x84\xa0\x1f\x0b\x4f\xa8\x1f\xb0\x63\x0e\x41\xdf\x99\x1a\xb3\x3d\x31\x0b\xa5\x94\x08\xc1\xac\xa0\xb0\x15\x9c\x5a\x84\x03\xf2\x89\x8a\xf8\x36\xc6\xbe\x82\xac\xb0\x46\xc2\x4a\x9e\x81\x9e\x16\x76\x16\x7f\xb7\xce\xd5\xcc\x62\x67\x68\x0d\xa9\x0f\xe4\x36\x68\x27\xf0\x4b\xee\x9b\x34\x95\xf7\x43\x57\x03\x6c\x36\x16\x99\x45\x08\x58\x7b\x04\xf5\x33\xd1\x65\x6b\x37\xd6\xed\xec\x75\x8f\xb3\x55\x0f\xa3\x6e\x8b\x51\x41\xda\x96\x77\x5b\x64\x16\xbe\x77\x73\x54\x8e\xee\xe2\x7a\xb3\xfa\x74\x9c\x9b\x37\x9c\x36\x58\x10\x56\xfa\xde\xbf\x60\xe3\x22\x6d\x99\x4a\x13\x38\x70\x1d\x4b\x1a\x7a\x23\xdf\xb8\x24\xa9\x4f\xaa\xc4\xb7\x80\x86\x18\x99\xc5\xdf\x0e\xb0\x5c\x2e\xc5\x09\xe4\x6e\xc8\x66\x6d\xfc\xd7\x00\xce\x01\xf7\x58\xb6\x84\x13\x51\xb6\x4d\x0d\x4a\x35\xf8\xde\xa2\x27\x90\xb3\x6c\x9e\xe5\x99\x04\xf9\x7f\x57\x93\x51\x53\x34\xcf\x2c\x3e\x02\x00\x00\xff\xff\x21\x52\x69\xa1\x8a\x02\x00\x00")
|
var _templatesTxtPastemetaTxtTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x51\xcd\x4a\x03\x31\x10\xbe\xe7\x29\x86\x78\x51\x30\xf1\x5e\xfc\x01\xdb\x15\xc4\x1e\xa4\xae\x17\x4f\x5d\x76\xa7\x36\x74\x4d\xea\x66\x96\x76\x09\xf3\xee\xb2\x49\xdd\x2d\xea\x41\xd0\x4b\x20\x33\xdf\xcc\xf7\x33\x21\xe8\x85\x73\xf4\xbc\x98\x33\x5f\x84\xa0\x1f\x0b\x4f\xa8\x1f\xb0\x63\x0e\x41\xdf\x99\x1a\xb3\x3d\x31\x0b\xa5\x94\x08\xc1\xac\xa0\xb0\x15\x9c\x5a\x84\x03\xf2\x89\x8a\xf8\x36\xc6\xbe\x82\xac\xb0\x46\xc2\x4a\x9e\x81\x9e\x16\x76\x16\x7f\xb7\xce\xd5\xcc\x62\x67\x68\x0d\xa9\x0f\xe4\x36\x68\x27\xf0\x4b\xee\x9b\x34\x95\xf7\x43\x57\x03\x6c\x36\x16\x99\x45\x08\x58\x7b\x04\xf5\x33\xd1\x65\x6b\x37\xd6\xed\xec\x75\x8f\xb3\x55\x0f\xa3\x6e\x8b\x51\x41\xda\x96\x77\x5b\x64\x16\xbe\x77\x73\x54\x8e\xee\xe2\x7a\xb3\xfa\x74\x9c\x9b\x37\x9c\x36\x58\x10\x56\xfa\xde\xbf\x60\xe3\x22\x6d\x99\x4a\x13\x38\x70\x1d\x4b\x1a\x7a\x23\xdf\xb8\x24\xa9\x4f\xaa\xc4\xb7\x80\x86\x18\x53\xc4\xcc\xe2\x6f\x67\x58\x2e\x97\xe2\x04\x72\x37\x24\xb4\x36\xfe\x6b\x0c\xe7\x80\x7b\x2c\x5b\xc2\x89\x28\xdb\xa6\x06\xa5\x1a\x7c\x6f\xd1\x13\xc8\x59\x36\xcf\xf2\x4c\x82\xfc\xbf\xdb\xc9\xa8\x29\x46\xc0\x2c\x3e\x02\x00\x00\xff\xff\x34\xf2\xf4\x10\x90\x02\x00\x00")
|
||||||
|
|
||||||
func templatesTxtPastemetaTxtTmplBytes() ([]byte, error) {
|
func templatesTxtPastemetaTxtTmplBytes() ([]byte, error) {
|
||||||
return bindataRead(
|
return bindataRead(
|
||||||
@ -302,7 +302,7 @@ func templatesTxtPastemetaTxtTmpl() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "templates/txt/pasteMeta.txt.tmpl", size: 650, mode: os.FileMode(420), modTime: time.Unix(1576577563, 0)}
|
info := bindataFileInfo{name: "templates/txt/pasteMeta.txt.tmpl", size: 656, mode: os.FileMode(420), modTime: time.Unix(1589229127, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
17
handlers.go
17
handlers.go
@ -184,10 +184,10 @@ func (rl *rushlink) viewPasteHandlerInnerMeta(w http.ResponseWriter, r *http.Req
|
|||||||
fileExt = fu.Ext()
|
fileExt = fu.Ext()
|
||||||
}
|
}
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"Paste": p,
|
"Paste": p,
|
||||||
"FileExt": fileExt,
|
"FileExt": fileExt,
|
||||||
"CanDelete": cd,
|
"CanDeleteString": cd.String(),
|
||||||
"CanDeleteBool": cd.Bool(),
|
"CanDeleteBool": cd.Bool(),
|
||||||
}
|
}
|
||||||
rl.render(w, r, "pasteMeta", data)
|
rl.render(w, r, "pasteMeta", data)
|
||||||
return
|
return
|
||||||
@ -205,11 +205,12 @@ func (rl *rushlink) viewActionSuccess(w http.ResponseWriter, r *http.Request, p
|
|||||||
}
|
}
|
||||||
http.Redirect(w, r, pasteURL.String(), http.StatusFound)
|
http.Redirect(w, r, pasteURL.String(), http.StatusFound)
|
||||||
// But still render the page for CURL-like clients.
|
// But still render the page for CURL-like clients.
|
||||||
|
cd := canDeleteYes
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"Paste": p,
|
"Paste": p,
|
||||||
"FileExt": fileExt,
|
"FileExt": fileExt,
|
||||||
"CanDelete": canDeleteYes,
|
"CanDeleteString": cd.String(),
|
||||||
"CanDeleteBool": true,
|
"CanDeleteBool": cd.Bool(),
|
||||||
}
|
}
|
||||||
rl.render(w, r, "pasteMeta", data)
|
rl.render(w, r, "pasteMeta", data)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user