From 34f60c598f81aaf8969cc93438e61f7ccd03622d Mon Sep 17 00:00:00 2001 From: puni9869 Date: Fri, 30 Jun 2023 00:07:34 +0530 Subject: [PATCH 1/3] Adding translation for branch name copy and button in branches screen --- templates/repo/branch/list.tmpl | 17 +++++++++++++---- web_src/css/repo.css | 10 ++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index cf81f461327d7..fb946d550dae6 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -22,7 +22,10 @@ {{if .DefaultBranchBranch.IsProtected}} {{svg "octicon-shield-lock"}} {{end}} - {{.DefaultBranchBranch.DBBranch.Name}} +
+ {{.DefaultBranchBranch.DBBranch.Name}} + +

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

@@ -76,14 +79,20 @@ {{if .DBBranch.IsDeleted}} - {{.DBBranch.Name}} +
+ {{.DBBranch.Name}} + +

{{$.locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix $.locale}}

{{else}} {{if .IsProtected}} {{svg "octicon-shield-lock"}} {{end}} - {{.DBBranch.Name}} -

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

+
+ {{.DBBranch.Name}} + +
+

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

{{end}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index e20355dbc3bd7..b6f839a31c4ff 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -549,6 +549,16 @@ margin-top: -8px; } +.branch-detail { + display: flex; + align-items: center; +} + +.branch-link { + overflow: hidden; + text-overflow: ellipsis; +} + .repository.file.editor .commit-form-wrapper .commit-form .quick-pull-choice .branch-name { display: inline-block; padding: 2px 4px; From b35e3814690c45c23088c8a39be05460aef71599 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Fri, 30 Jun 2023 00:20:21 +0530 Subject: [PATCH 2/3] Adding class to default branch anchor tag --- templates/repo/branch/list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index fb946d550dae6..ecc848e49664f 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -23,7 +23,7 @@ {{svg "octicon-shield-lock"}} {{end}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

From 1b3a38c7df0d0992bf9939c4fa74ebac5e44eaec Mon Sep 17 00:00:00 2001 From: puni9869 Date: Fri, 30 Jun 2023 00:55:23 +0530 Subject: [PATCH 3/3] Using built-in classes and reverting custom classes --- templates/repo/branch/list.tmpl | 12 ++++++------ web_src/css/repo.css | 10 ---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index ecc848e49664f..b03c8aa566871 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -22,8 +22,8 @@ {{if .DefaultBranchBranch.IsProtected}} {{svg "octicon-shield-lock"}} {{end}} -
- {{.DefaultBranchBranch.DBBranch.Name}} +
+ {{.DefaultBranchBranch.DBBranch.Name}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

@@ -79,8 +79,8 @@ {{if .DBBranch.IsDeleted}} -
- {{.DBBranch.Name}} +
+ {{.DBBranch.Name}}

{{$.locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix $.locale}}

@@ -88,8 +88,8 @@ {{if .IsProtected}} {{svg "octicon-shield-lock"}} {{end}} -
- {{.DBBranch.Name}} +
+ {{.DBBranch.Name}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

diff --git a/web_src/css/repo.css b/web_src/css/repo.css index b6f839a31c4ff..e20355dbc3bd7 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -549,16 +549,6 @@ margin-top: -8px; } -.branch-detail { - display: flex; - align-items: center; -} - -.branch-link { - overflow: hidden; - text-overflow: ellipsis; -} - .repository.file.editor .commit-form-wrapper .commit-form .quick-pull-choice .branch-name { display: inline-block; padding: 2px 4px;