From 377d160baa6d640d87457c11b99dbb54d9d0baa7 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Tue, 6 Jun 2023 03:39:16 +0200 Subject: [PATCH 01/20] Show total TrackedTime in issue list and milestone issue list [partial frontport] --- models/issues/issue_stats.go | 97 ++++++++++++++++++----------------- models/issues/tracked_time.go | 50 ++++++++++++++++++ 2 files changed, 99 insertions(+), 48 deletions(-) diff --git a/models/issues/issue_stats.go b/models/issues/issue_stats.go index 6c249c2244160..8f2820b281914 100644 --- a/models/issues/issue_stats.go +++ b/models/issues/issue_stats.go @@ -116,68 +116,69 @@ func GetIssueStats(opts *IssuesOptions) (*IssueStats, error) { func getIssueStatsChunk(opts *IssuesOptions, issueIDs []int64) (*IssueStats, error) { stats := &IssueStats{} - countSession := func(opts *IssuesOptions, issueIDs []int64) *xorm.Session { - sess := db.GetEngine(db.DefaultContext). - Join("INNER", "repository", "`issue`.repo_id = `repository`.id") - if len(opts.RepoIDs) > 1 { - sess.In("issue.repo_id", opts.RepoIDs) - } else if len(opts.RepoIDs) == 1 { - sess.And("issue.repo_id = ?", opts.RepoIDs[0]) - } + sess := db.GetEngine(db.DefaultContext). + Join("INNER", "repository", "`issue`.repo_id = `repository`.id") - if len(issueIDs) > 0 { - sess.In("issue.id", issueIDs) - } + var err error + stats.OpenCount, err = applyIssueStatsOptions(sess, opts, issueIDs). + And("issue.is_closed = ?", false). + Count(new(Issue)) + if err != nil { + return stats, err + } + stats.ClosedCount, err = applyIssueStatsOptions(sess, opts, issueIDs). + And("issue.is_closed = ?", true). + Count(new(Issue)) + return stats, err +} - applyLabelsCondition(sess, opts) +func applyIssueStatsOptions(sess *xorm.Session, opts *IssuesOptions, issueIDs []int64) *xorm.Session { + if len(opts.RepoIDs) > 1 { + sess.In("issue.repo_id", opts.RepoIDs) + } else if len(opts.RepoIDs) == 1 { + sess.And("issue.repo_id = ?", opts.RepoIDs[0]) + } - applyMilestoneCondition(sess, opts) + if len(issueIDs) > 0 { + sess.In("issue.id", issueIDs) + } - applyProjectCondition(sess, opts) + applyLabelsCondition(sess, opts) - if opts.AssigneeID > 0 { - applyAssigneeCondition(sess, opts.AssigneeID) - } else if opts.AssigneeID == db.NoConditionID { - sess.Where("issue.id NOT IN (SELECT issue_id FROM issue_assignees)") - } + applyMilestoneCondition(sess, opts) - if opts.PosterID > 0 { - applyPosterCondition(sess, opts.PosterID) - } + applyProjectCondition(sess, opts) - if opts.MentionedID > 0 { - applyMentionedCondition(sess, opts.MentionedID) - } + if opts.AssigneeID > 0 { + applyAssigneeCondition(sess, opts.AssigneeID) + } else if opts.AssigneeID == db.NoConditionID { + sess.Where("issue.id NOT IN (SELECT issue_id FROM issue_assignees)") + } - if opts.ReviewRequestedID > 0 { - applyReviewRequestedCondition(sess, opts.ReviewRequestedID) - } + if opts.PosterID > 0 { + applyPosterCondition(sess, opts.PosterID) + } - if opts.ReviewedID > 0 { - applyReviewedCondition(sess, opts.ReviewedID) - } + if opts.MentionedID > 0 { + applyMentionedCondition(sess, opts.MentionedID) + } - switch opts.IsPull { - case util.OptionalBoolTrue: - sess.And("issue.is_pull=?", true) - case util.OptionalBoolFalse: - sess.And("issue.is_pull=?", false) - } + if opts.ReviewRequestedID > 0 { + applyReviewRequestedCondition(sess, opts.ReviewRequestedID) + } - return sess + if opts.ReviewedID > 0 { + applyReviewedCondition(sess, opts.ReviewedID) } - var err error - stats.OpenCount, err = countSession(opts, issueIDs). - And("issue.is_closed = ?", false). - Count(new(Issue)) - if err != nil { - return stats, err + switch opts.IsPull { + case util.OptionalBoolTrue: + sess.And("issue.is_pull=?", true) + case util.OptionalBoolFalse: + sess.And("issue.is_pull=?", false) } - stats.ClosedCount, err = countSession(opts, issueIDs). - And("issue.is_closed = ?", true). - Count(new(Issue)) - return stats, err + + return sess } // GetUserIssueStats returns issue statistic information for dashboard by given conditions. diff --git a/models/issues/tracked_time.go b/models/issues/tracked_time.go index 58c6b775f0778..ef109fc099375 100644 --- a/models/issues/tracked_time.go +++ b/models/issues/tracked_time.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/util" "xorm.io/builder" + "xorm.io/xorm" ) // TrackedTime represents a time that was spent for a specific issue. @@ -325,3 +326,52 @@ func GetTrackedTimeByID(id int64) (*TrackedTime, error) { } return time, nil } + +// GetIssueTotalTrackedTime returns the total tracked time for issues by given conditions. +func GetIssueTotalTrackedTime(opts *IssuesOptions, isClosed bool) (int64, error) { + if len(opts.IssueIDs) <= MaxQueryParameters { + return getIssueTotalTrackedTimeChunk(opts, isClosed, opts.IssueIDs) + } + + // If too long a list of IDs is provided, we get the statistics in + // smaller chunks and get accumulates. Note: this could potentially + // get us invalid results. The alternative is to insert the list of + // ids in a temporary table and join from them. + var accum int64 = 0 + for i := 0; i < len(opts.IssueIDs); { + chunk := i + MaxQueryParameters + if chunk > len(opts.IssueIDs) { + chunk = len(opts.IssueIDs) + } + time, err := getIssueTotalTrackedTimeChunk(opts, isClosed, opts.IssueIDs[i:chunk]) + if err != nil { + return 0, err + } + accum += time + i = chunk + } + return accum, nil +} + +func getIssueTotalTrackedTimeChunk(opts *IssuesOptions, isClosed bool, issueIDs []int64) (int64, error) { + sumSession := func(opts *IssuesOptions, issueIDs []int64) *xorm.Session { + sess := db.GetEngine(db.DefaultContext). + Table("tracked_time"). + Where("tracked_time.deleted = ?", false). + Join("INNER", "issue", "tracked_time.issue_id = issue.id") + + if len(issueIDs) > 0 { + sess.In("issue.id", issueIDs) + } + + return applyIssueStatsOptions(sess, opts, nil) + } + + type trackedTime struct { + Time int64 + } + + return sumSession(opts, issueIDs). + And("issue.is_closed = ?", isClosed). + SumInt(new(trackedTime), "tracked_time.time") +} From 056ea960ed3c0faf444eb622f53ba9a8c28a5ac2 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Wed, 23 Aug 2023 00:53:32 +0200 Subject: [PATCH 02/20] rm diff thats to be in next pull --- models/issues/tracked_time.go | 50 ----------------------------------- 1 file changed, 50 deletions(-) diff --git a/models/issues/tracked_time.go b/models/issues/tracked_time.go index ef109fc099375..58c6b775f0778 100644 --- a/models/issues/tracked_time.go +++ b/models/issues/tracked_time.go @@ -15,7 +15,6 @@ import ( "code.gitea.io/gitea/modules/util" "xorm.io/builder" - "xorm.io/xorm" ) // TrackedTime represents a time that was spent for a specific issue. @@ -326,52 +325,3 @@ func GetTrackedTimeByID(id int64) (*TrackedTime, error) { } return time, nil } - -// GetIssueTotalTrackedTime returns the total tracked time for issues by given conditions. -func GetIssueTotalTrackedTime(opts *IssuesOptions, isClosed bool) (int64, error) { - if len(opts.IssueIDs) <= MaxQueryParameters { - return getIssueTotalTrackedTimeChunk(opts, isClosed, opts.IssueIDs) - } - - // If too long a list of IDs is provided, we get the statistics in - // smaller chunks and get accumulates. Note: this could potentially - // get us invalid results. The alternative is to insert the list of - // ids in a temporary table and join from them. - var accum int64 = 0 - for i := 0; i < len(opts.IssueIDs); { - chunk := i + MaxQueryParameters - if chunk > len(opts.IssueIDs) { - chunk = len(opts.IssueIDs) - } - time, err := getIssueTotalTrackedTimeChunk(opts, isClosed, opts.IssueIDs[i:chunk]) - if err != nil { - return 0, err - } - accum += time - i = chunk - } - return accum, nil -} - -func getIssueTotalTrackedTimeChunk(opts *IssuesOptions, isClosed bool, issueIDs []int64) (int64, error) { - sumSession := func(opts *IssuesOptions, issueIDs []int64) *xorm.Session { - sess := db.GetEngine(db.DefaultContext). - Table("tracked_time"). - Where("tracked_time.deleted = ?", false). - Join("INNER", "issue", "tracked_time.issue_id = issue.id") - - if len(issueIDs) > 0 { - sess.In("issue.id", issueIDs) - } - - return applyIssueStatsOptions(sess, opts, nil) - } - - type trackedTime struct { - Time int64 - } - - return sumSession(opts, issueIDs). - And("issue.is_closed = ?", isClosed). - SumInt(new(trackedTime), "tracked_time.time") -} From 7e7a2c5b69cb6ced5892064d29a3c611c7fa48d5 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Wed, 23 Aug 2023 00:57:37 +0200 Subject: [PATCH 03/20] adjust to renamed opt --- models/issues/issue_stats.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/issues/issue_stats.go b/models/issues/issue_stats.go index 8f2820b281914..1654e6ce756ff 100644 --- a/models/issues/issue_stats.go +++ b/models/issues/issue_stats.go @@ -120,19 +120,19 @@ func getIssueStatsChunk(opts *IssuesOptions, issueIDs []int64) (*IssueStats, err Join("INNER", "repository", "`issue`.repo_id = `repository`.id") var err error - stats.OpenCount, err = applyIssueStatsOptions(sess, opts, issueIDs). + stats.OpenCount, err = applyIssuesOptions(sess, opts, issueIDs). And("issue.is_closed = ?", false). Count(new(Issue)) if err != nil { return stats, err } - stats.ClosedCount, err = applyIssueStatsOptions(sess, opts, issueIDs). + stats.ClosedCount, err = applyIssuesOptions(sess, opts, issueIDs). And("issue.is_closed = ?", true). Count(new(Issue)) return stats, err } -func applyIssueStatsOptions(sess *xorm.Session, opts *IssuesOptions, issueIDs []int64) *xorm.Session { +func applyIssuesOptions(sess *xorm.Session, opts *IssuesOptions, issueIDs []int64) *xorm.Session { if len(opts.RepoIDs) > 1 { sess.In("issue.repo_id", opts.RepoIDs) } else if len(opts.RepoIDs) == 1 { From b96699edbf44c4d4716b6381dc4f35b5d981f8c0 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Wed, 23 Aug 2023 01:02:48 +0200 Subject: [PATCH 04/20] Add GetIssueTotalTrackedTime, witch returns the total tracked time for issues by given conditions. --- models/issues/tracked_time.go | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/models/issues/tracked_time.go b/models/issues/tracked_time.go index 58c6b775f0778..ef109fc099375 100644 --- a/models/issues/tracked_time.go +++ b/models/issues/tracked_time.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/util" "xorm.io/builder" + "xorm.io/xorm" ) // TrackedTime represents a time that was spent for a specific issue. @@ -325,3 +326,52 @@ func GetTrackedTimeByID(id int64) (*TrackedTime, error) { } return time, nil } + +// GetIssueTotalTrackedTime returns the total tracked time for issues by given conditions. +func GetIssueTotalTrackedTime(opts *IssuesOptions, isClosed bool) (int64, error) { + if len(opts.IssueIDs) <= MaxQueryParameters { + return getIssueTotalTrackedTimeChunk(opts, isClosed, opts.IssueIDs) + } + + // If too long a list of IDs is provided, we get the statistics in + // smaller chunks and get accumulates. Note: this could potentially + // get us invalid results. The alternative is to insert the list of + // ids in a temporary table and join from them. + var accum int64 = 0 + for i := 0; i < len(opts.IssueIDs); { + chunk := i + MaxQueryParameters + if chunk > len(opts.IssueIDs) { + chunk = len(opts.IssueIDs) + } + time, err := getIssueTotalTrackedTimeChunk(opts, isClosed, opts.IssueIDs[i:chunk]) + if err != nil { + return 0, err + } + accum += time + i = chunk + } + return accum, nil +} + +func getIssueTotalTrackedTimeChunk(opts *IssuesOptions, isClosed bool, issueIDs []int64) (int64, error) { + sumSession := func(opts *IssuesOptions, issueIDs []int64) *xorm.Session { + sess := db.GetEngine(db.DefaultContext). + Table("tracked_time"). + Where("tracked_time.deleted = ?", false). + Join("INNER", "issue", "tracked_time.issue_id = issue.id") + + if len(issueIDs) > 0 { + sess.In("issue.id", issueIDs) + } + + return applyIssueStatsOptions(sess, opts, nil) + } + + type trackedTime struct { + Time int64 + } + + return sumSession(opts, issueIDs). + And("issue.is_closed = ?", isClosed). + SumInt(new(trackedTime), "tracked_time.time") +} From a14d80432398e2331ffe291cf1b041f6d25b08bb Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Wed, 23 Aug 2023 01:14:57 +0200 Subject: [PATCH 05/20] adjust to current codebase --- models/issues/tracked_time.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/models/issues/tracked_time.go b/models/issues/tracked_time.go index ef109fc099375..6a56e99122a50 100644 --- a/models/issues/tracked_time.go +++ b/models/issues/tracked_time.go @@ -360,11 +360,7 @@ func getIssueTotalTrackedTimeChunk(opts *IssuesOptions, isClosed bool, issueIDs Where("tracked_time.deleted = ?", false). Join("INNER", "issue", "tracked_time.issue_id = issue.id") - if len(issueIDs) > 0 { - sess.In("issue.id", issueIDs) - } - - return applyIssueStatsOptions(sess, opts, nil) + return applyIssuesOptions(sess, opts, issueIDs) } type trackedTime struct { From b9db680ea79868e3d4eded25c6f848c9ef2db429 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Wed, 23 Aug 2023 01:15:47 +0200 Subject: [PATCH 06/20] adjust code-scope [see with no whitespace changes] --- routers/web/repo/issue.go | 69 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index b04802e4520df..27b50448a61c0 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -197,46 +197,43 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti } var issueStats *issues_model.IssueStats - { - statsOpts := &issues_model.IssuesOptions{ - RepoIDs: []int64{repo.ID}, - LabelIDs: labelIDs, - MilestoneIDs: mileIDs, - ProjectID: projectID, - AssigneeID: assigneeID, - MentionedID: mentionedID, - PosterID: posterID, - ReviewRequestedID: reviewRequestedID, - ReviewedID: reviewedID, - IsPull: isPullOption, - IssueIDs: nil, - } - if keyword != "" { - allIssueIDs, err := issueIDsFromSearch(ctx, keyword, statsOpts) - if err != nil { - if issue_indexer.IsAvailable(ctx) { - ctx.ServerError("issueIDsFromSearch", err) - return - } - ctx.Data["IssueIndexerUnavailable"] = true + statsOpts := &issues_model.IssuesOptions{ + RepoIDs: []int64{repo.ID}, + LabelIDs: labelIDs, + MilestoneIDs: mileIDs, + ProjectID: projectID, + AssigneeID: assigneeID, + MentionedID: mentionedID, + PosterID: posterID, + ReviewRequestedID: reviewRequestedID, + ReviewedID: reviewedID, + IsPull: isPullOption, + IssueIDs: nil, + } + if keyword != "" { + allIssueIDs, err := issueIDsFromSearch(ctx, keyword, statsOpts) + if err != nil { + if issue_indexer.IsAvailable(ctx) { + ctx.ServerError("issueIDsFromSearch", err) return } - statsOpts.IssueIDs = allIssueIDs + ctx.Data["IssueIndexerUnavailable"] = true + return } - if keyword != "" && len(statsOpts.IssueIDs) == 0 { - // So it did search with the keyword, but no issue found. - // Just set issueStats to empty. - issueStats = &issues_model.IssueStats{} - } else { - // So it did search with the keyword, and found some issues. It needs to get issueStats of these issues. - // Or the keyword is empty, so it doesn't need issueIDs as filter, just get issueStats with statsOpts. - issueStats, err = issues_model.GetIssueStats(statsOpts) - if err != nil { - ctx.ServerError("GetIssueStats", err) - return - } + statsOpts.IssueIDs = allIssueIDs + } + if keyword != "" && len(statsOpts.IssueIDs) == 0 { + // So it did search with the keyword, but no issue found. + // Just set issueStats to empty. + issueStats = &issues_model.IssueStats{} + } else { + // So it did search with the keyword, and found some issues. It needs to get issueStats of these issues. + // Or the keyword is empty, so it doesn't need issueIDs as filter, just get issueStats with statsOpts. + issueStats, err = issues_model.GetIssueStats(statsOpts) + if err != nil { + ctx.ServerError("GetIssueStats", err) + return } - } isShowClosed := ctx.FormString("state") == "closed" From ecccc500207a44d2a5c95f8d1d622a63101b7eaa Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Wed, 23 Aug 2023 01:16:16 +0200 Subject: [PATCH 07/20] add TotalTrackedTime Data for template --- routers/web/repo/issue.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 27b50448a61c0..00cd3d1e7fa67 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -242,6 +242,13 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti isShowClosed = true } + var totalTrackedTime int64 = 0 + totalTrackedTime, err = issues_model.GetIssueTotalTrackedTime(statsOpts, isShowClosed) + if err != nil { + ctx.ServerError("GetIssueTotalTrackedTime", err) + return + } + page := ctx.FormInt("page") if page <= 1 { page = 1 @@ -321,6 +328,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti ctx.Data["Issues"] = issues ctx.Data["CommitLastStatus"] = lastStatus ctx.Data["CommitStatuses"] = commitStatuses + ctx.Data["TotalTrackedTime"] = totalTrackedTime // Get assignees. assigneeUsers, err := repo_model.GetRepoAssignees(ctx, repo) From e2349bc501adf7f69d16fe62d4af195b89c00132 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 23 Aug 2023 04:46:53 +0200 Subject: [PATCH 08/20] Update routers/web/repo/issue.go --- routers/web/repo/issue.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 00cd3d1e7fa67..fa186dac53201 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -242,8 +242,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti isShowClosed = true } - var totalTrackedTime int64 = 0 - totalTrackedTime, err = issues_model.GetIssueTotalTrackedTime(statsOpts, isShowClosed) + totalTrackedTime, err: = issues_model.GetIssueTotalTrackedTime(statsOpts, isShowClosed) if err != nil { ctx.ServerError("GetIssueTotalTrackedTime", err) return From e9766f1048a567bc10cbaf339c8727182e0dc709 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Mon, 25 Sep 2023 13:18:37 +0200 Subject: [PATCH 09/20] fix --- routers/web/repo/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 85038c08357a6..875b58e0c25e5 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -243,7 +243,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti isShowClosed = true } - totalTrackedTime, err: = issues_model.GetIssueTotalTrackedTime(statsOpts, isShowClosed) + totalTrackedTime, err := issues_model.GetIssueTotalTrackedTime(statsOpts, isShowClosed) if err != nil { ctx.ServerError("GetIssueTotalTrackedTime", err) return From b3e9420141b5d45cfa40446231bdaaeb749ce9d4 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Mon, 25 Sep 2023 13:59:17 +0200 Subject: [PATCH 10/20] comment --- models/issues/tracked_time.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/models/issues/tracked_time.go b/models/issues/tracked_time.go index 6a56e99122a50..876caff563306 100644 --- a/models/issues/tracked_time.go +++ b/models/issues/tracked_time.go @@ -333,10 +333,8 @@ func GetIssueTotalTrackedTime(opts *IssuesOptions, isClosed bool) (int64, error) return getIssueTotalTrackedTimeChunk(opts, isClosed, opts.IssueIDs) } - // If too long a list of IDs is provided, we get the statistics in - // smaller chunks and get accumulates. Note: this could potentially - // get us invalid results. The alternative is to insert the list of - // ids in a temporary table and join from them. + // If too long a list of IDs is provided, + // we get the statistics in smaller chunks and get accumulates var accum int64 = 0 for i := 0; i < len(opts.IssueIDs); { chunk := i + MaxQueryParameters From cbf29650d0c547a6f40ce5eb3fd09493874f9030 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Sat, 30 Sep 2023 18:05:08 +0200 Subject: [PATCH 11/20] WIP: WebUI --- templates/repo/issue/list.tmpl | 8 ++++++++ templates/repo/issue/milestone_issues.tmpl | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 75d4234324a2d..1391997cc1039 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -34,6 +34,14 @@
{{template "repo/issue/openclose" .}} + {{if .TotalTrackedTime}} + + {{end}}
+ {{if .TotalTrackedTime}} + + {{end}} + {{template "repo/issue/filters" .}} {{template "shared/issuelist" dict "." . "listType" "milestone"}} From bffb2b2568ebfc426f136e7f2e7b416b3d6acc63 Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Sat, 30 Sep 2023 18:38:40 +0200 Subject: [PATCH 12/20] TTT in MS looks good now ;) --- options/locale/locale_en-US.ini | 1 + templates/repo/issue/list.tmpl | 8 +++----- templates/repo/issue/milestone_issues.tmpl | 15 ++++++--------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 8667e77a89505..70686d563aa33 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -17,6 +17,7 @@ template = Template language = Language notifications = Notifications active_stopwatch = Active Time Tracker +tracked_time_summary = The summary of the tracked time create_new = Create… user_profile_and_more = Profile and Settings… signed_in_as = Signed in as diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 1391997cc1039..24c6d8fce652d 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -35,11 +35,9 @@
{{template "repo/issue/openclose" .}} {{if .TotalTrackedTime}} - diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index f415b4bf053d1..ea19518efac83 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -46,19 +46,16 @@ {{end}}
{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness | Safe}}
+ {{if .TotalTrackedTime}} +
+ {{svg "octicon-clock"}} + {{.TotalTrackedTime | Sec2Time}} +
+ {{end}}
- {{if .TotalTrackedTime}} - - {{end}} - {{template "repo/issue/filters" .}} {{template "shared/issuelist" dict "." . "listType" "milestone"}} From 4706f895b08a9d95d436f97a2af6e753493538ee Mon Sep 17 00:00:00 2001 From: "m.huber" Date: Sat, 30 Sep 2023 19:26:12 +0200 Subject: [PATCH 13/20] WIP: TTT on issue list --- templates/repo/issue/filters.tmpl | 7 +++++++ templates/repo/issue/list.tmpl | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl index dca2fb0dba61f..e353ba7a7b83f 100644 --- a/templates/repo/issue/filters.tmpl +++ b/templates/repo/issue/filters.tmpl @@ -4,6 +4,13 @@ {{end}} {{template "repo/issue/openclose" .}} + + {{if .TotalTrackedTime}} +
+ {{svg "octicon-clock"}} + {{.TotalTrackedTime | Sec2Time}} +
+ {{end}}