From 6066d191dcc3b9081de8749a4f13b51f3a887e65 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 1 Aug 2022 21:38:44 +0200 Subject: [PATCH 1/3] Rework repo buttons - Replace "New PR" and "Go to File" button with Icon Button - Move all "Add File" actions into a dropdown button - Remove most custom styling of clone buttons Buttons are now all equal height, mobile layout wraps gracefully. Fixes: https://github.com/go-gitea/gitea/issues/13671 Replaces: https://github.com/go-gitea/gitea/pull/20375 --- options/locale/locale_en-US.ini | 1 + templates/repo/branch_dropdown.tmpl | 11 ++-- templates/repo/clone_buttons.tmpl | 10 +-- templates/repo/commits.tmpl | 6 +- templates/repo/home.tmpl | 99 ++++++++++++++--------------- templates/repo/sub_menu.tmpl | 2 +- templates/repo/view_list.tmpl | 2 +- templates/repo/wiki/view.tmpl | 6 +- web_src/js/features/repo-common.js | 2 +- web_src/less/_base.less | 13 ++++ web_src/less/_repository.less | 88 ++++++------------------- web_src/less/helpers.less | 1 + 12 files changed, 102 insertions(+), 139 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index b6f00727ea75..74bfb54a45c3 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1063,6 +1063,7 @@ normal_view = Normal View line = line lines = lines +editor.add_file = Add File editor.new_file = New File editor.upload_file = Upload File editor.edit_file = Edit File diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index afdaae0f05f4..9d1ec10d3cec 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -1,5 +1,6 @@ {{$release := .release}} {{$defaultBranch := $.root.BranchName}}{{if and .root.IsViewTag (not .noTag)}}{{$defaultBranch = .root.TagName}}{{end}}{{if eq $defaultBranch ""}}{{$defaultBranch = $.root.Repository.DefaultBranch}}{{end}} +{{$type := ""}}{{if and .root.IsViewTag (not .noTag)}}{{$type = "tag"}}{{else if .root.IsViewBranch}}{{$type = "branch"}}{{else}}{{$type = "tree"}}{{end}} {{$showBranchesInDropdown := not .root.HideBranchesInDropdown}}