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.

122 lines
5.8 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. {{template "base/head" .}}
  2. {{template "base/navbar" .}}
  3. {{template "repo/nav" .}}
  4. <div id="body" class="container" data-page="repo">
  5. <div id="source">
  6. {{if .IsDiffCompare }}
  7. <div class="panel panel-info diff-box diff-head-box">
  8. <div class="panel-heading">
  9. <a class="pull-right btn btn-primary btn-sm" rel="nofollow" href="{{.SourcePath}}">Browse Source</a>
  10. <h4><a href="{{$.RepoLink}}/commit/{{.BeforeCommitId}}" class="label label-success">{{ShortSha .BeforeCommitId}}</a> ... <a href="{{$.RepoLink}}/commit/{{.AfterCommitId}}" class="label label-success">{{ShortSha .AfterCommitId}}</a></h4>
  11. </div>
  12. <div class="panel-body compare">
  13. {{template "repo/commits_table" .}}
  14. </div>
  15. </div>
  16. {{else}}
  17. <div class="panel panel-info diff-box diff-head-box">
  18. <div class="panel-heading">
  19. <a class="pull-right btn btn-primary btn-sm" rel="nofollow" href="{{.SourcePath}}">Browse Source</a>
  20. <h4>{{.Commit.Message}}</h4>
  21. </div>
  22. <div class="panel-body">
  23. <span class="pull-right">
  24. <ul class="list-unstyled">
  25. {{range .Parents}}
  26. <li>parent <a href="{{$.RepoLink}}/commit/{{.}}"><span class="label label-default sha">{{ShortSha .}}</span></a></li>
  27. {{end}}
  28. <li>commit <span class="label label-default sha">{{ShortSha .CommitId}}</span></li>
  29. </ul>
  30. </span>
  31. <p class="author">
  32. <img class="avatar" src="{{AvatarLink .Commit.Author.Email}}" alt=""/>
  33. <a class="name" href="/user/email2user?email={{.Commit.Author.Email}}"><strong>{{.Commit.Author.Name}}</strong></a>
  34. <span class="time">{{TimeSince .Commit.Author.When $.Lang}}</span>
  35. </p>
  36. </div>
  37. </div>
  38. {{end}}
  39. {{if .DiffNotAvailable}}
  40. <h4>Diff Data Not Available.</h4>
  41. {{else}}
  42. <div class="diff-detail-box diff-box">
  43. <a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a>
  44. <p class="showing">
  45. <i class="fa fa-retweet"></i>
  46. <strong> {{.Diff.NumFiles}} changed files</strong> with <strong>{{.Diff.TotalAddition}} additions</strong> and <strong>{{.Diff.TotalDeletion}} deletions</strong>.
  47. </p>
  48. <ol class="detail-files collapse" id="diff-files">
  49. {{range .Diff.Files}}
  50. <li>
  51. <div class="diff-counter count pull-right">
  52. {{if not .IsBin}}
  53. <span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
  54. <span class="bar">
  55. <span class="pull-left add"></span>
  56. <span class="pull-left del"></span>
  57. </span>
  58. <span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
  59. {{else}}
  60. <span>BIN</span>
  61. {{end}}
  62. </div>
  63. <!-- todo finish all file status, now modify, add, delete and rename -->
  64. <span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}">&nbsp;</span>
  65. <a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
  66. </li>
  67. {{end}}
  68. </ol>
  69. </div>
  70. {{range .Diff.Files}}
  71. <div class="panel panel-default diff-file-box diff-box file-content" id="diff-{{.Index}}">
  72. <div class="panel-heading">
  73. <div class="diff-counter count pull-left">
  74. {{if not .IsBin}}
  75. <span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
  76. <span class="bar">
  77. <span class="pull-left add"></span>
  78. <span class="pull-left del"></span>
  79. </span>
  80. <span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
  81. {{else}}
  82. BIN
  83. {{end}}
  84. </div>
  85. <a class="btn btn-default btn-sm pull-right" rel="nofollow" href="{{$.SourcePath}}/{{.Name}}">View File</a>
  86. <span class="file">{{.Name}}</span>
  87. </div>
  88. {{$isImage := (call $.IsImageFile .Name)}}
  89. <div class="panel-body file-body file-code code-view code-diff">
  90. {{if $isImage}}
  91. <div class="text-center">
  92. <img src="{{$.RawPath}}/{{.Name}}">
  93. </div>
  94. {{else}}
  95. <table>
  96. <tbody>
  97. {{range .Sections}}
  98. {{range .Lines}}
  99. <tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1">
  100. <td class="lines-num lines-num-old">
  101. <span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span>
  102. </td>
  103. <td class="lines-num lines-num-new">
  104. <span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span>
  105. </td>
  106. <td class="lines-code">
  107. <pre>{{.Content}}</pre>
  108. </td>
  109. </tr>
  110. {{end}}
  111. {{end}}
  112. </tbody>
  113. </table>
  114. {{end}}
  115. </div>
  116. </div>
  117. {{end}}
  118. {{end}}
  119. </div>
  120. </div>
  121. {{template "base/footer" .}}