{% import "net/http" %} {% import "path" %} {% import "github.com/bouncepaw/mycorrhiza/hyphae" %} {% import "github.com/bouncepaw/mycorrhiza/user" %} {% import "github.com/bouncepaw/mycorrhiza/util" %} {% import "github.com/bouncepaw/mycorrhiza/tree" %} If `contents` == "", a helpful message is shown instead. {% func HyphaHTML(rq *http.Request, h *hyphae.Hypha, contents string) %} {% code relatives, subhyphae, prevHyphaName, nextHyphaName := tree.Tree(h.Name) %} {%= NavHTML(rq, h.Name, "page") %}
{%s= NaviTitleHTML(h) %} {% if contents == "" %}

This hypha has no text. Why not create it?

{% else %} {%s= contents %} {% endif %}
{% if prevHyphaName != "" %} {% endif %} {% if nextHyphaName != "" %} {% endif %}
{% if u := user.FromRequest(rq); !user.AuthUsed || u.Group != "anon" %}
{% if h.Exists && h.BinaryPath != "" %} Unattach current attachment? {% endif %}
{% endif %} {%= SubhyphaeHTML(subhyphae) %}
{%= RelativeHyphaeHTML(relatives) %} {%= BackLinksHTML(h) %}
{% endfunc %} {% func RevisionHTML(rq *http.Request, h *hyphae.Hypha, contents, revHash string) %} {% code relatives, subhyphae, _, _ := tree.Tree(h.Name) %} {%= NavHTML(rq, h.Name, "revision", revHash) %}

Please note that viewing binary parts of hyphae is not supported in history for now.

{%s= NaviTitleHTML(h) %} {%s= contents %}
{%= SubhyphaeHTML(subhyphae) %}
{%= RelativeHyphaeHTML(relatives) %}
{% endfunc %} {% func HistoryHTML(rq *http.Request, hyphaName, list string) %} {%= NavHTML(rq, hyphaName, "history") %}

History of {%s hyphaName %}

{%s= list %}
{% endfunc %}