Hash: hover
File type: Album
Size: ` + fmt.Sprintf("%d", len(childIDs)) + ` image(s)
Uploader: ` + html.EscapeString(m.UploadIP) + `
Uploaded at: ` + html.EscapeString(m.UploadTime.Format(time.RFC3339)) + `
package contented import ( "context" "encoding/json" "fmt" "html" "log" "net/http" "os" "strings" "time" ) func (this *Server) handlePreview(ctx context.Context, w http.ResponseWriter, fileIDList string) { fileIDs := strings.Split(fileIDList, `-`) // Early get metadata for the first listed element specialTitle := "" if len(fileIDs) == 1 { mFirst, err := this.Metadata(fileIDs[0]) if err != nil { // Same error handling as below - if os.IsNotExist(err) { http.Error(w, "Not found", 404) return } log.Println(err.Error()) http.Error(w, "Internal error", 500) return } specialTitle = mFirst.Filename + " (" + fileIDs[0] + ")" } else { specialTitle = fmt.Sprintf("%d images", len(fileIDs)) } tmpl := `