You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
3.2 KiB

  1. {{template "base/head" .}}
  2. <div class="repository commits">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div id="git-graph-container" class="ui segment{{if eq .Mode "monochrome"}} monochrome{{end}}">
  6. <h2 class="ui header dividing">{{.i18n.Tr "repo.commit_graph"}}
  7. <div class="ui right">
  8. <div class="ui icon buttons tiny color-buttons">
  9. <button id="flow-color-monochrome" class="ui labelled icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{.i18n.Tr "repo.commit_graph.monochrome"}}"><span class="emoji">{{svg "material-invert-colors"}}</span> {{.i18n.Tr "repo.commit_graph.monochrome"}}</button>
  10. <button id="flow-color-colored" class="ui labelled icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{.i18n.Tr "repo.commit_graph.color"}}"><span class="emoji">{{svg "material-palette"}}</span> {{.i18n.Tr "repo.commit_graph.color"}}</button>
  11. </div>
  12. </div>
  13. </h2>
  14. <div class="ui dividing"></div>
  15. <div id="rel-container">
  16. <svg viewbox="{{Mul .Graph.MinColumn 5}} {{Mul .Graph.MinRow 10}} {{Add (Mul .Graph.Width 5) 5}} {{Mul .Graph.Height 10}}" width="{{Add (Mul .Graph.Width 10) 10}}px">
  17. {{range $flowid, $flow := .Graph.Flows}}
  18. <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}}">
  19. <path d="{{range $i, $glyph := $flow.Glyphs -}}
  20. {{- if or (eq $glyph.Glyph '*') (eq $glyph.Glyph '|') -}}
  21. M {{Add (Mul $glyph.Column 5) 5}} {{Add (Mul $glyph.Row 10) 0}} v 10 {{/* */ -}}
  22. {{- else if eq $glyph.Glyph '/' -}}
  23. M {{Add (Mul $glyph.Column 5) 10}} {{Add (Mul $glyph.Row 10) 0}} l -10 10 {{/* */ -}}
  24. {{- else if eq $glyph.Glyph '\\' -}}
  25. M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 10) 0}} l 10 10 {{/* */ -}}
  26. {{- else if or (eq $glyph.Glyph '-') (eq $glyph.Glyph '.') -}}
  27. M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 10) 10}} h 5 {{/* */ -}}
  28. {{- else if eq $glyph.Glyph '_' -}}
  29. M {{Add (Mul $glyph.Column 5) 0}} {{Add (Mul $glyph.Row 10) 10}} h 10 {{/* */ -}}
  30. {{- end -}}
  31. {{- end}}" stroke-width="1" fill="none" id="flow-{{$flow.ID}}-path" stroke-linecap="round"/>
  32. {{range $flow.Commits}}
  33. <circle class="flow-commit" cx="{{Add (Mul .Column 5) 5}}" cy="{{Add (Mul .Row 10) 5}}" r="2.5" stroke="none" id="flow-commit-{{.Rev}}" data-rev="{{.Rev}}"/>
  34. {{end}}
  35. </g>
  36. {{end}}
  37. </svg>
  38. </div>
  39. <div id="rev-container">
  40. <ul id="rev-list">
  41. {{ range .Graph.Commits }}
  42. <li id="commit-{{.Rev}}" data-flow="{{.Flow}}">
  43. {{ if .OnlyRelation }}
  44. <span />
  45. {{ else }}
  46. <code id="{{.ShortRev}}">
  47. <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.Rev}}">{{ .ShortRev}}</a>
  48. </code>
  49. <strong> {{.Branch}}</strong>
  50. <span>{{RenderCommitMessage .Subject $.RepoLink $.Repository.ComposeMetas}}</span> by
  51. <span class="author">{{.Author}}</span>
  52. <span class="time">{{.Date}}</span>
  53. {{ end }}
  54. </li>
  55. {{ end }}
  56. </ul>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. {{template "base/paginate" .}}
  62. {{template "base/footer" .}}