From 56590c673f98105096c5e235191f099133b93ff5 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Thu, 17 Jul 2025 18:09:24 +0100 Subject: [PATCH] appview/pages: move fileTree to the left of diff and interdiff Change-Id: qkpqsrknozxstvnzplplvvvwzzxupmry Signed-off-by: oppiliappan --- appview/pages/templates/layouts/base.html | 52 ++-- appview/pages/templates/layouts/repobase.html | 2 +- appview/pages/templates/layouts/topbar.html | 2 +- appview/pages/templates/repo/commit.html | 50 +++- .../pages/templates/repo/compare/compare.html | 49 +++- .../pages/templates/repo/fragments/diff.html | 253 +++++++++--------- .../repo/fragments/diffChangedFiles.html | 15 ++ .../{filetree.html => fileTree.html} | 8 +- .../templates/repo/fragments/interdiff.html | 180 +++++-------- .../repo/fragments/interdiffFiles.html | 11 + .../repo/pulls/fragments/pullStack.html | 1 - .../pages/templates/repo/pulls/interdiff.html | 51 +++- appview/pages/templates/repo/pulls/patch.html | 50 +++- 13 files changed, 439 insertions(+), 285 deletions(-) create mode 100644 appview/pages/templates/repo/fragments/diffChangedFiles.html rename appview/pages/templates/repo/fragments/{filetree.html => fileTree.html} (78%) create mode 100644 appview/pages/templates/repo/fragments/interdiffFiles.html diff --git a/appview/pages/templates/layouts/base.html b/appview/pages/templates/layouts/base.html index 657a7ec..90019f3 100644 --- a/appview/pages/templates/layouts/base.html +++ b/appview/pages/templates/layouts/base.html @@ -15,19 +15,21 @@ {{ block "extrameta" . }}{{ end }} -
-
- {{ block "topbarLeft" . }} {{ end }} -
-
- {{ block "topbar" . }} - {{ template "layouts/topbar" . }} - {{ end }} -
-
- {{ block "topbarRight" . }} {{ end }} + {{ block "topbarLayout" . }} +
+
+ {{ block "topbarLeft" . }} {{ end }} +
+
+ {{ block "topbar" . }} + {{ template "layouts/topbar" . }} + {{ end }} +
+
+ {{ block "topbarRight" . }} {{ end }} +
-
+ {{ end }}
{{ block "contentLayout" . }} @@ -59,19 +61,21 @@ {{ end }}
-
-
- {{ block "footerLeft" . }} {{ end }} -
-
- {{ block "footer" . }} - {{ template "layouts/footer" . }} - {{ end }} -
-
- {{ block "footerRight" . }} {{ end }} + {{ block "footerLayout" . }} +
+
+ {{ block "footerLeft" . }} {{ end }} +
+
+ {{ block "footer" . }} + {{ template "layouts/footer" . }} + {{ end }} +
+
+ {{ block "footerRight" . }} {{ end }} +
-
+ {{ end }} diff --git a/appview/pages/templates/layouts/repobase.html b/appview/pages/templates/layouts/repobase.html index 60099e4..502a681 100644 --- a/appview/pages/templates/layouts/repobase.html +++ b/appview/pages/templates/layouts/repobase.html @@ -47,7 +47,7 @@ {{ if eq $.Active $key }} {{ $activeTabStyles }} {{ else }} - group-hover:bg-gray-200 dark:group-hover:bg-gray-700 + group-hover:bg-gray-100/25 group-hover:dark:bg-gray-700/25 {{ end }} " > diff --git a/appview/pages/templates/layouts/topbar.html b/appview/pages/templates/layouts/topbar.html index d2db845..cbc1fce 100644 --- a/appview/pages/templates/layouts/topbar.html +++ b/appview/pages/templates/layouts/topbar.html @@ -1,6 +1,6 @@ {{ define "layouts/topbar" }}
- - {{ end }} + + {{ end }} {{ end }} {{ end }} diff --git a/appview/pages/templates/repo/fragments/interdiffFiles.html b/appview/pages/templates/repo/fragments/interdiffFiles.html new file mode 100644 index 0000000..4cb26f1 --- /dev/null +++ b/appview/pages/templates/repo/fragments/interdiffFiles.html @@ -0,0 +1,11 @@ +{{ define "repo/fragments/interdiffFiles" }} +{{ $fileTree := fileTree .AffectedFiles }} +
+
+
+ files +
+ {{ template "repo/fragments/fileTree" $fileTree }} +
+
+{{ end }} diff --git a/appview/pages/templates/repo/pulls/fragments/pullStack.html b/appview/pages/templates/repo/pulls/fragments/pullStack.html index 4de5e43..1c85623 100644 --- a/appview/pages/templates/repo/pulls/fragments/pullStack.html +++ b/appview/pages/templates/repo/pulls/fragments/pullStack.html @@ -1,5 +1,4 @@ {{ define "repo/pulls/fragments/pullStack" }} -
diff --git a/appview/pages/templates/repo/pulls/interdiff.html b/appview/pages/templates/repo/pulls/interdiff.html index 7628786..da4cb52 100644 --- a/appview/pages/templates/repo/pulls/interdiff.html +++ b/appview/pages/templates/repo/pulls/interdiff.html @@ -26,8 +26,53 @@ -
- {{ template "repo/fragments/interdiff" (list .RepoInfo.FullName .Interdiff) }} -
{{ end }} +{{ define "topbarLayout" }} +
+
+ {{ block "topbar" . }} + {{ template "layouts/topbar" . }} + {{ end }} +
+
+{{ end }} + +{{ define "contentLayout" }} +
+
+ {{ block "content" . }}{{ end }} +
+
+{{ end }} + +{{ block "contentAfterLayout" . }} +
+
+ {{ block "contentAfterLeft" . }} {{ end }} +
+
+ {{ block "contentAfter" . }}{{ end }} +
+
+{{ end }} + +{{ block "footerLayout" . }} +
+
+ {{ block "footer" . }} + {{ template "layouts/footer" . }} + {{ end }} +
+
+{{ end }} + +{{ define "contentAfter" }} + {{ template "repo/fragments/interdiff" (list .RepoInfo.FullName .Interdiff .DiffOpts) }} +{{end}} + +{{ define "contentAfterLeft" }} +
+ {{ template "repo/fragments/interdiffFiles" .Interdiff }} +
+{{end}} diff --git a/appview/pages/templates/repo/pulls/patch.html b/appview/pages/templates/repo/pulls/patch.html index d4ff5c4..886fab6 100644 --- a/appview/pages/templates/repo/pulls/patch.html +++ b/appview/pages/templates/repo/pulls/patch.html @@ -31,6 +31,54 @@
{{ template "repo/pulls/fragments/pullHeader" . }} - {{ template "repo/fragments/diff" (list .RepoInfo.FullName .Diff) }} {{ end }} + +{{ define "topbarLayout" }} +
+
+ {{ block "topbar" . }} + {{ template "layouts/topbar" . }} + {{ end }} +
+
+{{ end }} + +{{ define "contentLayout" }} +
+
+ {{ block "content" . }}{{ end }} +
+
+{{ end }} + +{{ block "contentAfterLayout" . }} +
+
+ {{ block "contentAfterLeft" . }} {{ end }} +
+
+ {{ block "contentAfter" . }}{{ end }} +
+
+{{ end }} + +{{ block "footerLayout" . }} +
+
+ {{ block "footer" . }} + {{ template "layouts/footer" . }} + {{ end }} +
+
+{{ end }} + +{{ define "contentAfter" }} + {{ template "repo/fragments/diff" (list .RepoInfo.FullName .Diff) }} +{{end}} + +{{ define "contentAfterLeft" }} +
+ {{ template "repo/fragments/diffChangedFiles" .Diff }} +
+{{end}} -- 2.43.0