Home

ugit @b039da654c21994ef23b218c635e0dc17494f3ae - refs - log -
-
https://git.jolheiser.com/ugit.git
The code powering this h*ckin' site
ugit / internal / html / repo_log.templ
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package html

import "fmt"
import "github.com/dustin/go-humanize"
import "go.jolheiser.com/ugit/internal/git"

type RepoLogContext struct {
  BaseContext
  RepoHeaderComponentContext
  Commits []git.Commit
}

templ RepoLog(rlc RepoLogContext) {
	@base(rlc.BaseContext) {
		@repoHeaderComponent(rlc.RepoHeaderComponentContext)
		<div class="grid grid-cols-8 gap-5 text-text mt-5">
			for _, commit := range rlc.Commits {
				<div class="col-span-4">
					<div><a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/commit/%s", rlc.RepoHeaderComponentContext.Name, commit.SHA)) }>{ commit.Short() }</a></div>
					if commit.Signature != "" {
						<details class="col-span-8 whitespace-pre"><summary class="cursor-pointer">Signature</summary><code>{ commit.Signature }</code></details>
					}
					<div class="whitespace-pre">
						if commit.Details() != "" {
							<details><summary class="cursor-pointer">{ commit.Summary() }</summary>{ commit.Details() }</details>
						} else {
							{ commit.Message }
						}
					</div>
				</div>
				<div class="col-span-4">
					<div>{ commit.Author }{ " " }<a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("mailto:%s", commit.Email)) }>{ fmt.Sprintf("<%s>", commit.Email) }</a></div>
					<div title={ commit.When.Format("01/02/2006 03:04:05 PM") }>{ humanize.Time(commit.When) }</div>
				</div>
			}
		</div>
	}
}