diff --git a/appview/pages/templates/repo/blob.html b/appview/pages/templates/repo/blob.html index 62edd4f0..6e85f854 100644 --- a/appview/pages/templates/repo/blob.html +++ b/appview/pages/templates/repo/blob.html @@ -13,54 +13,6 @@ {{ define "repoContent" }} {{ $linkstyle := "no-underline hover:underline" }} - {{ if .LastCommitInfo }} -
-
- {{ $messageParts := splitN .LastCommitInfo.Message "\n\n" 2 }} -
- - {{ index $messageParts 0 }} - - {{ if gt (len $messageParts) 1 }} - - {{ end }} -
- {{ if gt (len $messageParts) 1 }} - - {{ end }} -
-
- {{ if .LastCommit.Author }} - {{ $authorDid := index .EmailToDid .LastCommit.Author.Email }} - - {{ if $authorDid }} - {{ template "user/fragments/picHandleLink" $authorDid }} - {{ else }} - {{ placeholderAvatar "tiny" }} - {{ .LastCommit.Author.Name }} - {{ end }} - - - {{ end }} - {{ template "repo/fragments/time" .LastCommitInfo.When }} - - - - {{ slice .LastCommitInfo.Hash.String 0 8 }} - - -
-
- {{ end }} -
+ + {{ if .LastCommitInfo }} + {{ template "repo/fragments/lastCommitPanel" $ }} + {{ end }} + {{ if .BlobView.IsUnsupported }}

Previews are not supported for this file type. diff --git a/appview/pages/templates/repo/fragments/lastCommitPanel.html b/appview/pages/templates/repo/fragments/lastCommitPanel.html new file mode 100644 index 00000000..4a3c4eb0 --- /dev/null +++ b/appview/pages/templates/repo/fragments/lastCommitPanel.html @@ -0,0 +1,29 @@ +{{ define "repo/fragments/lastCommitPanel" }} + {{ $messageParts := splitN .LastCommitInfo.Message "\n\n" 2 }} +

+
+ {{ if .LastCommitInfo.Author }} + {{ $authorDid := index .EmailToDid .LastCommitInfo.Author.Email }} + + {{ if $authorDid }} + {{ template "user/fragments/picHandleLink" $authorDid }} + {{ else }} + {{ placeholderAvatar "tiny" }} + {{ .LastCommitInfo.Author.Name }} + {{ end }} + + + {{ end }} + + {{ index $messageParts 0 }} + + + {{ template "repo/fragments/time" .LastCommitInfo.When }} +
+ + {{ slice .LastCommitInfo.Hash.String 0 8 }} + +
+{{ end }}