From d5ce4c8f0b6d22c2a674bf6a2599df55644be34c Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 20 Jan 2022 10:35:04 +0800 Subject: [PATCH] fix issue --- templates/repo/courseHome.tmpl | 301 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 301 insertions(+) create mode 100644 templates/repo/courseHome.tmpl diff --git a/templates/repo/courseHome.tmpl b/templates/repo/courseHome.tmpl new file mode 100644 index 000000000..3f2cbe01a --- /dev/null +++ b/templates/repo/courseHome.tmpl @@ -0,0 +1,301 @@ +{{template "base/head" .}} + +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{.i18n.Tr "repo.topic.count_prompt"}} + {{.i18n.Tr "repo.topic.format_prompt"}} +
+ {{if .Repository.IsArchived}} +
+ {{.i18n.Tr "repo.archive.title"}} +
+ {{end}} +
+ 简介: + {{if .Repository.DescriptionHTML}} + {{.Repository.DescriptionHTML}} + {{else}} + {{.i18n.Tr "repo.no_desc"}} + {{end}} + +
+ + + + +
+ + {{ $n := len .TreeNames}} + {{ $l := Subtract $n 1}} + +
+
+
+ {{if .Repository.CanEnableEditor}} + {{if .CanAddFile}} + + {{.i18n.Tr "repo.editor.new_file"}} + + {{end}} + {{if .CanUploadFile}} + + {{.i18n.Tr "repo.editor.upload_file"}} + + {{end}} + {{end}} + {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }} + + {{.i18n.Tr "repo.file_history"}} + + {{end}} +
+
+
+ + +
+
+
+
+ {{if .IsViewFile}} + {{template "repo/view_file" .}} + {{else if .IsBlame}} + {{template "repo/blame" .}} + {{else}} + + + + + + + + + {{if .HasParentPath}} + + + + {{end}} + {{range $item := .Files}} + {{$entry := index $item 0}} + {{$commit := index $item 1}} + + {{if $entry.IsSubModule}} + + {{else}} + + {{end}} + + + + + {{end}} + +
+ {{if .LatestCommitUser}} + + {{if .LatestCommitUser.FullName}} + {{.LatestCommitUser.FullName}} + {{else}} + {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} + {{end}} + {{else}} + + {{if .LatestCommit.Author}} + + {{.LatestCommit.Author.Name}} + {{end}} + {{end}} + + {{if .LatestCommit.Author}} + {{TimeSince .LatestCommit.Author.When $.Lang}} + {{end}} + {{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }} + {{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}} + {{if IsMultilineCommitMessage .LatestCommit.Message}} + + + {{end}} + +
{{svg "octicon-mail-reply" 16}}..
+ + {{svg "octicon-inbox" 16}} + {{$refURL := $commit.RefURL AppUrl $.Repository.FullName}} + {{if $refURL}} + {{$entry.Name}} @ {{ShortSha $commit.RefID}} + {{else}} + {{$entry.Name}} @ {{ShortSha $commit.RefID}} + {{end}} + + + + {{if $entry.IsDir}} + {{$subJumpablePathName := $entry.GetSubJumpablePathName}} + {{$subJumpablePath := SubJumpablePath $subJumpablePathName}} + {{svg "octicon-file-directory" 16}} + + {{if eq (len $subJumpablePath) 2}} + {{index $subJumpablePath 0}}{{index $subJumpablePath 1}} + {{else}} + {{index $subJumpablePath 0}} + {{end}} + + {{else}} + + + {{$entry.Name}} + {{end}} + + {{TimeSince $commit.Committer.When $.Lang}}
+ {{if .ReadmeExist}} + {{template "repo/view_file" .}} + {{end}} + {{end}} +
+ +
+
+

+ {{$lenCon := len .ContributorInfo}} + {{if lt $lenCon 25 }} + 贡献者 ({{len .ContributorInfo}}) + {{else}} + 贡献者 ({{len .ContributorInfo}}+) + {{end}} + +

+
+ {{range .ContributorInfo}} + {{if .UserInfo}} + + {{else if .Email}} + {{.Email}} + {{end}} + {{end}} +
+
+
+
+
+
+ +
+
+ +{{template "base/footer" .}}