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

view_list.tmpl 7.4 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <style>
  2. .context-menu {
  3. z-index: 99;
  4. position: absolute;
  5. padding: 0;
  6. border-radius: 4px;
  7. border: 1px solid #e3e9ed;
  8. -webkit-box-shadow: none;
  9. box-shadow: none;
  10. background: #fff;
  11. display: none !important;
  12. }
  13. .context-menu.active {
  14. display: block !important;
  15. }
  16. .context-menu-operation {
  17. padding: 5px !important;
  18. line-height: 1.78 !important;
  19. }
  20. .context-menu-icon {
  21. float: left !important;
  22. margin: 0px 5px 0px 0px !important;
  23. }
  24. </style>
  25. <div id="mask">
  26. <div id="loadingPage">
  27. <div class="rect1"></div>
  28. <div class="rect2"></div>
  29. <div class="rect3"></div>
  30. <div class="rect4"></div>
  31. <div class="rect5"></div>
  32. </div>
  33. </div>
  34. <table id="repo-files-table" class="ui single line table can-context-menu" data-can-editfile="{{.CanEditFile}}">
  35. {{.CsrfTokenHtml}}
  36. <thead>
  37. <tr class="commit-list">
  38. <th colspan="2">
  39. {{if .LatestCommitUser}}
  40. <img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" />
  41. {{if .LatestCommitUser.FullName}}
  42. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  43. {{else}}
  44. <a
  45. href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
  46. {{end}}
  47. {{else}}
  48. {{if .LatestCommit.Author}}
  49. <img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
  50. <strong>{{.LatestCommit.Author.Name}}</strong>
  51. {{end}}
  52. {{end}}
  53. <a rel="nofollow"
  54. class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}"
  55. href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
  56. <span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span>
  57. {{if .LatestCommit.Signature}}
  58. <div class="ui detail icon button">
  59. {{if .LatestCommitVerification.Verified}}
  60. <div
  61. title="{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}{{.i18n.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{.i18n.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.LatestCommitVerification.Reason}}">
  62. {{if ne .LatestCommitVerification.SigningUser.ID 0}}
  63. <i class="lock icon"></i>
  64. <img class="ui signature avatar image"
  65. src="{{.LatestCommitVerification.SigningUser.RelAvatarLink}}" />
  66. {{else}}
  67. <i title="{{.LatestCommitVerification.Reason}}" class="icons">
  68. <i class="lock icon"></i>
  69. <i class="tiny inverted cog icon centerlock"></i>
  70. </i>
  71. <img class="ui signature avatar image"
  72. src="{{AvatarLink .LatestCommitVerification.SigningEmail}}" />
  73. {{end}}
  74. </div>
  75. {{else}}
  76. <i title="{{$.i18n.Tr .LatestCommitVerification.Reason}}" class="unlock icon"></i>
  77. {{end}}
  78. </div>
  79. {{end}}
  80. </a>
  81. {{template "repo/commit_status" .LatestCommitStatus}}
  82. {{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }}
  83. <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span
  84. class="message-wrapper">{{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  85. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  86. <button class="basic compact mini ui icon button commit-button"><i
  87. class="ellipsis horizontal icon"></i></button>
  88. <pre class="commit-body"
  89. style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  90. {{end}}
  91. </span>
  92. </th>
  93. <th class="text grey right age">
  94. {{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th>
  95. </tr>
  96. </thead>
  97. <tbody>
  98. {{if .HasParentPath}}
  99. <tr class="has-parent">
  100. <td colspan="3">{{svg "octicon-mail-reply" 16}}<a href="{{EscapePound .BranchLink}}{{.ParentPath}}">..</a>
  101. </td>
  102. </tr>
  103. {{end}}
  104. {{range $item := .Files}}
  105. {{$entry := index $item 0}}
  106. {{$commit := index $item 1}}
  107. <tr>
  108. {{if $entry.IsSubModule}}
  109. <td>
  110. <span class="truncate">
  111. {{svg "octicon-inbox" 16}}
  112. {{$refURL := $commit.RefURL AppUrl $.Repository.FullName}}
  113. {{if $refURL}}
  114. <a href="{{$refURL}}">{{$entry.Name}}</a> @ <a
  115. href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
  116. {{else}}
  117. {{$entry.Name}} @ {{ShortSha $commit.RefID}}
  118. {{end}}
  119. </span>
  120. </td>
  121. {{else}}
  122. <td class="name four wide modified-contextmenu">
  123. <span class="truncate">
  124. {{if $entry.IsDir}}
  125. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  126. {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
  127. {{svg "octicon-file-directory" 16}}
  128. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}"
  129. title="{{$subJumpablePathName}}">
  130. {{if eq (len $subJumpablePath) 2}}
  131. <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
  132. {{else}}
  133. {{index $subJumpablePath 0}}
  134. {{end}}
  135. </a>
  136. {{else}}
  137. {{svg (printf "octicon-%s" (EntryIcon $entry)) 16}}
  138. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}"
  139. title="{{$entry.Name}}">{{$entry.Name}}</a>
  140. {{end}}
  141. </span>
  142. </td>
  143. {{end}}
  144. <td class="message nine wide">
  145. <span class="truncate">
  146. <a href="{{$.RepoLink}}/commit/{{$commit.ID}}"
  147. title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
  148. </span>
  149. </td>
  150. <td class="text right age three wide">{{TimeSince $commit.Committer.When $.Lang}}</td>
  151. </tr>
  152. <tr style="display: none !important;" class="context-menu-one">
  153. <td colspan="12">
  154. <div class="ui column form" method="POST">
  155. <div class="two fields" style="margin: 0;">
  156. <div class="five wide field">
  157. <input class="ui input" name="new_filename" type="text" value="">
  158. </div>
  159. <div class="five wide field">
  160. <button class="ui blue button popup-save" type="button"
  161. data-postBasePath="{{$.RepoLink}}/_rename/{{EscapePound $.BranchName}}{{if $.TreePath}}/{{EscapePound $.TreePath}}{{end}}/{{$entry.Name}}"
  162. data-commit="{{$.LatestCommit.ID}}"
  163. data-treepath="{{if $.TreePath}}{{EscapePound $.TreePath}}/{{end}}">保存</button>
  164. <button class="ui basic button popup-close" type="button">取消</button>
  165. </div>
  166. </div>
  167. </div>
  168. </td>
  169. </tr>
  170. {{end}}
  171. </tbody>
  172. </table>
  173. {{if .ReadmeExist}}
  174. {{template "repo/view_file" .}}
  175. {{end}}
  176. <!-- 确认模态框 -->
  177. <div id="deletemodel">
  178. <div class="ui basic modal context-menu-delete">
  179. <div class="ui icon header">
  180. <i class="trash icon"></i> {{.i18n.Tr "cloudbrain.delete_task"}}
  181. </div>
  182. <div class="content">
  183. <p>{{.i18n.Tr "cloudbrain.task_delete_confirm"}}</p>
  184. </div>
  185. <div class="actions">
  186. <div class="ui red basic inverted cancel button">
  187. <i class="remove icon"></i> {{.i18n.Tr "cloudbrain.operate_cancel"}}
  188. </div>
  189. <div class="ui green basic inverted ok button">
  190. <i class="checkmark icon"></i> {{.i18n.Tr "cloudbrain.operate_confirm"}}
  191. </div>
  192. </div>
  193. </div>
  194. </div>