1{% import "github.com/go-git/go-git/v5/plumbing" %}
2{% import "github.com/go-git/go-git/v5/plumbing/object" %}
3
4{% code
5type GitItemSummaryPage struct {
6 Tags []*plumbing.Reference
7 Branches []*plumbing.Reference
8 Commits []*object.Commit
9}
10%}
11
12{% func (g *GitItemSummaryPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Summary) %}{% endfunc %}
13
14{% func (g *GitItemSummaryPage) GitContent(name, ref string) %}
15<div class="row">
16 <div class="col-md-8">
17 {% if len(g.Tags) > 0 %}
18 <div class="event-list">
19 {% for _, t := range g.Tags %}
20 <div class="row event me-md-2">
21 <div class="col-4">
22 {%s t.Name().Short() %}
23 </div>
24 <div class="col-8">
25 <div class="float-end">
26 <a href="/{%s name %}/archive/{%s t.Name().Short() %}.tar.gz">tar.gz</a>
27 <a href="/{%s name %}/tree/{%s t.Name().Short() %}/">tree</a>
28 <a href="/{%s name %}/log/{%s t.Name().Short() %}/">log</a>
29 </div>
30 </div>
31 </div>
32 {% endfor %}
33 </div>
34 {% else %}
35 <p> No tags </p>
36 {% endif %}
37 </div>
38 <div class="col-md-4">
39 <div class="event-list">
40 {% for _, b := range g.Branches %}
41 <div class="row event">
42 <div class="col-4">
43 {%s b.Name().Short() %}
44 </div>
45 <div class="col-8">
46 <div class="float-end">
47 <a href="/{%s name %}/tree/{%s b.Name().Short() %}/">tree</a>
48 <a href="/{%s name %}/log/{%s b.Name().Short() %}/">log</a>
49 </div>
50 </div>
51 </div>
52 {% endfor %}
53 </div>
54 </div>
55</div>
56<div class="row">
57 <div class="event-list">
58 {% for _, c := range g.Commits %}
59 <div class="row event">
60 <div class="col-xxl-2">
61 {%s TimeFormat(c.Committer.When) %}
62 </div>
63 <div class="col-xxl-7 code-view">
64 <pre>{%s c.Message %}</pre>
65 </div>
66 <div class="col-xxl-3">
67 <small>{%s c.Committer.Name %} <{%s c.Committer.Email %}></small>
68 </div>
69 </div>
70 {% endfor %}
71 </div>
72</div>
73{% endfunc %}