From f502a110fcbfdd18ab7b793d2fe70c445af4f43e Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 12 Jan 2024 04:44:06 +0100 Subject: [PATCH] Revamp repo header (#27760) Redesign repo header with following new aspects: - responsive & better-looking repo title - hide repo button text instead of icons in mobile view - use same tab style as on explore and org page
Before: ![grafik](https://github.com/go-gitea/gitea/assets/47871822/57360b77-d43c-49ac-b798-2363c03da7ec) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d4117f79-a5f5-4f36-bf65-bbada3e7e73b) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/e26f967f-e264-4337-9925-3d942e04fd6d) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/b4683c8d-9c6a-4089-afa7-8dd219e43a46)
After: ![grafik](https://github.com/go-gitea/gitea/assets/47871822/8ddbc9f6-53c7-4e4e-bea9-704fd93524ca) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/c0588aa9-788d-469c-98a0-81484fbd220c) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/206e931e-404d-4d1b-92ce-908698addfcc) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/a508f9c8-fadc-4a85-94ba-18796f77e07b) --- templates/repo/header.tmpl | 90 +++++++++++++++++--------------- web_src/css/base.css | 17 ------ web_src/css/index.css | 1 + web_src/css/repo.css | 93 --------------------------------- web_src/css/repo/header.css | 101 ++++++++++++++++++++++++++++++++++++ 5 files changed, 149 insertions(+), 153 deletions(-) create mode 100644 web_src/css/repo/header.css diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index af00b2b3831ea..9630cd3a6f769 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -2,35 +2,32 @@ {{with .Repository}}
-
-
-
- {{template "repo/icon" .}} -
- {{.Owner.Name}} -
/
- {{.Name}} -
- {{if .IsArchived}} - {{ctx.Locale.Tr "repo.desc.archived"}} - {{end}} - {{if .IsPrivate}} - {{ctx.Locale.Tr "repo.desc.private"}} - {{else}} - {{if .Owner.Visibility.IsPrivate}} - {{ctx.Locale.Tr "repo.desc.internal"}} - {{end}} - {{end}} - {{if .IsTemplate}} - {{ctx.Locale.Tr "repo.desc.template"}} +
+
{{template "repo/icon" .}}
+ +
+ {{if .IsArchived}} + {{ctx.Locale.Tr "repo.desc.archived"}} +
{{svg "octicon-archive" 18}}
+ {{end}} + {{if .IsPrivate}} + {{ctx.Locale.Tr "repo.desc.private"}} +
{{svg "octicon-lock" 18}}
+ {{else}} + {{if .Owner.Visibility.IsPrivate}} + {{ctx.Locale.Tr "repo.desc.internal"}} +
{{svg "octicon-shield-lock" 18}}
{{end}} -
+ {{end}} + {{if .IsTemplate}} + {{ctx.Locale.Tr "repo.desc.template"}} +
{{svg "octicon-repo-template" 18}}
+ {{end}}
- {{if $.PullMirror}} -
{{ctx.Locale.Tr "repo.mirror_from"}} {{$.PullMirror.RemoteAddress}}
- {{end}} - {{if .IsFork}}
{{ctx.Locale.Tr "repo.forked_from"}} {{.BaseRepo.FullName}}
{{end}} - {{if .IsGenerated}}
{{ctx.Locale.Tr "repo.generated_from"}} {{(.TemplateRepo ctx).FullName}}
{{end}}
{{if not (or .IsBeingCreated .IsBroken)}} +
+ {{if $.PullMirror}}
{{ctx.Locale.Tr "repo.mirror_from"}} {{$.PullMirror.RemoteAddress}}
{{end}} + {{if .IsFork}}
{{ctx.Locale.Tr "repo.forked_from"}} {{.BaseRepo.FullName}}
{{end}} + {{if .IsGenerated}}
{{ctx.Locale.Tr "repo.generated_from"}} {{(.TemplateRepo ctx).FullName}}
{{end}} +
{{end}} -
+