2019-11-29 15:08:18 -08:00
{{template "page_header.html" .}}
2025-04-01 22:46:54 -07:00
< script type = "text/javascript" >
// TODO: move this to the frontend JS pack
function uploadThumbnailChanged(browseEl) {
const sub = document.getElementById("update-file");
if(browseEl.value != "") {
sub.disabled = false;
sub.value = "Update file";
} else {
sub.disabled = true;
sub.value = "No file selected"
}
}
< / script >
2018-06-09 23:40:20 -07:00
2025-04-01 22:46:54 -07:00
< header >
< h1 > Edit post< / h1 > < br / >
< div class = "subtitle" > < a href = "{{.referrer}}" > Return< / a > < / div >
< / header >
< form action = "{{webPath `/util`}}" method = "POST" id = "edit-form" >
< input name = "postid" type = "hidden" value = "{{.post.ID}}" / >
< input name = "boardid" type = "hidden" value = "{{.board.ID}}" / >
< input name = "threadid" type = "hidden" value = "{{.post.ThreadID}}" / >
< input name = "password" type = "hidden" value = "{{.password}}" / >
< input name = "doedit" type = "hidden" value = "post" / >
< table id = "postbox-static" >
2025-04-06 16:07:37 -07:00
< tr > < th class = "postblock" > Name< / th > < td > {{.post.Name}}{{if ne .post.Tripcode ""}}{{if .post.IsSecureTripcode}}!{{end}}!{{.post.Tripcode}}{{end}}< / td > < / tr >
2025-04-01 22:46:54 -07:00
< tr > < th class = "postblock" > Email< / th > < td > < input type = "email" name = "editemail" maxlength = "100" size = "28" autocomplete = "off" value = "{{.post.Email}}" / > < / td > < / tr >
< tr > < th class = "postblock" > Subject< / th > < td > < input type = "text" name = "editsubject" maxlength = "100" size = "28" autocomplete = "off" value = "{{.post.Subject}}" / >
< input type = "submit" value = "Update" / > < / td > < / tr >
< tr > < th class = "postblock" > Message< / th > < td > < textarea rows = "4" cols = "48" name = "editmsg" id = "editmsg" > {{.post.MessageRaw}}< / textarea > < / td > < / tr >
< / table >
< / form > < hr / >
< header >
< h1 > {{- with .upload -}}Edit{{else}}Add{{end}} upload/embed< / h1 >
< / header >
< form action = "{{webPath `/util`}}" method = "POST" id = "upload-form" enctype = "multipart/form-data" >
< input name = "postid" type = "hidden" value = "{{$.post.ID}}" / >
< input name = "boardid" type = "hidden" value = "{{$.board.ID}}" / >
< input name = "threadid" type = "hidden" value = "{{$.post.ThreadID}}" / >
< input name = "password" type = "hidden" value = "{{$.password}}" / >
< input name = "doedit" type = "hidden" value = "upload" / >
< table id = "postbox-static" >
{{- with .upload -}}
{{- if .IsEmbed}}
{{$mediaURL := embedURL .Filename .OriginalFilename $.board.Dir}}
< tr > < th class = "postblock" > Current Embed< / th > < td > < a href = "{{$mediaURL}}" > {{$mediaURL}}< / a > < / td > < / tr >
{{- else -}}
< tr > < th class = "postblock" > Filename< / th > < td > {{.Filename}}< / td > < / tr >
< tr > < th class = "postblock" > Current File< / th > < td >
< img src = "{{getThumbnailWebPath $.post.ID}}" alt = "{{webPath $.board.Dir `src` .Filename}}" width = "{{.ThumbnailWidth}}" height = "{{.ThumbnailHeight}}" class = "upload" / >
< / td > < / tr >
2022-12-17 16:30:52 -08:00
{{- end -}}
2025-04-01 22:46:54 -07:00
{{- end -}}
2025-04-05 16:18:11 -07:00
< tr > < th class = "postblock" > New File< / th > < td >
< input name = "imagefile" type = "file" accept = "image/jpeg,image/png,image/gif,video/webm,video/mp4" onchange = "uploadThumbnailChanged(this)" / >
< label for = "spoiler" > < input type = "checkbox" name = "spoiler" id = "spoiler" { { with . upload } } { { if . IsSpoilered } } checked { { end } } { { end } } > Spoiler< / label >
< / td > < / tr >
< tr > < th class = "postblock" > New Embed< / th > < td >
< input type = "text" name = "embed" id = "embed" value = "{{with .upload}}{{if .IsEmbed}}{{embedURL .Filename .OriginalFilename $.board.Dir}}{{end}}{{end}}" placeholder = "Embed URL" / >
< / td > < / tr >
2025-04-01 22:46:54 -07:00
< / table >
< div class = "text-center" >
< input type = "submit" value = "Update" onclick = "return confirm('Press OK to confirm.')" / >
< / div >
< / form > < br / >
2019-11-29 15:08:18 -08:00
{{template "page_footer.html" .}}