{% import "fmt" %} {% import "net/http" %} {% import "time" %} {% import "github.com/bouncepaw/mycorrhiza/cfg" %} {% import "github.com/bouncepaw/mycorrhiza/util" %} {% import "github.com/bouncepaw/mycorrhiza/user" %} {% import "github.com/bouncepaw/mycorrhiza/hyphae" %} {% import "github.com/bouncepaw/mycorrhiza/history" %} {% func PrimitiveDiffHTML(rq *http.Request, h *hyphae.Hypha, u *user.User, hash string) %} {% code text, err := history.PrimitiveDiffAtRevision(h.TextPath, hash) if err != nil { text = err.Error() } %} {%= NavHTML(rq, h.Name, "history") %}

Diff {%s util.BeautifulName(h.Name) %} at {%s hash %}

{%s text %}
{% endfunc %} {% func RecentChangesHTML(n int) %}

Recent Changes

Subscribe via RSS, Atom or JSON feed.

{% comment %} Here I am, willing to add some accessibility using ARIA. Turns out, role="feed" is not supported in any screen reader as of September 2020. At least web search says so. Even JAWS doesn't support it! How come? I'll add the role anyway. -- bouncepaw {% endcomment %} {% code changes := history.RecentChanges(n) var year, day int var month time.Month %}
{% if len(changes) == 0 %}

Could not find any recent changes.

{% else %} {% for i, entry := range changes %} {% code y, m, d := entry.Time.UTC().Date() %} {% if d != day || m != month || y != year %}

{%s fmt.Sprintf("%04d-%02d-%02d", y, m, d) %}

{% code year, month, day = y, m, d %} {% endif %}
    {%s= recentChangesEntry(entry) %}
{% endfor %} {% endif %}
{% endfunc %} {% func recentChangesEntry(rev history.Revision) %}
  • {%s rev.Hash %}
  • {%s= rev.HyphaeLinksHTML() %}
  • {%s rev.Message %} {% if rev.Username != "anon" %}by {% endif %}
  • {% endfunc %} {% func HistoryHTML(rq *http.Request, hyphaName, list string) %} {%= NavHTML(rq, hyphaName, "history") %}

    History of {%s util.BeautifulName(hyphaName) %}

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