mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-15 09:47:39 +08:00
dfbefd1a54
Follow #23748 Thanks to @delvh ---- And, fix the UI alignment by the way (adding some `gt-mr-xx`) Before: ![image](https://user-images.githubusercontent.com/2114189/228034794-7a6ac8d6-01fa-4dd2-97d4-0df0368f8ee0.png) After: ![image](https://user-images.githubusercontent.com/2114189/228034938-64edeadf-7c99-4e74-b658-0ca62b72d596.png)
25 lines
1.5 KiB
Handlebars
25 lines
1.5 KiB
Handlebars
<div id="rel-container">
|
|
<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">
|
|
{{range $flowid, $flow := .Graph.Flows}}
|
|
<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}}">
|
|
<path d="{{range $i, $glyph := $flow.Glyphs -}}
|
|
{{- if or (eq $glyph.Glyph '*') (eq $glyph.Glyph '|') -}}
|
|
M {{Add (Mul $glyph.Column 5) 5}} {{Add (Mul $glyph.Row 12) 0}} v 12 {{/* */ -}}
|
|
{{- else if eq $glyph.Glyph '/' -}}
|
|
M {{Add (Mul $glyph.Column 5) 10}} {{Add (Mul $glyph.Row 12) 0}} l -10 12 {{/* */ -}}
|
|
{{- else if eq $glyph.Glyph '\\' -}}
|
|
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 0}} l 10 12 {{/* */ -}}
|
|
{{- else if or (eq $glyph.Glyph '-') (eq $glyph.Glyph '.') -}}
|
|
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 12}} h 5 {{/* */ -}}
|
|
{{- else if eq $glyph.Glyph '_' -}}
|
|
M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 12) 12}} h 10 {{/* */ -}}
|
|
{{- end -}}
|
|
{{- end}}" stroke-width="1" fill="none" id="flow-{{$flow.ID}}-path" stroke-linecap="round"></path>
|
|
{{range $flow.Commits}}
|
|
<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}}"></circle>
|
|
{{end}}
|
|
</g>
|
|
{{end}}
|
|
</svg>
|
|
</div>
|