1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-07 18:30:26 +00:00

Always show "Manage attachment", fix Firefox bug

This commit is contained in:
handlerug 2021-08-11 16:20:29 +07:00
parent e660d2f1dd
commit 19019a0d13
6 changed files with 26 additions and 31 deletions

View File

@ -786,20 +786,16 @@ kbd {
display: inline; display: inline;
} }
.hypha-info__link { .hypha-info__link {
display: inline-block;
color: #999; color: #999;
} }
.hypha-info__link:hover { .hypha-info__link:hover {
color: inherit; color: inherit;
} }
.hypha-info__link:after { .hypha-info__entry + .hypha-info__entry {
text-transform: lowercase;
}
.hypha-info__entry:not(:last-child) a::after {
content: ", "; content: ", ";
text-decoration: none;
display: inline-block; display: inline-block;
text-decoration: none;
} }
.hypha-info__entry:last-of-type a:after {
content: none;
}
.hypha-info__entry:first-of-type a:first-letter {
text-transform: uppercase;
}

View File

@ -17,11 +17,11 @@
%} %}
<nav class="hypha-info"> <nav class="hypha-info">
<ul class="hypha-info__list"> <ul class="hypha-info__list">
{% if h.HasAttachment() %}{%= hyphaInfoEntry(h, u, "attachment", "manage the attachment") %}{% endif %} {%= hyphaInfoEntry(h, u, "history", "View history") %}
{%= hyphaInfoEntry(h, u, "history", "view history") %} {%= hyphaInfoEntry(h, u, "rename-ask", "Rename") %}
{%= hyphaInfoEntry(h, u, "rename-ask", "rename") %} {%= hyphaInfoEntry(h, u, "delete-ask", "Delete") %}
{%= hyphaInfoEntry(h, u, "delete-ask", "delete") %} {%= hyphaInfoEntry(h, u, "text", "View markup") %}
{%= hyphaInfoEntry(h, u, "text", "view markup") %} {%= hyphaInfoEntry(h, u, "attachment", "Manage attachment") %}
</ul> </ul>
</nav> </nav>
{% endfunc %} {% endfunc %}

View File

@ -106,31 +106,27 @@ func streamhyphaInfo(qw422016 *qt422016.Writer, rq *http.Request, h *hyphae.Hyph
<ul class="hypha-info__list"> <ul class="hypha-info__list">
`) `)
//line views/nav.qtpl:20 //line views/nav.qtpl:20
if h.HasAttachment() { streamhyphaInfoEntry(qw422016, h, u, "history", "View history")
//line views/nav.qtpl:20
streamhyphaInfoEntry(qw422016, h, u, "attachment", "manage the attachment")
//line views/nav.qtpl:20
}
//line views/nav.qtpl:20 //line views/nav.qtpl:20
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/nav.qtpl:21 //line views/nav.qtpl:21
streamhyphaInfoEntry(qw422016, h, u, "history", "view history") streamhyphaInfoEntry(qw422016, h, u, "rename-ask", "Rename")
//line views/nav.qtpl:21 //line views/nav.qtpl:21
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/nav.qtpl:22 //line views/nav.qtpl:22
streamhyphaInfoEntry(qw422016, h, u, "rename-ask", "rename") streamhyphaInfoEntry(qw422016, h, u, "delete-ask", "Delete")
//line views/nav.qtpl:22 //line views/nav.qtpl:22
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/nav.qtpl:23 //line views/nav.qtpl:23
streamhyphaInfoEntry(qw422016, h, u, "delete-ask", "delete") streamhyphaInfoEntry(qw422016, h, u, "text", "View markup")
//line views/nav.qtpl:23 //line views/nav.qtpl:23
qw422016.N().S(` qw422016.N().S(`
`) `)
//line views/nav.qtpl:24 //line views/nav.qtpl:24
streamhyphaInfoEntry(qw422016, h, u, "text", "view markup") streamhyphaInfoEntry(qw422016, h, u, "attachment", "Manage attachment")
//line views/nav.qtpl:24 //line views/nav.qtpl:24
qw422016.N().S(` qw422016.N().S(`
</ul> </ul>

View File

@ -39,8 +39,10 @@ func handlerHistory(w http.ResponseWriter, rq *http.Request) {
} }
log.Println("Found", len(revs), "revisions for", hyphaName) log.Println("Found", len(revs), "revisions for", hyphaName)
util.HTTP200Page(w, util.HTTP200Page(w, views.BaseHTML(
views.BaseHTML(hyphaName, views.HistoryHTML(rq, hyphaName, list), user.FromRequest(rq))) fmt.Sprintf("History of \"%s\"", util.BeautifulName(hyphaName)),
views.HistoryHTML(rq, hyphaName, list),
user.FromRequest(rq)))
} }
// handlerRecentChanges displays the /recent-changes/ page. // handlerRecentChanges displays the /recent-changes/ page.

View File

@ -2,11 +2,12 @@ package web
import ( import (
"fmt" "fmt"
"github.com/bouncepaw/mycomarkup"
"github.com/bouncepaw/mycomarkup/mycocontext"
"log" "log"
"net/http" "net/http"
"github.com/bouncepaw/mycomarkup"
"github.com/bouncepaw/mycomarkup/mycocontext"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/bouncepaw/mycorrhiza/history" "github.com/bouncepaw/mycorrhiza/history"
@ -162,7 +163,7 @@ func handlerEdit(w http.ResponseWriter, rq *http.Request) {
util.HTTP200Page( util.HTTP200Page(
w, w,
views.BaseHTML( views.BaseHTML(
"Edit "+hyphaName, fmt.Sprintf("Edit \"%s\"", util.BeautifulName(hyphaName)),
views.EditHTML(rq, hyphaName, textAreaFill, warning), views.EditHTML(rq, hyphaName, textAreaFill, warning),
u)) u))
} }
@ -197,7 +198,7 @@ func handlerUploadText(w http.ResponseWriter, rq *http.Request) {
util.HTTP200Page( util.HTTP200Page(
w, w,
views.BaseHTML( views.BaseHTML(
"Preview "+hyphaName, fmt.Sprintf("Preview of \"%s\"", util.BeautifulName(hyphaName)),
views.PreviewHTML( views.PreviewHTML(
rq, rq,
hyphaName, hyphaName,

View File

@ -41,7 +41,7 @@ func handlerAttachment(w http.ResponseWriter, rq *http.Request) {
) )
util.HTTP200Page(w, util.HTTP200Page(w,
views.BaseHTML( views.BaseHTML(
fmt.Sprintf("Attachment of %s", util.BeautifulName(hyphaName)), fmt.Sprintf("Attachment of \"%s\"", util.BeautifulName(hyphaName)),
views.AttachmentMenuHTML(rq, h, u), views.AttachmentMenuHTML(rq, h, u),
u)) u))
} }
@ -58,7 +58,7 @@ func handlerPrimitiveDiff(w http.ResponseWriter, rq *http.Request) {
) )
util.HTTP200Page(w, util.HTTP200Page(w,
views.BaseHTML( views.BaseHTML(
fmt.Sprintf("Diff of %s at %s", hyphaName, revHash), fmt.Sprintf("Diff of \"%s\" at %s", util.BeautifulName(hyphaName), revHash),
views.PrimitiveDiffHTML(rq, h, u, revHash), views.PrimitiveDiffHTML(rq, h, u, revHash),
u)) u))
} }