diff --git a/Makefile b/Makefile
index 53b076749dac0fd0399fed31a3857ea3c338db01..8f6d462fa6a51fdf81da416dae3f1807c54019c5 100644
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,11 @@
test:
go test -v --tags=unit ./...
+# this is meant for "prod" build
sass-slug:
mkdir -p static
sassc \
+ --style compressed \
-I scss scss/main.scss static/main.$(COMMIT).css
sass:
diff --git a/pkg/handler/git/handler.go b/pkg/handler/git/handler.go
index 28cc99e1ffe8564b7d63b31a3452134a51dc33aa..7bdf3729016402aa7f8f1e462d9b34c209109835 100644
--- a/pkg/handler/git/handler.go
+++ b/pkg/handler/git/handler.go
@@ -2,8 +2,10 @@ package git
import (
"bytes"
+ "io"
"log/slog"
"net/http"
+ "os"
"path/filepath"
"git.gabrielgio.me/cerrado/pkg/ext"
@@ -15,11 +17,15 @@ "github.com/alecthomas/chroma/v2/lexers"
"github.com/alecthomas/chroma/v2/styles"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
+ "github.com/gomarkdown/markdown"
+ markdownhtml "github.com/gomarkdown/markdown/html"
+ "github.com/gomarkdown/markdown/parser"
)
type (
GitHandler struct {
gitService gitService
+ readmePath string
}
gitService interface {
@@ -30,12 +36,17 @@ GetTree(name, ref, path string) (*object.Tree, error)
GetFileContent(name, ref, path string) (string, error)
ListTags(name string) ([]*object.Tag, error)
ListBranches(name string) ([]*plumbing.Reference, error)
+ }
+
+ configurationRepository interface {
+ GetRootReadme() string
}
)
-func NewGitHandler(gitService gitService) *GitHandler {
+func NewGitHandler(gitService gitService, confRepo configurationRepository) *GitHandler {
return &GitHandler{
gitService: gitService,
+ readmePath: confRepo.GetRootReadme(),
}
}
@@ -46,7 +57,32 @@ slog.Error("Error listing repo", "error", err)
return
}
- gitList := &templates.GitListPage{repos}
+ f, err := os.Open(g.readmePath)
+ if err != nil {
+ slog.Error("Error loading readme file", "error", err)
+ return
+ }
+
+ bs, err := io.ReadAll(f)
+ if err != nil {
+ slog.Error("Error reading readme file bytes", "error", err)
+ return
+ }
+
+ extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
+ p := parser.NewWithExtensions(extensions)
+ doc := p.Parse(bs)
+
+ htmlFlag := markdownhtml.CommonFlags | markdownhtml.HrefTargetBlank
+ opts := markdownhtml.RendererOptions{Flags: htmlFlag}
+ renderer := markdownhtml.NewRenderer(opts)
+
+ bs = markdown.Render(doc, renderer)
+
+ gitList := &templates.GitListPage{
+ Respositories: repos,
+ About: bs,
+ }
templates.WritePageTemplate(w, gitList)
}
diff --git a/pkg/handler/router.go b/pkg/handler/router.go
index de5117c9e0a6b8836117e40c1b237bdb1afa6346..bf13ad5f8821c8fa48e6c932afddacd8e2f964f6 100644
--- a/pkg/handler/router.go
+++ b/pkg/handler/router.go
@@ -20,7 +20,7 @@ gitService *service.GitService,
configRepo *serverconfig.ConfigurationRepository,
) (http.Handler, error) {
var (
- gitHandler = git.NewGitHandler(gitService)
+ gitHandler = git.NewGitHandler(gitService, configRepo)
aboutHandler = about.NewAboutHandler(configRepo)
configHander = config.ConfigFile(configRepo)
)
diff --git a/pkg/service/git.go b/pkg/service/git.go
index f8867850cd8a76933da262156fdbac70134a27ff..31a1cbb47d7c74f552ce0ff097735481613a1aac 100644
--- a/pkg/service/git.go
+++ b/pkg/service/git.go
@@ -1,21 +1,24 @@
package service
import (
+ "log/slog"
+ "os"
"path"
"git.gabrielgio.me/cerrado/pkg/config"
"git.gabrielgio.me/cerrado/pkg/git"
+ "git.gabrielgio.me/cerrado/pkg/u"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
)
type (
Repository struct {
- Name string
- Title string
- LastCommitMessage string
- LastCommitDate string
- Ref string
+ Name string
+ Title string
+ Description string
+ LastCommitDate string
+ Ref string
}
GitService struct {
@@ -46,9 +49,6 @@ repo, err := git.OpenRepository(r.Path)
if err != nil {
return nil, err
}
- if err != nil {
- return nil, err
- }
obj, err := repo.LastCommit()
if err != nil {
@@ -60,13 +60,23 @@ if err != nil {
return nil, err
}
+ d := path.Join(r.Path, "description")
+ description := ""
+ if u.FileExist(d) {
+ if b, err := os.ReadFile(d); err == nil {
+ description = string(b)
+ } else {
+ slog.Error("Error loading description file", "err", err)
+ }
+ }
+
baseName := path.Base(r.Path)
repos[i] = &Repository{
- Name: baseName,
- Title: baseName,
- LastCommitMessage: obj.Message,
- LastCommitDate: obj.Author.When.Format(timeFormat),
- Ref: head.Name().Short(),
+ Name: baseName,
+ Title: baseName,
+ Description: description,
+ LastCommitDate: obj.Author.When.Format(timeFormat),
+ Ref: head.Name().Short(),
}
}
diff --git a/scss/main.scss b/scss/main.scss
index bb7d7f08ab56d7d605e119b1a4bf85817ed8a76f..b3ba6498c55ad5e4cc20a568fc62b9bb8000a829 100644
--- a/scss/main.scss
+++ b/scss/main.scss
@@ -19,8 +19,31 @@ @import "bootstrap/scss/_containers.scss";
@import "bootstrap/scss/_nav.scss";
@import "bootstrap/scss/_navbar.scss";
@import "bootstrap/scss/_grid.scss";
+@import "tree.scss";
+
+// overwrite to reduce the ammount of css generated by loading all utilities
+$utilities: (
+ "order": (
+ responsive: true,
+ property: order,
+ values: (
+ first: -1,
+ 0: 0,
+ 1: 1,
+ 2: 2,
+ 3: 3,
+ 4: 4,
+ 5: 5,
+ last: 6,
+ ),
+ ),
+);
+
+@import "bootstrap/scss/utilities/_api.scss";
body {
+ // prevents wierd font resizing on overflow
+ -webkit-text-size-adjust: 100%;
font-family: $font-family-monospace;
font-size: $base-font-size;
margin: 0;
@@ -63,23 +86,27 @@ overflow-x: auto;
}
.logs {
- >div:nth-child(odd) {
+ >div {
background: #f8f9fa;
}
>div {
- padding: 10px;
+ padding: 5px;
+ margin: $spacer;
+ }
+
+ @include media-breakpoint-down(md) {
+ >div {
+ margin: $spacer 0 $spacer 0;
+ }
}
pre {
- white-space: break-spaces;
+ font-size: $base-font-size;
margin: 0;
}
}
-.logs pre::first-line {
- font-weight: bold;
-}
.logs>div>div:first-child {
margin-bottom: 15px;
}
@@ -87,3 +114,14 @@ .logs>div>div:last-child {
margin-top: 15px;
}
+#about {
+ padding: 0 $spacer $spacer $spacer;
+ > p:first-child {
+ margin-top: 0
+ }
+
+ @include media-breakpoint-down(md) {
+ padding: $spacer;
+ max-width: calc(100% - calc(2 * #{$spacer}));
+ }
+}
diff --git a/scss/tree.scss b/scss/tree.scss
new file mode 100644
index 0000000000000000000000000000000000000000..bbca16231973265e12f95b9b1d97274288bdce1d
--- /dev/null
+++ b/scss/tree.scss
@@ -0,0 +1,59 @@
+// TODO: refer to sourcehut code AGPL
+.tree-list {
+ display: grid;
+ // mode name
+ grid-template-columns: auto 1fr fit-content(40em) auto auto;
+ font-family: $font-family-monospace;
+
+ svg {
+ color: #777;
+ }
+
+ .size {
+ text-align: right;
+ }
+
+ .name.blob a {
+ color: $gray-900;
+ }
+
+ .mode, .commit, .commit a, .date, .size {
+ color: $gray-700;
+ }
+
+ .name.blob {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ }
+
+ .commit {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ }
+
+ & > div {
+ padding: 0.1rem 0.5rem;
+ background: transparent;
+
+ &.id {
+ text-align: right;
+ }
+
+ &.comments {
+ text-align: center;
+ }
+
+ @for $i from 1 through 5 {
+ &:nth-child(5n+#{$i}) {
+ grid-column-start: $i;
+ }
+
+ // Striped rows
+ &:nth-child(10n+#{$i}) {
+ background: rgba(0,0,0,.05);
+ }
+ }
+ }
+}
diff --git a/templates/base.qtpl b/templates/base.qtpl
index 497aa6d59d5fa49671e8ad4da524712bf62c40e8..9b0c4f57081d1861c77a7a75a4b25cafef57b6f4 100644
--- a/templates/base.qtpl
+++ b/templates/base.qtpl
@@ -26,7 +26,7 @@ }
%}
{% code func TimeFormat(t time.Time) string {
- return t.Format("2006-01-02")
+ return t.Format("02.01.2006")
}
%}
diff --git a/templates/base.qtpl.go b/templates/base.qtpl.go
index 5f39e8dd4040b5dbe896fc5c44dc5b423636f9eb..d2bcc7369a0587ee3edf2f641a333666d598e33e 100644
--- a/templates/base.qtpl.go
+++ b/templates/base.qtpl.go
@@ -68,7 +68,7 @@ }
//line base.qtpl:28
func TimeFormat(t time.Time) string {
- return t.Format("2006-01-02")
+ return t.Format("02.01.2006")
}
//line base.qtpl:33
diff --git a/templates/gititemlog.qtpl b/templates/gititemlog.qtpl
index e037c52718fa440432f3e361b61625729fed8edb..ef473b73835002fc162ae4c115d4f4967c9f4d32 100644
--- a/templates/gititemlog.qtpl
+++ b/templates/gititemlog.qtpl
@@ -15,11 +15,11 @@ <div class="row">
<div class="col-xxl-2">
{%s TimeFormat(c.Committer.When) %}
</div>
- <div class="col-xxl-7">
+ <div class="col-xxl-7 code-view">
<pre>{%s c.Message %}</pre>
</div>
<div class="col-xxl-3">
- <small>{%s c.Committer.Name %}</small>
+ <small>{%s c.Committer.Name %} <{%s c.Committer.Email %}></small>
</div>
</div>
{% endfor %}
diff --git a/templates/gititemlog.qtpl.go b/templates/gititemlog.qtpl.go
index 47e700d343dbf7be77ef68410f4d907ba0bd29fc..e3bac4102910c7b96b8da4235d43ac530b02726a 100644
--- a/templates/gititemlog.qtpl.go
+++ b/templates/gititemlog.qtpl.go
@@ -76,7 +76,7 @@ qw422016.E().S(TimeFormat(c.Committer.When))
//line gititemlog.qtpl:16
qw422016.N().S(`
</div>
- <div class="col-xxl-7">
+ <div class="col-xxl-7 code-view">
<pre>`)
//line gititemlog.qtpl:19
qw422016.E().S(c.Message)
@@ -88,7 +88,11 @@ <small>`)
//line gititemlog.qtpl:22
qw422016.E().S(c.Committer.Name)
//line gititemlog.qtpl:22
- qw422016.N().S(`</small>
+ qw422016.N().S(` <`)
+//line gititemlog.qtpl:22
+ qw422016.E().S(c.Committer.Email)
+//line gititemlog.qtpl:22
+ qw422016.N().S(`></small>
</div>
</div>
`)
diff --git a/templates/gititemtree.qtpl b/templates/gititemtree.qtpl
index be7a27de050be204b7d90bac4fcffe073c44a921..68b98566d92fb065d6413d1236d0ee0deb6401cb 100644
--- a/templates/gititemtree.qtpl
+++ b/templates/gititemtree.qtpl
@@ -14,15 +14,21 @@
{% func (g *GitItemTreePage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %}
{% func (g *GitItemTreePage) GitContent() %}
-{% for _, e := range g.Tree.Entries %}
<div class="row">
- <div class="col">{%s Ignore(e.Mode.ToOSFileMode()).String() %}</div>
- {% if e.Mode.IsFile() %}
- <div class="col-md"><a href="/{%s g.Name %}/blob/{%s g.Ref%}/{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
- {% else %}
- <div class="col-md"><a href="./{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
- {% endif %}
- <div class="col-md">{%dl Ignore(g.Tree.Size(e.Name))%} KiB</div>
+ <div class="col-md-12">
+ <div class="tree-list">
+ {% for _, e := range g.Tree.Entries %}
+ <div class="mode">{%s Ignore(e.Mode.ToOSFileMode()).String() %}</div>
+ {% if e.Mode.IsFile() %}
+ <div class="name blob"><a href="/{%s g.Name %}/blob/{%s g.Ref%}/{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
+ {% else %}
+ <div class="name tree"><a href="./{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
+ {% endif %}
+ <div class="commit"></div>
+ <div class="date"></div>
+ <div class="size">{%dl Ignore(g.Tree.Size(e.Name))%} KiB</div>
+ {% endfor %}
+ </div>
+ </div>
</div>
-{% endfor %}
{% endfunc %}
diff --git a/templates/gititemtree.qtpl.go b/templates/gititemtree.qtpl.go
index cdc374fef67dd51aedbd48aad507ea3ff515e48f..546cb13e1253fa4c9183c0b804b35d0b12e2ac0f 100644
--- a/templates/gititemtree.qtpl.go
+++ b/templates/gititemtree.qtpl.go
@@ -67,103 +67,109 @@ //line gititemtree.qtpl:16
func (g *GitItemTreePage) StreamGitContent(qw422016 *qt422016.Writer) {
//line gititemtree.qtpl:16
qw422016.N().S(`
-`)
-//line gititemtree.qtpl:17
+<div class="row">
+ <div class="col-md-12">
+ <div class="tree-list">
+ `)
+//line gititemtree.qtpl:20
for _, e := range g.Tree.Entries {
-//line gititemtree.qtpl:17
+//line gititemtree.qtpl:20
qw422016.N().S(`
-<div class="row">
- <div class="col">`)
-//line gititemtree.qtpl:19
+ <div class="mode">`)
+//line gititemtree.qtpl:21
qw422016.E().S(Ignore(e.Mode.ToOSFileMode()).String())
-//line gititemtree.qtpl:19
+//line gititemtree.qtpl:21
qw422016.N().S(`</div>
- `)
-//line gititemtree.qtpl:20
+ `)
+//line gititemtree.qtpl:22
if e.Mode.IsFile() {
-//line gititemtree.qtpl:20
+//line gititemtree.qtpl:22
qw422016.N().S(`
- <div class="col-md"><a href="/`)
-//line gititemtree.qtpl:21
+ <div class="name blob"><a href="/`)
+//line gititemtree.qtpl:23
qw422016.E().S(g.Name)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.N().S(`/blob/`)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.E().S(g.Ref)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.N().S(`/`)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.E().S(g.CurrentPath)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.N().S(`/`)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.E().S(e.Name)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.N().S(`">`)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.E().S(e.Name)
-//line gititemtree.qtpl:21
+//line gititemtree.qtpl:23
qw422016.N().S(`</a></div>
- `)
-//line gititemtree.qtpl:22
+ `)
+//line gititemtree.qtpl:24
} else {
-//line gititemtree.qtpl:22
+//line gititemtree.qtpl:24
qw422016.N().S(`
- <div class="col-md"><a href="./`)
-//line gititemtree.qtpl:23
+ <div class="name tree"><a href="./`)
+//line gititemtree.qtpl:25
qw422016.E().S(g.CurrentPath)
-//line gititemtree.qtpl:23
+//line gititemtree.qtpl:25
qw422016.N().S(`/`)
-//line gititemtree.qtpl:23
+//line gititemtree.qtpl:25
qw422016.E().S(e.Name)
-//line gititemtree.qtpl:23
+//line gititemtree.qtpl:25
qw422016.N().S(`">`)
-//line gititemtree.qtpl:23
+//line gititemtree.qtpl:25
qw422016.E().S(e.Name)
-//line gititemtree.qtpl:23
+//line gititemtree.qtpl:25
qw422016.N().S(`</a></div>
- `)
-//line gititemtree.qtpl:24
+ `)
+//line gititemtree.qtpl:26
}
-//line gititemtree.qtpl:24
+//line gititemtree.qtpl:26
qw422016.N().S(`
- <div class="col-md">`)
-//line gititemtree.qtpl:25
+ <div class="commit"></div>
+ <div class="date"></div>
+ <div class="size">`)
+//line gititemtree.qtpl:29
qw422016.N().DL(Ignore(g.Tree.Size(e.Name)))
-//line gititemtree.qtpl:25
+//line gititemtree.qtpl:29
qw422016.N().S(` KiB</div>
-</div>
-`)
-//line gititemtree.qtpl:27
+ `)
+//line gititemtree.qtpl:30
}
-//line gititemtree.qtpl:27
+//line gititemtree.qtpl:30
qw422016.N().S(`
+ </div>
+ </div>
+</div>
`)
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
}
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
func (g *GitItemTreePage) WriteGitContent(qq422016 qtio422016.Writer) {
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
qw422016 := qt422016.AcquireWriter(qq422016)
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
g.StreamGitContent(qw422016)
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
qt422016.ReleaseWriter(qw422016)
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
}
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
func (g *GitItemTreePage) GitContent() string {
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
qb422016 := qt422016.AcquireByteBuffer()
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
g.WriteGitContent(qb422016)
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
qs422016 := string(qb422016.B)
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
qt422016.ReleaseByteBuffer(qb422016)
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
return qs422016
-//line gititemtree.qtpl:28
+//line gititemtree.qtpl:34
}
diff --git a/templates/gitlist.qtpl b/templates/gitlist.qtpl
index 3d7ef822b9bae8b6debebe51796799f2417513ed..937ba224e5709efc8c22623cf9b382ada77c2ba9 100644
--- a/templates/gitlist.qtpl
+++ b/templates/gitlist.qtpl
@@ -3,6 +3,7 @@
{% code
type GitListPage struct {
Respositories []*service.Repository
+ About []byte
}
%}
@@ -12,7 +13,7 @@ {% func (p *GitListPage) Navbar() %}{%= Navbar(Git) %}{% endfunc %}
{% func (p *GitListPage) Content() %}
<div class="row">
- <div class="col-md-8 offset-md-2">
+ <div class="col-md-6 order-last order-md-first">
<div class="event-list">
{% for _, r := range p.Respositories %}
<div class="event">
@@ -20,8 +21,7 @@ <h4>
<a href="/{%s r.Name %}">{%s r.Name %}</a>
</h4>
</hr>
- <p>{%s r.LastCommitMessage %}</p>
- <p><small>{%s r.LastCommitDate %}</small></p>
+ <p>{%s r.Description %}</p>
<p>
<a href="/{%s r.Name %}/log/{%s r.Ref %}">log</a>
<a href="/{%s r.Name %}/tree/{%s r.Ref %}">tree</a>
@@ -30,9 +30,12 @@ </p>
</div>
{% endfor %}
</div>
- {% endfunc %}
+ </div>
+ <div id="about" class="col-md-4 order-first order-md-last">
+ {%z= p.About %}
</div>
</div>
+{% endfunc %}
{% func (p *GitListPage) Script() %}
{% endfunc %}
diff --git a/templates/gitlist.qtpl.go b/templates/gitlist.qtpl.go
index d9f7ec1ec45568e18d549fa56015753b5511221a..435626eee0d43f1f780dcae81de5fea21a7f8017 100644
--- a/templates/gitlist.qtpl.go
+++ b/templates/gitlist.qtpl.go
@@ -23,109 +23,105 @@
//line gitlist.qtpl:4
type GitListPage struct {
Respositories []*service.Repository
+ About []byte
}
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
func (p *GitListPage) StreamTitle(qw422016 *qt422016.Writer) {
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
qw422016.N().S(`Git | List`)
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
}
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
func (p *GitListPage) WriteTitle(qq422016 qtio422016.Writer) {
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
qw422016 := qt422016.AcquireWriter(qq422016)
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
p.StreamTitle(qw422016)
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
qt422016.ReleaseWriter(qw422016)
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
}
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
func (p *GitListPage) Title() string {
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
qb422016 := qt422016.AcquireByteBuffer()
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
p.WriteTitle(qb422016)
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
qs422016 := string(qb422016.B)
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
qt422016.ReleaseByteBuffer(qb422016)
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
return qs422016
-//line gitlist.qtpl:9
+//line gitlist.qtpl:10
}
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
func (p *GitListPage) StreamNavbar(qw422016 *qt422016.Writer) {
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
StreamNavbar(qw422016, Git)
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
}
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
func (p *GitListPage) WriteNavbar(qq422016 qtio422016.Writer) {
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
qw422016 := qt422016.AcquireWriter(qq422016)
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
p.StreamNavbar(qw422016)
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
qt422016.ReleaseWriter(qw422016)
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
}
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
func (p *GitListPage) Navbar() string {
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
qb422016 := qt422016.AcquireByteBuffer()
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
p.WriteNavbar(qb422016)
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
qs422016 := string(qb422016.B)
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
qt422016.ReleaseByteBuffer(qb422016)
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
return qs422016
-//line gitlist.qtpl:11
+//line gitlist.qtpl:12
}
-//line gitlist.qtpl:13
+//line gitlist.qtpl:14
func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer) {
-//line gitlist.qtpl:13
+//line gitlist.qtpl:14
qw422016.N().S(`
<div class="row">
- <div class="col-md-8 offset-md-2">
+ <div class="col-md-6 order-last order-md-first">
<div class="event-list">
`)
-//line gitlist.qtpl:17
+//line gitlist.qtpl:18
for _, r := range p.Respositories {
-//line gitlist.qtpl:17
+//line gitlist.qtpl:18
qw422016.N().S(`
<div class="event">
<h4>
<a href="/`)
-//line gitlist.qtpl:20
+//line gitlist.qtpl:21
qw422016.E().S(r.Name)
-//line gitlist.qtpl:20
+//line gitlist.qtpl:21
qw422016.N().S(`">`)
-//line gitlist.qtpl:20
+//line gitlist.qtpl:21
qw422016.E().S(r.Name)
-//line gitlist.qtpl:20
+//line gitlist.qtpl:21
qw422016.N().S(`</a>
</h4>
</hr>
<p>`)
-//line gitlist.qtpl:23
- qw422016.E().S(r.LastCommitMessage)
-//line gitlist.qtpl:23
- qw422016.N().S(`</p>
- <p><small>`)
//line gitlist.qtpl:24
- qw422016.E().S(r.LastCommitDate)
+ qw422016.E().S(r.Description)
//line gitlist.qtpl:24
- qw422016.N().S(`</small></p>
+ qw422016.N().S(`</p>
<p>
<a href="/`)
//line gitlist.qtpl:26
@@ -158,70 +154,75 @@ }
//line gitlist.qtpl:31
qw422016.N().S(`
</div>
- `)
-//line gitlist.qtpl:33
+ </div>
+ <div id="about" class="col-md-4 order-first order-md-last">
+ `)
+//line gitlist.qtpl:35
+ qw422016.N().Z(p.About)
+//line gitlist.qtpl:35
+ qw422016.N().S(`
+ </div>
+</div>
+`)
+//line gitlist.qtpl:38
}
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
func (p *GitListPage) WriteContent(qq422016 qtio422016.Writer) {
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
qw422016 := qt422016.AcquireWriter(qq422016)
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
p.StreamContent(qw422016)
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
qt422016.ReleaseWriter(qw422016)
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
}
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
func (p *GitListPage) Content() string {
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
qb422016 := qt422016.AcquireByteBuffer()
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
p.WriteContent(qb422016)
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
qs422016 := string(qb422016.B)
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
qt422016.ReleaseByteBuffer(qb422016)
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
return qs422016
-//line gitlist.qtpl:33
+//line gitlist.qtpl:38
}
-// </div>
-// </div>
-//
-
-//line gitlist.qtpl:37
+//line gitlist.qtpl:40
func (p *GitListPage) StreamScript(qw422016 *qt422016.Writer) {
-//line gitlist.qtpl:37
+//line gitlist.qtpl:40
qw422016.N().S(`
`)
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
}
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
func (p *GitListPage) WriteScript(qq422016 qtio422016.Writer) {
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
qw422016 := qt422016.AcquireWriter(qq422016)
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
p.StreamScript(qw422016)
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
qt422016.ReleaseWriter(qw422016)
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
}
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
func (p *GitListPage) Script() string {
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
qb422016 := qt422016.AcquireByteBuffer()
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
p.WriteScript(qb422016)
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
qs422016 := string(qb422016.B)
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
qt422016.ReleaseByteBuffer(qb422016)
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
return qs422016
-//line gitlist.qtpl:38
+//line gitlist.qtpl:41
}
diff --git a/templates/navbar.qtpl b/templates/navbar.qtpl
index 9681fa4a5fd873e89621c1cdad5151f49661716b..4d2a6a93af93586389c21b685b1df89c818c39f5 100644
--- a/templates/navbar.qtpl
+++ b/templates/navbar.qtpl
@@ -29,7 +29,10 @@ {% comment %}
Add this back once needed
<a class="nav-link{%= insertIfEqual(s, List) %}" href="/list">list</a>
{% endcomment %}
+{% comment %}
+Add this back if needed
<a class="nav-link{%= insertIfEqual(s, About) %}" href="/about">about</a>
+{% endcomment %}
<a class="nav-link{%= insertIfEqual(s, Config) %}" href="/config">config</a>
</div>
</nav>
diff --git a/templates/navbar.qtpl.go b/templates/navbar.qtpl.go
index a2989db1381d0e7ff34c0499825bc27a2b303271..1eacd6a7b0142adb82f16595cfc41d4dd9fafac5 100644
--- a/templates/navbar.qtpl.go
+++ b/templates/navbar.qtpl.go
@@ -89,162 +89,160 @@ qw422016.N().S(`" href="/">git</a>
`)
//line navbar.qtpl:31
qw422016.N().S(`
+`)
+//line navbar.qtpl:35
+ qw422016.N().S(`
<a class="nav-link`)
-//line navbar.qtpl:32
- streaminsertIfEqual(qw422016, s, About)
-//line navbar.qtpl:32
- qw422016.N().S(`" href="/about">about</a>
- <a class="nav-link`)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
streaminsertIfEqual(qw422016, s, Config)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
qw422016.N().S(`" href="/config">config</a>
</div>
</nav>
`)
-//line navbar.qtpl:36
+//line navbar.qtpl:39
}
-//line navbar.qtpl:36
+//line navbar.qtpl:39
func WriteNavbar(qq422016 qtio422016.Writer, s Selection) {
-//line navbar.qtpl:36
+//line navbar.qtpl:39
qw422016 := qt422016.AcquireWriter(qq422016)
-//line navbar.qtpl:36
+//line navbar.qtpl:39
StreamNavbar(qw422016, s)
-//line navbar.qtpl:36
+//line navbar.qtpl:39
qt422016.ReleaseWriter(qw422016)
-//line navbar.qtpl:36
+//line navbar.qtpl:39
}
-//line navbar.qtpl:36
+//line navbar.qtpl:39
func Navbar(s Selection) string {
-//line navbar.qtpl:36
+//line navbar.qtpl:39
qb422016 := qt422016.AcquireByteBuffer()
-//line navbar.qtpl:36
+//line navbar.qtpl:39
WriteNavbar(qb422016, s)
-//line navbar.qtpl:36
+//line navbar.qtpl:39
qs422016 := string(qb422016.B)
-//line navbar.qtpl:36
+//line navbar.qtpl:39
qt422016.ReleaseByteBuffer(qb422016)
-//line navbar.qtpl:36
+//line navbar.qtpl:39
return qs422016
-//line navbar.qtpl:36
+//line navbar.qtpl:39
}
-//line navbar.qtpl:38
+//line navbar.qtpl:41
func StreamGitItemNav(qw422016 *qt422016.Writer, name, ref string, s GitSelection) {
-//line navbar.qtpl:38
+//line navbar.qtpl:41
qw422016.N().S(`
<div class="row">
<h3>`)
-//line navbar.qtpl:40
+//line navbar.qtpl:43
qw422016.E().S(name)
-//line navbar.qtpl:40
+//line navbar.qtpl:43
qw422016.N().S(` `)
-//line navbar.qtpl:40
+//line navbar.qtpl:43
if ref != "" && (s == Log || s == Tree) {
-//line navbar.qtpl:40
+//line navbar.qtpl:43
qw422016.N().S(`@ `)
-//line navbar.qtpl:40
+//line navbar.qtpl:43
qw422016.E().S(ref)
-//line navbar.qtpl:40
+//line navbar.qtpl:43
}
-//line navbar.qtpl:40
+//line navbar.qtpl:43
qw422016.N().S(`</h3>
</div>
<div class="row">
<ul class="nav">
<li class="nav-item">
<a class="nav-link`)
-//line navbar.qtpl:45
- streaminsertIfEqual(qw422016, s, Readme)
-//line navbar.qtpl:45
- qw422016.N().S(`" aria-current="page" href="/`)
-//line navbar.qtpl:45
- qw422016.E().S(name)
-//line navbar.qtpl:45
- qw422016.N().S(`/about">about</a>
- </li>
- <li class="nav-item">
- <a class="nav-link`)
//line navbar.qtpl:48
- streaminsertIfEqual(qw422016, s, Log)
+ streaminsertIfEqual(qw422016, s, Readme)
//line navbar.qtpl:48
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:48
qw422016.E().S(name)
//line navbar.qtpl:48
- qw422016.N().S(`/log/`)
-//line navbar.qtpl:48
- qw422016.E().S(ref)
-//line navbar.qtpl:48
- qw422016.N().S(`">log</a>
+ qw422016.N().S(`/about">about</a>
</li>
<li class="nav-item">
<a class="nav-link`)
//line navbar.qtpl:51
- streaminsertIfEqual(qw422016, s, Summary)
+ streaminsertIfEqual(qw422016, s, Log)
//line navbar.qtpl:51
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:51
qw422016.E().S(name)
//line navbar.qtpl:51
- qw422016.N().S(`">summary</a>
+ qw422016.N().S(`/log/`)
+//line navbar.qtpl:51
+ qw422016.E().S(ref)
+//line navbar.qtpl:51
+ qw422016.N().S(`">log</a>
</li>
<li class="nav-item">
<a class="nav-link`)
//line navbar.qtpl:54
- streaminsertIfEqual(qw422016, s, Refs)
+ streaminsertIfEqual(qw422016, s, Summary)
//line navbar.qtpl:54
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:54
qw422016.E().S(name)
//line navbar.qtpl:54
- qw422016.N().S(`/refs">refs</a>
+ qw422016.N().S(`">summary</a>
</li>
<li class="nav-item">
<a class="nav-link`)
//line navbar.qtpl:57
- streaminsertIfEqual(qw422016, s, Tree)
+ streaminsertIfEqual(qw422016, s, Refs)
//line navbar.qtpl:57
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:57
qw422016.E().S(name)
//line navbar.qtpl:57
+ qw422016.N().S(`/refs">refs</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link`)
+//line navbar.qtpl:60
+ streaminsertIfEqual(qw422016, s, Tree)
+//line navbar.qtpl:60
+ qw422016.N().S(`" aria-current="page" href="/`)
+//line navbar.qtpl:60
+ qw422016.E().S(name)
+//line navbar.qtpl:60
qw422016.N().S(`/tree/`)
-//line navbar.qtpl:57
+//line navbar.qtpl:60
qw422016.E().S(ref)
-//line navbar.qtpl:57
+//line navbar.qtpl:60
qw422016.N().S(`">tree</a>
</li>
</ul>
</div>
`)
-//line navbar.qtpl:61
+//line navbar.qtpl:64
}
-//line navbar.qtpl:61
+//line navbar.qtpl:64
func WriteGitItemNav(qq422016 qtio422016.Writer, name, ref string, s GitSelection) {
-//line navbar.qtpl:61
+//line navbar.qtpl:64
qw422016 := qt422016.AcquireWriter(qq422016)
-//line navbar.qtpl:61
+//line navbar.qtpl:64
StreamGitItemNav(qw422016, name, ref, s)
-//line navbar.qtpl:61
+//line navbar.qtpl:64
qt422016.ReleaseWriter(qw422016)
-//line navbar.qtpl:61
+//line navbar.qtpl:64
}
-//line navbar.qtpl:61
+//line navbar.qtpl:64
func GitItemNav(name, ref string, s GitSelection) string {
-//line navbar.qtpl:61
+//line navbar.qtpl:64
qb422016 := qt422016.AcquireByteBuffer()
-//line navbar.qtpl:61
+//line navbar.qtpl:64
WriteGitItemNav(qb422016, name, ref, s)
-//line navbar.qtpl:61
+//line navbar.qtpl:64
qs422016 := string(qb422016.B)
-//line navbar.qtpl:61
+//line navbar.qtpl:64
qt422016.ReleaseByteBuffer(qb422016)
-//line navbar.qtpl:61
+//line navbar.qtpl:64
return qs422016
-//line navbar.qtpl:61
+//line navbar.qtpl:64
}