diff --git a/history/history.go b/history/history.go index ec409c2..247b4c5 100644 --- a/history/history.go +++ b/history/history.go @@ -9,6 +9,7 @@ import ( "strings" "time" + "github.com/bouncepaw/mycorrhiza/user" "github.com/bouncepaw/mycorrhiza/util" ) @@ -76,11 +77,19 @@ func (rev Revision) HyphaeLinks() (html string) { } func (rev Revision) RecentChangesEntry() (html string) { + if user.AuthUsed && rev.Username != "anon" { + return fmt.Sprintf(` +
  • +
  • %[2]s
  • +
  • %[5]s
  • +
  • %[6]s by
  • +`, rev.TimeString(), rev.Hash, util.UserTree, rev.Username, rev.HyphaeLinks(), rev.Message) + } return fmt.Sprintf(` -
  • -
  • %s
  • -
  • %s
  • -
  • %s
  • +
  • +
  • %[2]s
  • +
  • %[3]s
  • +
  • %[4]s
  • `, rev.TimeString(), rev.Hash, rev.HyphaeLinks(), rev.Message) } diff --git a/history/information.go b/history/information.go index 164e3a9..bc65cac 100644 --- a/history/information.go +++ b/history/information.go @@ -15,7 +15,7 @@ func RecentChanges(n int) string { var ( out, err = gitsh( "log", "--oneline", "--no-merges", - "--pretty=format:\"%h\t%ce\t%ct\t%s\"", + "--pretty=format:\"%h\t%ae\t%at\t%s\"", "--max-count="+strconv.Itoa(n), ) revs []Revision diff --git a/metarrhiza b/metarrhiza index 8d595c9..41b572a 160000 --- a/metarrhiza +++ b/metarrhiza @@ -1 +1 @@ -Subproject commit 8d595c930664f271e58d3cfb3fa12c6feabfec3c +Subproject commit 41b572a78082e8eaa62a04937f95dad295039e8a diff --git a/templates/css.qtpl b/templates/css.qtpl index 04910ed..a989a91 100644 --- a/templates/css.qtpl +++ b/templates/css.qtpl @@ -46,4 +46,5 @@ nav ul li {list-style-type:none;margin-right:1rem;} .rc-entry__time { font-style: italic; } .rc-entry__hash { font-style: italic; text-align: right; } .rc-entry__links { grid-column: 1 / span 2; } +.rc-entry__author { font-style: italic; } {% endfunc %} diff --git a/templates/css.qtpl.go b/templates/css.qtpl.go index 586deec..5749ccc 100644 --- a/templates/css.qtpl.go +++ b/templates/css.qtpl.go @@ -68,32 +68,33 @@ nav ul li {list-style-type:none;margin-right:1rem;} .rc-entry__time { font-style: italic; } .rc-entry__hash { font-style: italic; text-align: right; } .rc-entry__links { grid-column: 1 / span 2; } +.rc-entry__author { font-style: italic; } `) -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 } -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 func WriteDefaultCSS(qq422016 qtio422016.Writer) { -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 StreamDefaultCSS(qw422016) -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 qt422016.ReleaseWriter(qw422016) -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 } -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 func DefaultCSS() string { -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 qb422016 := qt422016.AcquireByteBuffer() -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 WriteDefaultCSS(qb422016) -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 qs422016 := string(qb422016.B) -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 qt422016.ReleaseByteBuffer(qb422016) -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 return qs422016 -//line templates/css.qtpl:49 +//line templates/css.qtpl:50 } diff --git a/templates/http_readers.qtpl b/templates/http_readers.qtpl index 9ad0e37..a1cb2f3 100644 --- a/templates/http_readers.qtpl +++ b/templates/http_readers.qtpl @@ -47,10 +47,10 @@ If `contents` == "", a helpful message is shown instead. {% endif %}
    -{% if u := user.FromRequest(rq).OrAnon(); u.Group > user.UserAnon %} +{% if u := user.FromRequest(rq).OrAnon(); !user.AuthUsed || u.Group > user.UserAnon %}
    - +
    diff --git a/templates/http_readers.qtpl.go b/templates/http_readers.qtpl.go index bbf6364..3ffac47 100644 --- a/templates/http_readers.qtpl.go +++ b/templates/http_readers.qtpl.go @@ -189,7 +189,7 @@ func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navi
    `) //line templates/http_readers.qtpl:50 - if u := user.FromRequest(rq).OrAnon(); u.Group > user.UserAnon { + if u := user.FromRequest(rq).OrAnon(); !user.AuthUsed || u.Group > user.UserAnon { //line templates/http_readers.qtpl:50 qw422016.N().S(` - +