File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
templates/repo/issue/view_content Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ func NewFuncMap() template.FuncMap {
7171 "CountFmt" : base .FormatNumberSI ,
7272 "Sec2Time" : util .SecToTime ,
7373
74- "TimeEstimateString" : util . TimeEstimateString ,
74+ "TimeEstimateString" : timeEstimateString ,
7575
7676 "LoadTimes" : func (startTime time.Time ) string {
7777 return fmt .Sprint (time .Since (startTime ).Nanoseconds ()/ 1e6 ) + "ms"
@@ -285,6 +285,14 @@ func userThemeName(user *user_model.User) string {
285285 return setting .UI .DefaultTheme
286286}
287287
288+ func timeEstimateString (timeSec any ) string {
289+ v , _ := util .ToInt64 (timeSec )
290+ if v == 0 {
291+ return ""
292+ }
293+ return util .TimeEstimateString (v )
294+ }
295+
288296func panicIfDevOrTesting () {
289297 if ! setting .IsProd || setting .IsInTesting {
290298 panic ("legacy template functions are for backward compatibility only, do not use them in new code" )
Original file line number Diff line number Diff line change @@ -1681,7 +1681,7 @@ issues.time_estimate_placeholder = 1h 2m
16811681issues.time_estimate_set = Set estimated time
16821682issues.time_estimate_display = Estimate: %s
16831683issues.change_time_estimate_at = changed time estimate to <b>%s</b> %s
1684- issues.remove_time_estimate = removed time estimate %s
1684+ issues.remove_time_estimate_at = removed time estimate %s
16851685issues.time_estimate_invalid = Time estimate format is invalid
16861686issues.start_tracking_history = started working %s
16871687issues.tracker_auto_close = Timer will be stopped automatically when this issue gets closed
Original file line number Diff line number Diff line change 696696 {{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}}
697697 <span class="text grey muted-links">
698698 {{template "shared/user/authorlink" .Poster}}
699-
700- {{if .RenderedContent}}
701- {{/* compatibility with time comments made before v1.21 */}}
702- {{ctx.Locale.Tr "repo.issues.change_time_estimate_at" .RenderedContent $createdStr | SafeHTML}}
699+ {{$timeStr := .Content|TimeEstimateString}}
700+ {{if $timeStr}}
701+ {{ctx.Locale.Tr "repo.issues.change_time_estimate_at" $timeStr $createdStr}}
703702 {{else}}
704- {{$timeStr := .Content|Sec2Time}}
705- {{ctx.Locale.Tr "repo.issues.change_time_estimate_at" $timeStr $createdStr | SafeHTML}}
703+ {{ctx.Locale.Tr "repo.issues.remove_time_estimate_at" $createdStr}}
706704 {{end}}
707705 </span>
708706 </div>
You can’t perform that action at this time.
0 commit comments