diff options
-rw-r--r-- | pkg/service/git.go | 2 | ||||
-rw-r--r-- | templates/gitlist.qtpl | 11 | ||||
-rw-r--r-- | templates/gitlist.qtpl.go | 115 |
3 files changed, 74 insertions, 54 deletions
diff --git a/pkg/service/git.go b/pkg/service/git.go index 6c3912f..afe6103 100644 --- a/pkg/service/git.go +++ b/pkg/service/git.go @@ -16,6 +16,7 @@ type ( Repository struct { Name string Description string + Public bool LastCommitDate string Ref string } @@ -66,6 +67,7 @@ func (g *GitService) ListRepositories() ([]*Repository, error) { repos = append(repos, &Repository{ Name: r.Name, Description: r.Description, + Public: r.Public, LastCommitDate: obj.Author.When.Format(timeFormat), Ref: head.Name().Short(), }) diff --git a/templates/gitlist.qtpl b/templates/gitlist.qtpl index fa47008..fc047eb 100644 --- a/templates/gitlist.qtpl +++ b/templates/gitlist.qtpl @@ -18,9 +18,14 @@ type GitListPage struct { <div class="event-list"> {% for _, r := range p.Respositories %} <div class="event"> - <h4> - <a href="/{%s r.Name %}/">{%s r.Name %}</a> - </h4> + <div class="row"> + <div class="col-md"> + <a href="/{%s r.Name %}/">{%s r.Name %}</a> + </div> + <div class="col-md text-md-end"> + <small>{% if !r.Public %}private{% endif %}</small> + </div> + </div> </hr> <p>{%s r.Description %}</p> <p> diff --git a/templates/gitlist.qtpl.go b/templates/gitlist.qtpl.go index 601dbb2..07e5567 100644 --- a/templates/gitlist.qtpl.go +++ b/templates/gitlist.qtpl.go @@ -108,61 +108,74 @@ func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer, ctx context.Conte //line templates/gitlist.qtpl:19 qw422016.N().S(` <div class="event"> - <h4> - <a href="/`) -//line templates/gitlist.qtpl:22 + <div class="row"> + <div class="col-md"> + <a href="/`) +//line templates/gitlist.qtpl:23 qw422016.E().S(r.Name) -//line templates/gitlist.qtpl:22 +//line templates/gitlist.qtpl:23 qw422016.N().S(`/">`) -//line templates/gitlist.qtpl:22 +//line templates/gitlist.qtpl:23 qw422016.E().S(r.Name) -//line templates/gitlist.qtpl:22 +//line templates/gitlist.qtpl:23 qw422016.N().S(`</a> - </h4> + </div> + <div class="col-md text-md-end"> + <small>`) +//line templates/gitlist.qtpl:26 + if !r.Public { +//line templates/gitlist.qtpl:26 + qw422016.N().S(`private`) +//line templates/gitlist.qtpl:26 + } +//line templates/gitlist.qtpl:26 + qw422016.N().S(`</small> + </div> + </div> </hr> <p>`) -//line templates/gitlist.qtpl:25 +//line templates/gitlist.qtpl:30 qw422016.E().S(r.Description) -//line templates/gitlist.qtpl:25 +//line templates/gitlist.qtpl:30 qw422016.N().S(`</p> <p> <a href="/`) -//line templates/gitlist.qtpl:27 +//line templates/gitlist.qtpl:32 qw422016.E().S(r.Name) -//line templates/gitlist.qtpl:27 +//line templates/gitlist.qtpl:32 qw422016.N().S(`/log/`) -//line templates/gitlist.qtpl:27 +//line templates/gitlist.qtpl:32 qw422016.E().S(r.Ref) -//line templates/gitlist.qtpl:27 +//line templates/gitlist.qtpl:32 qw422016.N().S(`/">log</a> <a href="/`) -//line templates/gitlist.qtpl:28 +//line templates/gitlist.qtpl:33 qw422016.E().S(r.Name) -//line templates/gitlist.qtpl:28 +//line templates/gitlist.qtpl:33 qw422016.N().S(`/tree/`) -//line templates/gitlist.qtpl:28 +//line templates/gitlist.qtpl:33 qw422016.E().S(r.Ref) -//line templates/gitlist.qtpl:28 +//line templates/gitlist.qtpl:33 qw422016.N().S(`/">tree</a> <a href="/`) -//line templates/gitlist.qtpl:29 +//line templates/gitlist.qtpl:34 qw422016.E().S(r.Name) -//line templates/gitlist.qtpl:29 +//line templates/gitlist.qtpl:34 qw422016.N().S(`/refs/">refs</a> </p> </div> `) -//line templates/gitlist.qtpl:32 +//line templates/gitlist.qtpl:37 } -//line templates/gitlist.qtpl:32 +//line templates/gitlist.qtpl:37 qw422016.N().S(` </div> </div> <div id="about" class="col-md-4 order-first order-md-last"> `) -//line templates/gitlist.qtpl:36 +//line templates/gitlist.qtpl:41 qw422016.N().Z(p.About) -//line templates/gitlist.qtpl:36 +//line templates/gitlist.qtpl:41 qw422016.N().S(` <div class="alert alert-warning text-center" role="alert"> This project is under development, things may be broken or incomplete. @@ -170,65 +183,65 @@ func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer, ctx context.Conte </div> </div> `) -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 } -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 func (p *GitListPage) WriteContent(qq422016 qtio422016.Writer, ctx context.Context) { -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 p.StreamContent(qw422016, ctx) -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 qt422016.ReleaseWriter(qw422016) -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 } -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 func (p *GitListPage) Content(ctx context.Context) string { -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 qb422016 := qt422016.AcquireByteBuffer() -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 p.WriteContent(qb422016, ctx) -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 qs422016 := string(qb422016.B) -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 qt422016.ReleaseByteBuffer(qb422016) -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 return qs422016 -//line templates/gitlist.qtpl:42 +//line templates/gitlist.qtpl:47 } -//line templates/gitlist.qtpl:44 +//line templates/gitlist.qtpl:49 func (p *GitListPage) StreamScript(qw422016 *qt422016.Writer, ctx context.Context) { -//line templates/gitlist.qtpl:44 +//line templates/gitlist.qtpl:49 qw422016.N().S(` `) -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 } -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 func (p *GitListPage) WriteScript(qq422016 qtio422016.Writer, ctx context.Context) { -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 p.StreamScript(qw422016, ctx) -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 qt422016.ReleaseWriter(qw422016) -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 } -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 func (p *GitListPage) Script(ctx context.Context) string { -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 qb422016 := qt422016.AcquireByteBuffer() -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 p.WriteScript(qb422016, ctx) -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 qs422016 := string(qb422016.B) -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 qt422016.ReleaseByteBuffer(qb422016) -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 return qs422016 -//line templates/gitlist.qtpl:45 +//line templates/gitlist.qtpl:50 } |