diff --git a/palette b/palette index a0fd6a8..de59f87 100755 Binary files a/palette and b/palette differ diff --git a/web.go b/web.go index df8cecf..01498d3 100644 --- a/web.go +++ b/web.go @@ -127,6 +127,7 @@ func (a *apiServer) renderPaste(w http.ResponseWriter, row *PasteRow, justCreate "LineCount": lines, "SizeBytes": len(row.Content), "CreatedAgo": agoString(row.CreatedAt), + "CreatedAtUnix": row.CreatedAt, "ViewCount": row.ViewCount, "Visibility": row.Visibility, "ExpiresAt": row.ExpiresAt.Valid, @@ -179,13 +180,13 @@ func (a *apiServer) handlePasteView(w http.ResponseWriter, r *http.Request) { a.renderPaste(w, row, false, "") return } - renderPage(w, "unlock.html", map[string]any{"Page": "unlock", "ID": row.ID, "Wrong": true, "CreatedAgo": agoString(row.CreatedAt)}) + renderPage(w, "unlock.html", map[string]any{"Page": "unlock", "ID": row.ID, "Wrong": true, "CreatedAgo": agoString(row.CreatedAt), "CreatedAtUnix": row.CreatedAt}) return } // check cookie c, err := r.Cookie("pw_" + row.ID) if err != nil || c.Value != "1" { - renderPage(w, "unlock.html", map[string]any{"Page": "unlock", "ID": row.ID, "Wrong": false, "CreatedAgo": agoString(row.CreatedAt)}) + renderPage(w, "unlock.html", map[string]any{"Page": "unlock", "ID": row.ID, "Wrong": false, "CreatedAgo": agoString(row.CreatedAt), "CreatedAtUnix": row.CreatedAt}) return } } diff --git a/web/templates/foot.html b/web/templates/foot.html index b1f3d7b..850e1fc 100644 --- a/web/templates/foot.html +++ b/web/templates/foot.html @@ -1 +1,21 @@ -{{define "foot"}}{{end}} +{{define "foot"}}{{end}} \ No newline at end of file diff --git a/web/templates/history.html b/web/templates/history.html index b06af41..b65148a 100644 --- a/web/templates/history.html +++ b/web/templates/history.html @@ -118,7 +118,7 @@ async function load() { `${esc(it.id)}` + (it.title ? `
${esc(it.title)}
` : `
none
`) + `` + `${esc(it.language || 'text')}` + - `${fmtSize(it.size)}${it.view_count}${ago(it.created_at)}` + + `${fmtSize(it.size)}${it.view_count}${ago(it.created_at)}` + (it.custom_slug ? `/${esc(it.custom_slug)}` : `none`) + `${esc(it.id)}` ).join(''); diff --git a/web/templates/paste.html b/web/templates/paste.html index 705c890..507e9cf 100644 --- a/web/templates/paste.html +++ b/web/templates/paste.html @@ -22,7 +22,7 @@ Language{{if .Language}}{{.Language}}{{else}}text{{end}} Size{{.SizeHuman}} ({{.LineCount}} lines) Views{{.ViewCount}} - Created{{.CreatedAgo}} + Created{{.CreatedAgo}} {{if .ExpiresAt}}Expiresin {{.ExpiresIn}}{{end}} Password{{if .HasPassword}}protected{{else}}none{{end}} {{if .BurnAfterRead}}Burnburn after read{{end}} diff --git a/web/templates/unlock.html b/web/templates/unlock.html index eba22de..24182ce 100644 --- a/web/templates/unlock.html +++ b/web/templates/unlock.html @@ -15,7 +15,7 @@ -
Created {{.CreatedAgo}}
+
Created {{.CreatedAgo}}