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.

courseHome.tmpl 15 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. {{template "base/head" .}}
  2. <style>
  3. .repository.file.list #repo-desc {
  4. font-size: 1.0em;
  5. margin-bottom: 1.0rem;
  6. }
  7. #contributorInfo > a:nth-child(n+26){
  8. display:none;
  9. }
  10. #contributorInfo > a{
  11. width: 2.0em;
  12. float: left;
  13. margin: .25em;
  14. }
  15. .edit-link{
  16. vertical-align: top;
  17. display: inline-block;
  18. overflow: hidden;
  19. word-break: keep-all;
  20. white-space: nowrap;
  21. text-overflow: ellipsis;
  22. width: 16.5em;
  23. }
  24. #contributorInfo > a.circular{
  25. height: 2.0em;
  26. padding: 0;
  27. overflow: hidden;
  28. letter-spacing:1.0em;
  29. text-indent: 0.6em;
  30. line-height: 2.0em;
  31. text-transform:capitalize;
  32. color: #FFF;
  33. }
  34. #contributorInfo > a.circular:nth-child(9n+1){
  35. background-color: #4ccdec;
  36. }
  37. #contributorInfo > a.circular:nth-child(9n+2){
  38. background-color: #e0b265;
  39. }
  40. #contributorInfo > a.circular:nth-child(9n+3){
  41. background-color: #d884b7;
  42. }
  43. #contributorInfo > a.circular:nth-child(9n+4){
  44. background-color: #8c6bdc;
  45. }
  46. #contributorInfo > a.circular:nth-child(9n+5){
  47. background-color: #3cb99f;
  48. }
  49. #contributorInfo > a.circular:nth-child(9n+6){
  50. background-color: #6995b9;
  51. }
  52. #contributorInfo > a.circular:nth-child(9n+7){
  53. background-color: #ab91a7;
  54. }
  55. #contributorInfo > a.circular:nth-child(9n+8){
  56. background-color: #bfd0aa;
  57. }
  58. .vue_menu {
  59. cursor: auto;
  60. position: absolute;
  61. outline: none;
  62. margin: 0em;
  63. padding: 0em 0em;
  64. background: #fff;
  65. font-size: 1em;
  66. text-shadow: none;
  67. text-align: left;
  68. /* -webkit-box-shadow: 0px 2px 3px 0px rgb(34 36 38 / 15%); */
  69. box-shadow: 0px 2px 3px 0px rgba(34, 36, 38, 0.15);
  70. border: 1px solid rgba(34,36,38,0.15);
  71. border-radius: 0.28571429rem;
  72. -webkit-transition: opacity 0.1s ease;
  73. transition: opacity 0.1s ease;
  74. z-index: 11;
  75. will-change: transform, opacity;
  76. -webkit-animation-iteration-count: 1;
  77. animation-iteration-count: 1;
  78. -webkit-animation-duration: 300ms;
  79. animation-duration: 300ms;
  80. -webkit-animation-timing-function: ease;
  81. animation-timing-function: ease;
  82. -webkit-animation-fill-mode: both;
  83. animation-fill-mode: both;
  84. }
  85. .repo-topic{
  86. background-color: rgba(179, 219, 219, 0.4) !important;
  87. color: #0366D6 !important;
  88. font-weight: 200 !important;
  89. }
  90. </style>
  91. <div class="repository file list">
  92. {{template "repo/header" .}}
  93. <div class="ui container">
  94. {{template "base/alert" .}}
  95. <div class="hide" id="validate_prompt">
  96. <span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span>
  97. <span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span>
  98. </div>
  99. {{if .Repository.IsArchived}}
  100. <div class="ui warning message">
  101. {{.i18n.Tr "repo.archive.title"}}
  102. </div>
  103. {{end}}
  104. <div>
  105. <span>{{.i18n.Tr "repo.computing.Introduction"}}:</span>
  106. {{if .Repository.DescriptionHTML}}
  107. <span class="description" style="color: #8a8e99;">{{.Repository.DescriptionHTML}}</span>
  108. {{else}}
  109. <span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>
  110. {{end}}
  111. <!-- <span style="color: #8a8e99;">生课程的教学,在全国范围形成一批开放共享的教学材料。这类材料的风格、设想既不同于教材,也不同于IEEE CSs中对知识体系的描述,而是以一定的知识内容为背景,重在教师个人在教学实践中的心得,包括对某些内容独到的理解和课堂上的处理,等等。</span> -->
  112. </div>
  113. <div class="ui" id="repo-topics">
  114. <div id="repo-topics1" style="display: inline-block;margin: 0.5rem 0;">
  115. {{range .Topics}}
  116. <a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=">{{.Name}}</a>
  117. {{end}}
  118. </div>
  119. <a style="margin-left: 0.5rem;" id="manage_topic">
  120. {{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<i style="cursor: pointer;" class="plus square outline icon"></i>{{end}}
  121. {{.i18n.Tr "repo.issues.new.add_labels_title"}}
  122. </a>
  123. <div id="topic_edit" class="vue_menu" style="display:none;">
  124. <div id="topic_edit1">
  125. </div>
  126. </div>
  127. </div>
  128. <div class="ui mobile reversed stackable grid">
  129. {{ $n := len .TreeNames}}
  130. {{ $l := Subtract $n 1}}
  131. <!-- If home page, show new PR. If not, show breadcrumb -->
  132. <div class="ui ten wide tablet twelve wide computer column text right" style="margin-top: 1rem;">
  133. <div class="right fitted item" id="file-buttons">
  134. <div class="ui tiny blue buttons">
  135. {{if .Repository.CanEnableEditor}}
  136. {{if .CanAddFile}}
  137. <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  138. {{.i18n.Tr "repo.editor.new_file"}}
  139. </a>
  140. {{end}}
  141. {{if .CanUploadFile}}
  142. <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  143. {{.i18n.Tr "repo.editor.upload_file"}}
  144. </a>
  145. {{end}}
  146. {{end}}
  147. {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }}
  148. <a href="{{.RepoLink}}/commits/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}" class="ui button">
  149. {{.i18n.Tr "repo.file_history"}}
  150. </a>
  151. {{end}}
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. <div class="ui container">
  157. <div class="ui mobile reversed stackable grid">
  158. <div class="ui ten wide tablet twelve wide computer column">
  159. {{if .IsViewFile}}
  160. {{template "repo/view_file" .}}
  161. {{else if .IsBlame}}
  162. {{template "repo/blame" .}}
  163. {{else}}
  164. <table id="repo-files-table" class="ui single line table">
  165. <thead>
  166. <tr class="commit-list">
  167. <th colspan="2">
  168. {{if .LatestCommitUser}}
  169. <img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" />
  170. {{if .LatestCommitUser.FullName}}
  171. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  172. {{else}}
  173. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
  174. {{end}}
  175. {{else}}
  176. {{if .LatestCommit.Author}}
  177. <img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
  178. <strong>{{.LatestCommit.Author.Name}}</strong>
  179. {{end}}
  180. {{end}}
  181. {{if .LatestCommit.Author}}
  182. <span style="margin: 0 0.5rem;color: #767676">{{TimeSince .LatestCommit.Author.When $.Lang}}</span>
  183. {{end}}
  184. {{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }}
  185. <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  186. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  187. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  188. <pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  189. {{end}}
  190. </span>
  191. </th>
  192. </tr>
  193. </thead>
  194. <tbody>
  195. {{if .HasParentPath}}
  196. <tr class="has-parent">
  197. <td colspan="3">{{svg "octicon-mail-reply" 16}}<a href="{{EscapePound .BranchLink}}{{.ParentPath}}">..</a></td>
  198. </tr>
  199. {{end}}
  200. {{range $item := .Files}}
  201. {{$entry := index $item 0}}
  202. {{$commit := index $item 1}}
  203. <tr>
  204. {{if $entry.IsSubModule}}
  205. <td>
  206. <span class="truncate">
  207. {{svg "octicon-inbox" 16}}
  208. {{$refURL := $commit.RefURL AppUrl $.Repository.FullName}}
  209. {{if $refURL}}
  210. <a href="{{$refURL}}">{{$entry.Name}}</a> @ <a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
  211. {{else}}
  212. {{$entry.Name}} @ {{ShortSha $commit.RefID}}
  213. {{end}}
  214. </span>
  215. </td>
  216. {{else}}
  217. <td class="name thirteen wide">
  218. <span class="truncate">
  219. {{if $entry.IsDir}}
  220. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  221. {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
  222. {{svg "octicon-file-directory" 16}}
  223. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  224. {{if eq (len $subJumpablePath) 2}}
  225. <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
  226. {{else}}
  227. {{index $subJumpablePath 0}}
  228. {{end}}
  229. </a>
  230. {{else}}
  231. <i class="ri-file-pdf-line" style="font-size: 16px;margin-left: 3px;margin-right: 5px;vertical-align: text-top;color: #FA8C16;"></i>
  232. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
  233. {{end}}
  234. </span>
  235. </td>
  236. {{end}}
  237. <!-- <td class="message nine wide">
  238. <span class="truncate">
  239. <a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
  240. </span>
  241. </td> -->
  242. <td class="text right age one wide" style="text-align: right;">{{TimeSince $commit.Committer.When $.Lang}}</td>
  243. </tr>
  244. {{end}}
  245. </tbody>
  246. </table>
  247. {{if .ReadmeExist}}
  248. {{template "repo/view_file" .}}
  249. {{end}}
  250. {{end}}
  251. </div>
  252. <!-- 贡献者框 -->
  253. <div class="ui six wide tablet four wide computer column">
  254. <div style="border-radius: 5px;border: 1px solid rgba(225, 227, 230, 100);padding: 1rem;">
  255. <h4 class="ui header" style="border-bottom: 1px solid rgba(225, 227, 230, 100);padding: 0.5rem 0;">
  256. {{$lenCon := len .ContributorInfo}}
  257. {{if lt $lenCon 25 }}
  258. <strong>{{.i18n.Tr "home.contributors"}} ({{len .ContributorInfo}})</strong>
  259. {{else}}
  260. <strong>{{.i18n.Tr "home.contributors"}} ({{len .ContributorInfo}}+)</strong>
  261. {{end}}
  262. <div class="ui right">
  263. <a class="membersmore text grey" href="{{.RepoLink}}/contributors?type={{if .IsViewBranch}}branch{{else}}tag{{end}}&name={{.BranchName}}">{{.i18n.Tr "repo.computing.all"}} {{svg "octicon-chevron-right" 16}}</a>
  264. </div>
  265. </h4>
  266. <div class="ui members" id="contributorInfo">
  267. {{range .ContributorInfo}}
  268. {{if .UserInfo}}
  269. <a href="{{AppSubUrl}}/{{.UserInfo.Name}}"><img class="ui avatar image" src="{{.UserInfo.RelAvatarLink}}"></a>
  270. {{else if .Email}}
  271. <a href="mailto:{{.Email}}" class="circular ui button">{{.Email}}</a>
  272. {{end}}
  273. {{end}}
  274. </div>
  275. <div style="clear: both;"></div>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. {{template "base/footer" .}}