From 7d192cb674bc475b123c84b205aca821247c5dd1 Mon Sep 17 00:00:00 2001 From: JakobDev Date: Mon, 5 Jun 2023 08:25:46 +0200 Subject: [PATCH] Add Progressbar to Milestone Page (#25050) This is adds the progress bar, which is already on the Milestone List, also to the Page of a Single Milestone. ![grafik](https://github.com/go-gitea/gitea/assets/15185051/24e0fa28-369b-4bb9-807a-ee823b46ba81) --------- Co-authored-by: silverwind --- options/locale/locale_en-US.ini | 2 +- templates/repo/issue/milestone_issues.tmpl | 38 ++++++++++++---------- web_src/css/repo.css | 5 +++ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 2746e53023..0abf1b3e05 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1759,7 +1759,7 @@ milestones.no_due_date = No due date milestones.open = Open milestones.close = Close milestones.new_subheader = Milestones organize issues and track progress. -milestones.completeness = %d%% Completed +milestones.completeness = %d%% Completed milestones.create = Create Milestone milestones.title = Title milestones.desc = Description diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index 82d2cac943..3a103bd5e0 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -3,7 +3,7 @@ {{template "repo/header" .}}
-

{{.Milestone.Name}}

+

{{.Milestone.Name}}

{{if not .Repository.IsArchived}}
{{if or .CanWriteIssues .CanWritePulls}} @@ -20,26 +20,28 @@
{{end}}
-
-
- {{.Milestone.RenderedContent|Str2html}} -
+ {{if .Milestone.RenderedContent}} +
+ {{.Milestone.RenderedContent|Str2html}}
-
-
- {{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale}} - {{if .IsClosed}} - {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} - {{else}} - {{svg "octicon-calendar"}} - {{if .Milestone.DeadlineString}} - {{DateTime "short" .Milestone.DeadlineString}} + {{end}} +
+ +
+
+ {{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale}} + {{if .IsClosed}} + {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}} {{else}} - {{$.locale.Tr "repo.milestones.no_due_date"}} + {{svg "octicon-calendar"}} + {{if .Milestone.DeadlineString}} + {{DateTime "short" .Milestone.DeadlineString}} + {{else}} + {{$.locale.Tr "repo.milestones.no_due_date"}} + {{end}} {{end}} - {{end}} -   - {{.locale.Tr "repo.milestones.completeness" .Milestone.Completeness}} +
+
{{.locale.Tr "repo.milestones.completeness" .Milestone.Completeness | Safe}}
diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 71cd7a2846..b2b544a7ea 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -1225,6 +1225,11 @@ height: 200px; } +.milestone-progress-big { + width: min(420px, 96vw); + height: 10px; +} + .repository.compare.pull .show-form-container { text-align: left; }