diff options
Diffstat (limited to 'templates/gititemsummary.qtpl')
-rw-r--r-- | templates/gititemsummary.qtpl | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/templates/gititemsummary.qtpl b/templates/gititemsummary.qtpl index 4cbf324..9a3e2ee 100644 --- a/templates/gititemsummary.qtpl +++ b/templates/gititemsummary.qtpl @@ -1,10 +1,72 @@ +{% import "github.com/go-git/go-git/v5/plumbing" %} +{% import "github.com/go-git/go-git/v5/plumbing/object" %} + {% code type GitItemSummaryPage struct { + Tags []*plumbing.Reference + Branches []*plumbing.Reference + Commits []*object.Commit } %} {% func (g *GitItemSummaryPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Summary) %}{% endfunc %} {% func (g *GitItemSummaryPage) GitContent(name, ref string) %} -<h4>Summary</h4> +<div class="row"> + <div class="col-md-8"> + {% if len(g.Tags) > 0 %} + <div class="event-list"> + {% for _, t := range g.Tags %} + <div class="row event me-md-2"> + <div class="col-4"> + {%s t.Name().Short() %} + </div> + <div class="col-8"> + <div class="float-end"> + <a href="/{%s name %}/tree/{%s t.Name().Short() %}">tree</a> + <a href="/{%s name %}/log/{%s t.Name().Short() %}">log</a> + </div> + </div> + </div> + {% endfor %} + </div> + {% else %} + <p> No tags </p> + {% endif %} + </div> + <div class="col-md-4"> + <div class="event-list"> + {% for _, b := range g.Branches %} + <div class="row event"> + <div class="col-4"> + {%s b.Name().Short() %} + </div> + <div class="col-8"> + <div class="float-end"> + <a href="/{%s name %}/tree/{%s b.Name().Short() %}">tree</a> + <a href="/{%s name %}/log/{%s b.Name().Short() %}">log</a> + </div> + </div> + </div> + {% endfor %} + </div> + </div> +</div> +<div class="row"> + <div class="event-list"> + {% for _, c := range g.Commits %} + <div class="row event"> + <div class="col-xxl-2"> + {%s TimeFormat(c.Committer.When) %} + </div> + <div class="col-xxl-7 code-view"> + <pre>{%s c.Message %}</pre> + </div> + <div class="col-xxl-3"> + <small>{%s c.Committer.Name %} <{%s c.Committer.Email %}></small> + </div> + </div> + {% endfor %} + </div> +</div> {% endfunc %} |