From bbf55f539ffc33d4fd545b01995fd6d0187ea68b Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 23 Mar 2017 13:13:56 -0600 Subject: [PATCH] Use monospace when editing a file Files are determined if they have a period in the name. Former-commit-id: 8ae103ccf40f20a2c0a385021fad70caf614ca51 [formerly 23e44beb2ececa617280feb256a94900342cbdc4] [formerly 4872f2c5eaa25e32514c01aabd63355e6cb1d5d4 [formerly 518ee34f5615b9c9a6e3b5b68322df2c8a221ae8]] Former-commit-id: c646c3b38b5cf7d2552f9aac8d1802ef98e9170b [formerly 71bb4f2d64a0c87f9b881e612091ec98253721fa] Former-commit-id: a60d4c8180b584dea243391a7a41abc175524afb Former-commit-id: 5f42c319a2f8e2dc162b3b9660a29330bbc53f8a --- handlers.go | 4 ++-- templates/index.tmpl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/handlers.go b/handlers.go index e980bcf..ed79116 100755 --- a/handlers.go +++ b/handlers.go @@ -89,11 +89,10 @@ func handlePageRequest(c *gin.Context) { if !p.IsLocked && !p.IsEncrypted { p.Erase() c.Redirect(302, "/"+page+"/edit") - return } else { c.Redirect(302, "/"+page+"/view") - return } + return } rawText := p.Text.GetCurrent() rawHTML := p.RenderedPage @@ -146,6 +145,7 @@ func handlePageRequest(c *gin.Context) { "IsEncrypted": p.IsEncrypted, "ListItems": renderList(rawText), "Route": "/" + page + command, + "HasDotInName": strings.Contains(page, "."), }) } diff --git a/templates/index.tmpl b/templates/index.tmpl index cdc5d0b..2e126ff 100755 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -82,6 +82,7 @@ -moz-box-shadow: none; box-shadow: none; resize: none; + {{ if .HasDotInName }}font-family: "Lucida Console", Monaco, monospace{{ end }} }