From 9d989db77dfd0e7f84a7ce234d107af8fba60dd7 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Mon, 9 Aug 2021 00:59:44 +0500 Subject: [PATCH] Do not show the edit button for anons --- views/readers.qtpl | 4 ++-- views/readers.qtpl.go | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/views/readers.qtpl b/views/readers.qtpl index 478992c..935ab3b 100644 --- a/views/readers.qtpl +++ b/views/readers.qtpl @@ -85,9 +85,9 @@ If `contents` == "", a helpful message is shown instead.
-
+ {% if u.CanProceed("edit") %} +
{% endif %} {%s= NaviTitleHTML(h) %} {% if h.Exists %} {%s= contents %} diff --git a/views/readers.qtpl.go b/views/readers.qtpl.go index bacbfa7..283b972 100644 --- a/views/readers.qtpl.go +++ b/views/readers.qtpl.go @@ -240,13 +240,21 @@ func StreamHyphaHTML(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hyph
-
+ `) +//line views/readers.qtpl:88 + if u.CanProceed("edit") { +//line views/readers.qtpl:88 + qw422016.N().S(` + qw422016.N().S(`">Edit text +
`) +//line views/readers.qtpl:90 + } +//line views/readers.qtpl:90 + qw422016.N().S(` `) //line views/readers.qtpl:91 qw422016.N().S(NaviTitleHTML(h))