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 14 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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>{{.i18n.Tr "repo.issues.new.add_labels_title"}}{{end}}
  121. </a>
  122. <div id="topic_edit" class="vue_menu" style="display:none;">
  123. <div id="topic_edit1">
  124. </div>
  125. </div>
  126. </div>
  127. <div class="ui mobile reversed stackable grid" style="margin-top: -1.5rem;">
  128. {{ $n := len .TreeNames}}
  129. {{ $l := Subtract $n 1}}
  130. <!-- If home page, show new PR. If not, show breadcrumb -->
  131. <div class="ui ten wide tablet twelve wide computer column text right" style="margin-top: 1rem;">
  132. <div class="right fitted item" id="file-buttons">
  133. <div class="ui tiny blue buttons">
  134. {{if .Repository.CanEnableEditor}}
  135. {{if .CanAddFile}}
  136. <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  137. {{.i18n.Tr "repo.editor.new_file"}}
  138. </a>
  139. {{end}}
  140. {{if .CanUploadFile}}
  141. <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  142. {{.i18n.Tr "repo.editor.upload_file"}}
  143. </a>
  144. {{end}}
  145. {{end}}
  146. {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }}
  147. <a href="{{.RepoLink}}/commits/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}" class="ui button">
  148. {{.i18n.Tr "repo.file_history"}}
  149. </a>
  150. {{end}}
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="ui container">
  156. <div class="ui mobile reversed stackable grid">
  157. <div class="ui ten wide tablet twelve wide computer column">
  158. {{if .IsViewFile}}
  159. {{template "repo/view_file" .}}
  160. {{else if .IsBlame}}
  161. {{template "repo/blame" .}}
  162. {{else}}
  163. <table id="repo-files-table" class="ui single line table">
  164. <thead>
  165. <tr class="commit-list">
  166. <th colspan="2">
  167. {{if .LatestCommitUser}}
  168. <img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" />
  169. {{if .LatestCommitUser.FullName}}
  170. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
  171. {{else}}
  172. <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
  173. {{end}}
  174. {{else}}
  175. {{if .LatestCommit.Author}}
  176. <img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
  177. <strong>{{.LatestCommit.Author.Name}}</strong>
  178. {{end}}
  179. {{end}}
  180. {{if .LatestCommit.Author}}
  181. <span style="margin: 0 0.5rem;color: #767676">{{TimeSince .LatestCommit.Author.When $.Lang}}</span>
  182. {{end}}
  183. {{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }}
  184. <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
  185. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  186. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  187. <pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  188. {{end}}
  189. </span>
  190. </th>
  191. </tr>
  192. </thead>
  193. <tbody>
  194. {{if .HasParentPath}}
  195. <tr class="has-parent">
  196. <td colspan="3">{{svg "octicon-mail-reply" 16}}<a href="{{EscapePound .BranchLink}}{{.ParentPath}}">..</a></td>
  197. </tr>
  198. {{end}}
  199. {{range $item := .Files}}
  200. {{$entry := index $item 0}}
  201. {{$commit := index $item 1}}
  202. <tr>
  203. {{if $entry.IsSubModule}}
  204. <td>
  205. <span class="truncate">
  206. {{svg "octicon-inbox" 16}}
  207. {{$refURL := $commit.RefURL AppUrl $.Repository.FullName}}
  208. {{if $refURL}}
  209. <a href="{{$refURL}}">{{$entry.Name}}</a> @ <a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
  210. {{else}}
  211. {{$entry.Name}} @ {{ShortSha $commit.RefID}}
  212. {{end}}
  213. </span>
  214. </td>
  215. {{else}}
  216. <td class="name thirteen wide">
  217. <span class="truncate">
  218. {{if $entry.IsDir}}
  219. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  220. {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
  221. {{svg "octicon-file-directory" 16}}
  222. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}">
  223. {{if eq (len $subJumpablePath) 2}}
  224. <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
  225. {{else}}
  226. {{index $subJumpablePath 0}}
  227. {{end}}
  228. </a>
  229. {{else}}
  230. <i class="ri-file-pdf-line" style="font-size: 16px;margin-left: 3px;margin-right: 5px;vertical-align: text-top;color: #FA8C16;"></i>
  231. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
  232. {{end}}
  233. </span>
  234. </td>
  235. {{end}}
  236. <td class="text right age one wide" style="text-align: right;">{{TimeSince $commit.Committer.When $.Lang}}</td>
  237. </tr>
  238. {{end}}
  239. </tbody>
  240. </table>
  241. {{if .ReadmeExist}}
  242. {{template "repo/view_file" .}}
  243. {{end}}
  244. {{end}}
  245. </div>
  246. <!-- 贡献者框 -->
  247. <div class="ui six wide tablet four wide computer column">
  248. <div style="border-radius: 5px;border: 1px solid rgba(225, 227, 230, 100);padding: 1rem;">
  249. <h4 class="ui header" style="border-bottom: 1px solid rgba(225, 227, 230, 100);padding: 0.5rem 0;">
  250. {{$lenCon := len .ContributorInfo}}
  251. {{if lt $lenCon 25 }}
  252. <strong>{{.i18n.Tr "home.contributors"}} ({{len .ContributorInfo}})</strong>
  253. {{else}}
  254. <strong>{{.i18n.Tr "home.contributors"}} ({{len .ContributorInfo}}+)</strong>
  255. {{end}}
  256. <div class="ui right">
  257. <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>
  258. </div>
  259. </h4>
  260. <div class="ui members" id="contributorInfo">
  261. {{range .ContributorInfo}}
  262. {{if .UserInfo}}
  263. <a href="{{AppSubUrl}}/{{.UserInfo.Name}}"><img class="ui avatar image" src="{{.UserInfo.RelAvatarLink}}"></a>
  264. {{else if .Email}}
  265. <a href="mailto:{{.Email}}" class="circular ui button">{{.Email}}</a>
  266. {{end}}
  267. {{end}}
  268. </div>
  269. <div style="clear: both;"></div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. {{template "base/footer" .}}