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.

130 lines
6.5 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
  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. <div id="repo-wrapper">
  4. {{template "repo/header" .}}
  5. <div class="container clear" id="diff-page">
  6. {{if .IsDiffCompare }}
  7. <div class="panel panel-info panel-radius compare-head-box">
  8. <div class="panel-header">
  9. <a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{.SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
  10. <h4><a href="{{$.RepoLink}}/commit/{{.BeforeCommitId}}" class="label label-green">{{ShortSha .BeforeCommitId}}</a> ... <a href="{{$.RepoLink}}/commit/{{.AfterCommitId}}" class="label label-green">{{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 panel-radius diff-head-box">
  18. <div class="panel-header">
  19. <a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{.SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
  20. <h4 class="commit-message">{{RenderCommitMessage .Commit.Message $.RepoLink}}</h4>
  21. </div>
  22. <div class="panel-body">
  23. <span class="pull-right">
  24. <ul class="list-unstyled">
  25. <li class="inline">{{.i18n.Tr "repo.diff.parent"}}</li>
  26. {{range .Parents}}
  27. <li class="inline"><a href="{{$.RepoLink}}/commit/{{.}}"><span class="label label-blue">{{ShortSha .}}</span></a></li>
  28. {{end}}
  29. <li class="inline">{{.i18n.Tr "repo.diff.commit"}} <span class="label label-blue">{{ShortSha .CommitId}}</span></li>
  30. </ul>
  31. </span>
  32. <p class="author">
  33. {{if .Author}}
  34. <img class="avatar-30" src="{{.Author.AvatarLink}}" />
  35. <a href="{{AppSubUrl}}/{{.Author.Name}}"><strong>{{.Commit.Author.Name}}</strong></a>
  36. {{else}}
  37. <img class="avatar-30" src="{{AvatarLink .Commit.Author.Email}}" />
  38. <strong>{{.Commit.Author.Name}}</strong>
  39. {{end}}
  40. <span class="text-grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span>
  41. </p>
  42. </div>
  43. </div>
  44. {{end}}
  45. {{if .DiffNotAvailable}}
  46. <h4>{{.i18n.Tr "repo.diff.data_not_available"}}</h4>
  47. {{else}}
  48. <div class="diff-detail-box diff-box">
  49. <a class="pull-right btn btn-gray btn-header btn-radius text-black" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
  50. <p class="showing">
  51. <i class="fa fa-retweet"></i>
  52. {{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
  53. </p>
  54. <ol class="detail-files collapse hide" id="diff-files">
  55. {{range .Diff.Files}}
  56. <li>
  57. <div class="diff-counter count pull-right">
  58. {{if not .IsBin}}
  59. <span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
  60. <span class="bar">
  61. <span class="pull-left add"></span>
  62. <span class="pull-left del"></span>
  63. </span>
  64. <span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
  65. {{else}}
  66. <span>{{$.i18n.Tr "repo.diff.bin"}}</span>
  67. {{end}}
  68. </div>
  69. <!-- todo finish all file status, now modify, add, delete and rename -->
  70. <span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}">&nbsp;</span>
  71. <a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
  72. </li>
  73. {{end}}
  74. </ol>
  75. </div>
  76. {{range .Diff.Files}}
  77. <div class="panel panel-radius diff-file-box diff-box file-content" id="diff-{{.Index}}">
  78. <div class="panel-header">
  79. <div class="diff-counter count pull-left">
  80. {{if not .IsBin}}
  81. <span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
  82. <span class="bar">
  83. <span class="pull-left add"></span>
  84. <span class="pull-left del"></span>
  85. </span>
  86. <span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
  87. {{else}}
  88. {{$.i18n.Tr "repo.diff.bin"}}
  89. {{end}}
  90. </div>
  91. <a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{$.SourcePath}}/{{.Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
  92. <span class="file">{{.Name}}</span>
  93. </div>
  94. {{$isImage := (call $.IsImageFile .Name)}}
  95. <div class="panel-body file-body file-code code-view code-diff">
  96. {{if $isImage}}
  97. <div class="text-center">
  98. <img src="{{$.RawPath}}/{{.Name}}">
  99. </div>
  100. {{else}}
  101. <table>
  102. <tbody>
  103. {{range .Sections}}
  104. {{range .Lines}}
  105. <tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1">
  106. <td class="lines-num lines-num-old">
  107. <span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span>
  108. </td>
  109. <td class="lines-num lines-num-new">
  110. <span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span>
  111. </td>
  112. <td class="lines-code">
  113. <pre>{{.Content}}</pre>
  114. </td>
  115. </tr>
  116. {{end}}
  117. {{end}}
  118. </tbody>
  119. </table>
  120. {{end}}
  121. </div>
  122. </div>
  123. <br>
  124. {{end}}
  125. {{end}}
  126. </div>
  127. </div>
  128. {{template "ng/base/footer" .}}