diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index cc36fa4eea1d3..4e6d375b51710 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -102,8 +102,7 @@ {{end}} - {{/* by default, the row-right flex grows, but on non-root tree path, it should not because the row-left might contain a long path */}} -
-
-
-
- {{template "repo/latest_commit" .}}
-
- |
- {{if .LatestCommit}}{{if .LatestCommit.Committer}}{{DateUtils.TimeSince .LatestCommit.Committer.When}}{{end}}{{end}} | -|
---|---|---|
{{svg "octicon-reply"}}.. | -||
-
- {{if $entry.IsSubModule}}
- {{svg "octicon-file-submodule"}}
- {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{/* FIXME: the usage of AppUrl seems incorrect, it would be fixed in the future, use AppSubUrl instead */}}
- {{if $refURL}}
- {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}}
+
+ {{if $entry.IsSubModule}}
+ {{svg "octicon-file-submodule"}}
+ {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{/* FIXME: the usage of AppUrl seems incorrect, it would be fixed in the future, use AppSubUrl instead */}}
+ {{if $refURL}}
+ {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}}
+ {{else}}
+ {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}}
+ {{end}}
+ {{else}}
+ {{if $entry.IsDir}}
+ {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
+ {{svg "octicon-file-directory-fill"}}
+
+ {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}}
+ {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}}
+ {{if eq $subJumpablePathFieldLast 0}}
+ {{$subJumpablePathName}}
{{else}}
- {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}}
+ {{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast}}
+ {{StringUtils.Join $subJumpablePathPrefixes "/"}}/{{index $subJumpablePathFields $subJumpablePathFieldLast}}
{{end}}
- {{else}}
- {{if $entry.IsDir}}
- {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
- {{svg "octicon-file-directory-fill"}}
-
- {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}}
- {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}}
- {{if eq $subJumpablePathFieldLast 0}}
- {{$subJumpablePathName}}
- {{else}}
- {{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast}}
- {{StringUtils.Join $subJumpablePathPrefixes "/"}}/{{index $subJumpablePathFields $subJumpablePathFieldLast}}
- {{end}}
-
- {{else}}
- {{svg (printf "octicon-%s" (EntryIcon $entry))}}
- {{$entry.Name}}
- {{end}}
- {{end}}
-
- |
- - - {{if $commit}} - {{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}} - {{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.Message $commitLink ($.Repository.ComposeMetas ctx)}} - {{else}} - - {{end}} - - | -{{if $commit}}{{DateUtils.TimeSince $commit.Committer.When}}{{end}} | -