Skip to content

Commit 26f6b40

Browse files
committed
use tabs in tmpl
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 2c7e9bd commit 26f6b40

File tree

3 files changed

+105
-105
lines changed

3 files changed

+105
-105
lines changed

templates/repo/graph/commits.tmpl

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
11
<div id="rev-container">
2-
<ul id="rev-list">
3-
{{ range $commitI, $commit := .Graph.Commits }}
4-
<li id="commit-{{$commit.Rev}}" data-flow="{{$commit.Flow}}">
5-
{{ if $commit.OnlyRelation }}
6-
<span />
7-
{{ else }}
8-
<span class="sha" id="{{$commit.ShortRev}}">
9-
{{$class := "ui sha label"}}
10-
{{if $commit.Commit.Signature}}
11-
{{$class = (printf "%s%s" $class " isSigned")}}
12-
{{if $commit.Verification.Verified}}
13-
{{if eq $commit.Verification.TrustStatus "trusted"}}
14-
{{$class = (printf "%s%s" $class " isVerified")}}
15-
{{else if eq $commit.Verification.TrustStatus "untrusted"}}
16-
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
17-
{{else}}
18-
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
19-
{{end}}
20-
{{else if $commit.Verification.Warning}}
21-
{{$class = (printf "%s%s" $class " isWarning")}}
22-
{{end}}
23-
{{end}}
24-
<a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.Rev}}" rel="nofollow" class="{{$class}}">
25-
<span class="shortsha">{{ShortSha $commit.Commit.ID.String}}</span>
26-
{{- if $commit.Commit.Signature -}}
27-
<span class="shortsha-pad"></span>{{template "repo/shabox_badge" dict "root" $ "verification" $commit.Verification}}
28-
{{- end -}}
29-
</a>
30-
</span>
31-
{{range $commit.Refs}}
32-
{{$refGroup := .RefGroup}}
33-
{{if eq $refGroup "pull"}}
34-
{{if $.HidePRRefs}}
35-
{{if (containGeneric $.SelectedBranches .Name) }}
36-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/pulls/{{.ShortName|PathEscape}}">
37-
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
38-
</a>
39-
{{end}}
40-
{{else}}
41-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/pulls/{{.ShortName|PathEscape}}">
42-
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
43-
</a>
44-
{{end}}
45-
{{else if eq $refGroup "tags"}}
46-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
47-
{{svg "octicon-tag" 16 "mr-2"}}{{.ShortName}}
48-
</a>
49-
{{else if eq $refGroup "remotes"}}
50-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/commit/{{$commit.Rev}}">
51-
{{svg "octicon-cross-reference" 16 "mr-2"}}{{.ShortName}}
52-
</a>
53-
{{else if eq $refGroup "heads"}}
54-
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
55-
{{svg "octicon-git-branch" 16 "mr-2"}}{{.ShortName}}
56-
</a>
57-
{{else}}
58-
<!-- Unknown ref type {{.Name}} -->
59-
{{end}}
60-
{{end}}
61-
62-
<span>{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
63-
64-
<span class="author">
65-
{{$userName := $commit.Commit.Author.Name}}
66-
{{if $commit.User}}
67-
{{if $commit.User.FullName}}
68-
{{$userName = $commit.User.FullName}}
69-
{{end}}
70-
<img class="ui avatar image" src="{{$commit.User.RelAvatarLink}}" alt=""/><a href="{{AppSubUrl}}/{{$commit.User.Name}}">{{$userName}}</a>
71-
{{else}}
72-
<img class="ui avatar image" src="{{AvatarLink $commit.Commit.Author.Email}}" alt=""/>{{$userName}}
73-
{{end}}
74-
</span>
75-
<span class="time">{{$commit.Date}}</span>
76-
{{ end }}
77-
</li>
78-
{{ end }}
79-
</ul>
2+
<ul id="rev-list">
3+
{{ range $commitI, $commit := .Graph.Commits }}
4+
<li id="commit-{{$commit.Rev}}" data-flow="{{$commit.Flow}}">
5+
{{ if $commit.OnlyRelation }}
6+
<span />
7+
{{ else }}
8+
<span class="sha" id="{{$commit.ShortRev}}">
9+
{{$class := "ui sha label"}}
10+
{{if $commit.Commit.Signature}}
11+
{{$class = (printf "%s%s" $class " isSigned")}}
12+
{{if $commit.Verification.Verified}}
13+
{{if eq $commit.Verification.TrustStatus "trusted"}}
14+
{{$class = (printf "%s%s" $class " isVerified")}}
15+
{{else if eq $commit.Verification.TrustStatus "untrusted"}}
16+
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
17+
{{else}}
18+
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
19+
{{end}}
20+
{{else if $commit.Verification.Warning}}
21+
{{$class = (printf "%s%s" $class " isWarning")}}
22+
{{end}}
23+
{{end}}
24+
<a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.Rev}}" rel="nofollow" class="{{$class}}">
25+
<span class="shortsha">{{ShortSha $commit.Commit.ID.String}}</span>
26+
{{- if $commit.Commit.Signature -}}
27+
<span class="shortsha-pad"></span>{{template "repo/shabox_badge" dict "root" $ "verification" $commit.Verification}}
28+
{{- end -}}
29+
</a>
30+
</span>
31+
{{range $commit.Refs}}
32+
{{$refGroup := .RefGroup}}
33+
{{if eq $refGroup "pull"}}
34+
{{if $.HidePRRefs}}
35+
{{if (containGeneric $.SelectedBranches .Name) }}
36+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/pulls/{{.ShortName|PathEscape}}">
37+
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
38+
</a>
39+
{{end}}
40+
{{else}}
41+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/pulls/{{.ShortName|PathEscape}}">
42+
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
43+
</a>
44+
{{end}}
45+
{{else if eq $refGroup "tags"}}
46+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
47+
{{svg "octicon-tag" 16 "mr-2"}}{{.ShortName}}
48+
</a>
49+
{{else if eq $refGroup "remotes"}}
50+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/commit/{{$commit.Rev}}">
51+
{{svg "octicon-cross-reference" 16 "mr-2"}}{{.ShortName}}
52+
</a>
53+
{{else if eq $refGroup "heads"}}
54+
<a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
55+
{{svg "octicon-git-branch" 16 "mr-2"}}{{.ShortName}}
56+
</a>
57+
{{else}}
58+
<!-- Unknown ref type {{.Name}} -->
59+
{{end}}
60+
{{end}}
61+
62+
<span>{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
63+
64+
<span class="author">
65+
{{$userName := $commit.Commit.Author.Name}}
66+
{{if $commit.User}}
67+
{{if $commit.User.FullName}}
68+
{{$userName = $commit.User.FullName}}
69+
{{end}}
70+
<img class="ui avatar image" src="{{$commit.User.RelAvatarLink}}" alt=""/><a href="{{AppSubUrl}}/{{$commit.User.Name}}">{{$userName}}</a>
71+
{{else}}
72+
<img class="ui avatar image" src="{{AvatarLink $commit.Commit.Author.Email}}" alt=""/>{{$userName}}
73+
{{end}}
74+
</span>
75+
<span class="time">{{$commit.Date}}</span>
76+
{{ end }}
77+
</li>
78+
{{ end }}
79+
</ul>
8080
</div>

templates/repo/graph/div.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div>
2-
{{template "repo/graph/svgcontainer" .}}
3-
{{template "repo/graph/commits" .}}
4-
<div id="pagination">
5-
{{template "base/paginate" .}}
6-
</div>
2+
{{template "repo/graph/svgcontainer" .}}
3+
{{template "repo/graph/commits" .}}
4+
<div id="pagination">
5+
{{template "base/paginate" .}}
6+
</div>
77
</div>
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<div id="rel-container">
2-
<svg viewbox="{{Mul .Graph.MinColumn 5}} {{Mul .Graph.MinRow 12}} {{Add (Mul .Graph.Width 5) 5}} {{Mul .Graph.Height 12}}" width="{{Add (Mul .Graph.Width 10) 10}}px">
3-
{{range $flowid, $flow := .Graph.Flows}}
4-
<g id="flow-{{$flow.ID}}" class="flow-group flow-color-{{$flow.ColorNumber}} flow-color-16-{{$flow.Color16}}" data-flow="{{$flow.ID}}" data-color="{{$flow.ColorNumber}}">
5-
<path d="{{range $i, $glyph := $flow.Glyphs -}}
6-
{{- if or (eq $glyph.Glyph '*') (eq $glyph.Glyph '|') -}}
7-
M {{Add (Mul $glyph.Column 5) 5}} {{Add (Mul $glyph.Row 12) 0}} v 12 {{/* */ -}}
8-
{{- else if eq $glyph.Glyph '/' -}}
9-
M {{Add (Mul $glyph.Column 5) 10}} {{Add (Mul $glyph.Row 12) 0}} l -10 12 {{/* */ -}}
10-
{{- else if eq $glyph.Glyph '\\' -}}
11-
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 0}} l 10 12 {{/* */ -}}
12-
{{- else if or (eq $glyph.Glyph '-') (eq $glyph.Glyph '.') -}}
13-
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 12}} h 5 {{/* */ -}}
14-
{{- else if eq $glyph.Glyph '_' -}}
15-
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 12}} h 10 {{/* */ -}}
16-
{{- end -}}
17-
{{- end}}" stroke-width="1" fill="none" id="flow-{{$flow.ID}}-path" stroke-linecap="round"/>
18-
{{range $flow.Commits}}
19-
<circle class="flow-commit" cx="{{Add (Mul .Column 5) 5}}" cy="{{Add (Mul .Row 12) 6}}" r="2.5" stroke="none" id="flow-commit-{{.Rev}}" data-rev="{{.Rev}}"/>
20-
{{end}}
21-
</g>
22-
{{end}}
23-
</svg>
2+
<svg viewbox="{{Mul .Graph.MinColumn 5}} {{Mul .Graph.MinRow 12}} {{Add (Mul .Graph.Width 5) 5}} {{Mul .Graph.Height 12}}" width="{{Add (Mul .Graph.Width 10) 10}}px">
3+
{{range $flowid, $flow := .Graph.Flows}}
4+
<g id="flow-{{$flow.ID}}" class="flow-group flow-color-{{$flow.ColorNumber}} flow-color-16-{{$flow.Color16}}" data-flow="{{$flow.ID}}" data-color="{{$flow.ColorNumber}}">
5+
<path d="{{range $i, $glyph := $flow.Glyphs -}}
6+
{{- if or (eq $glyph.Glyph '*') (eq $glyph.Glyph '|') -}}
7+
M {{Add (Mul $glyph.Column 5) 5}} {{Add (Mul $glyph.Row 12) 0}} v 12 {{/* */ -}}
8+
{{- else if eq $glyph.Glyph '/' -}}
9+
M {{Add (Mul $glyph.Column 5) 10}} {{Add (Mul $glyph.Row 12) 0}} l -10 12 {{/* */ -}}
10+
{{- else if eq $glyph.Glyph '\\' -}}
11+
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 0}} l 10 12 {{/* */ -}}
12+
{{- else if or (eq $glyph.Glyph '-') (eq $glyph.Glyph '.') -}}
13+
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 12}} h 5 {{/* */ -}}
14+
{{- else if eq $glyph.Glyph '_' -}}
15+
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 12}} h 10 {{/* */ -}}
16+
{{- end -}}
17+
{{- end}}" stroke-width="1" fill="none" id="flow-{{$flow.ID}}-path" stroke-linecap="round"/>
18+
{{range $flow.Commits}}
19+
<circle class="flow-commit" cx="{{Add (Mul .Column 5) 5}}" cy="{{Add (Mul .Row 12) 6}}" r="2.5" stroke="none" id="flow-commit-{{.Rev}}" data-rev="{{.Rev}}"/>
20+
{{end}}
21+
</g>
22+
{{end}}
23+
</svg>
2424
</div>

0 commit comments

Comments
 (0)