-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into lunny/commit_status_webhook
- Loading branch information
Showing
53 changed files
with
281 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package templates | ||
|
||
import ( | ||
"html/template" | ||
|
||
"code.gitea.io/gitea/modules/translation" | ||
) | ||
|
||
func dateTimeLegacy(format string, datetime any, _ ...string) template.HTML { | ||
panicIfDevOrTesting() | ||
if s, ok := datetime.(string); ok { | ||
datetime = parseLegacy(s) | ||
} | ||
return dateTimeFormat(format, datetime) | ||
} | ||
|
||
func timeSinceLegacy(time any, _ translation.Locale) template.HTML { | ||
panicIfDevOrTesting() | ||
return TimeSince(time) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2024 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package templates | ||
|
||
import ( | ||
"context" | ||
"html/template" | ||
|
||
issues_model "code.gitea.io/gitea/models/issues" | ||
"code.gitea.io/gitea/modules/translation" | ||
) | ||
|
||
func renderEmojiLegacy(ctx context.Context, text string) template.HTML { | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).RenderEmoji(text) | ||
} | ||
|
||
func renderLabelLegacy(ctx context.Context, locale translation.Locale, label *issues_model.Label) template.HTML { | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).RenderLabel(label) | ||
} | ||
|
||
func renderLabelsLegacy(ctx context.Context, locale translation.Locale, labels []*issues_model.Label, repoLink string, issue *issues_model.Issue) template.HTML { | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).RenderLabels(labels, repoLink, issue) | ||
} | ||
|
||
func renderMarkdownToHtmlLegacy(ctx context.Context, input string) template.HTML { //nolint:revive | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).MarkdownToHtml(input) | ||
} | ||
|
||
func renderCommitMessageLegacy(ctx context.Context, msg string, metas map[string]string) template.HTML { | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).RenderCommitMessage(msg, metas) | ||
} | ||
|
||
func renderCommitMessageLinkSubjectLegacy(ctx context.Context, msg, urlDefault string, metas map[string]string) template.HTML { | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).RenderCommitMessageLinkSubject(msg, urlDefault, metas) | ||
} | ||
|
||
func renderIssueTitleLegacy(ctx context.Context, text string, metas map[string]string) template.HTML { | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).RenderIssueTitle(text, metas) | ||
} | ||
|
||
func renderCommitBodyLegacy(ctx context.Context, msg string, metas map[string]string) template.HTML { | ||
panicIfDevOrTesting() | ||
return NewRenderUtils(ctx).RenderCommitBody(msg, metas) | ||
} |
Oops, something went wrong.