diff --git a/routes.go b/routes.go index d9118c4..9456278 100644 --- a/routes.go +++ b/routes.go @@ -29,10 +29,13 @@ func editNote(c *gin.Context) { if locked { c.Redirect(302, "/"+title+"/view") } else { + currentText := getCurrentText(title) + numRows := len(strings.Split(currentText, "\n")) + 10 c.HTML(http.StatusOK, "index.tmpl", gin.H{ "Title": title, "ExternalIP": RuntimeArgs.ExternalIP, - "CurrentText": getCurrentText(title), + "CurrentText": currentText, + "NumRows": numRows, }) } } diff --git a/templates/index.tmpl b/templates/index.tmpl index b3c0563..c1b07ba 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -73,7 +73,7 @@