mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Time edited doesn't show ns
Former-commit-id: 24fc61197903696b5f44d5866b62a7f3a242113b [formerly 66c03d4a77a41f0aa6013f416c956d14bd477b24] [formerly 4c452c8aa99b07ec5b7d91c7eca56785cf2a67c9 [formerly 304946b54165907299bc4c09233a621722e664a4 [formerly8554b5f535
]]] Former-commit-id: 5be4040c111ab8bd75cf879f3ef02f4502985a90 [formerly 16a8376cd42450055d9cd4a7c68e1405413ffe23] Former-commit-id: 0cf418584a58c5f0633c1026828d42220494c1a5 Former-commit-id:195bd6c7a1
This commit is contained in:
parent
de86984076
commit
4770798c34
13
routes.go
13
routes.go
@ -111,6 +111,10 @@ func editNote(c *gin.Context) {
|
||||
c.Redirect(302, "/"+title+"/view")
|
||||
}
|
||||
numRows := len(strings.Split(currentText, "\n")) + 10
|
||||
totalTimeString := totalTime.String()
|
||||
if totalTime.Seconds() < 1 {
|
||||
totalTimeString = "< 1 s"
|
||||
}
|
||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||
"Title": title,
|
||||
"WikiName": RuntimeArgs.WikiName,
|
||||
@ -118,7 +122,7 @@ func editNote(c *gin.Context) {
|
||||
"CurrentText": currentText,
|
||||
"NumRows": numRows,
|
||||
"Versions": versions,
|
||||
"TotalTime": totalTime,
|
||||
"TotalTime": totalTimeString,
|
||||
"SocketType": RuntimeArgs.Socket,
|
||||
"NoEdit": !currentVersion,
|
||||
})
|
||||
@ -194,13 +198,16 @@ func renderMarkdown(c *gin.Context, currentText string, title string, versions [
|
||||
html2 = strings.Replace(html2, "&#91;", "[", -1)
|
||||
html2 = strings.Replace(html2, "&#93;", "]", -1)
|
||||
html2 = strings.Replace(html2, "&35;", "#", -1)
|
||||
|
||||
totalTimeString := totalTime.String()
|
||||
if totalTime.Seconds() < 1 {
|
||||
totalTimeString = "< 1 s"
|
||||
}
|
||||
c.HTML(http.StatusOK, "view.tmpl", gin.H{
|
||||
"Title": title,
|
||||
"WikiName": RuntimeArgs.WikiName,
|
||||
"Body": template.HTML([]byte(html2)),
|
||||
"Versions": versions,
|
||||
"TotalTime": totalTime.String(),
|
||||
"TotalTime": totalTimeString,
|
||||
"AdminKey": AdminKey,
|
||||
"Encrypted": encrypted,
|
||||
"Prompt": noprompt,
|
||||
|
Loading…
Reference in New Issue
Block a user