aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-08-08 15:29:35 +0800
committerGitHub <noreply@github.com>2023-08-08 15:29:35 +0800
commit78b2a1cc3689e1b7555bd874763eea7eb28982f9 (patch)
tree3f8ba44664b26b18ea8a4e55db9f2087b1e7d51c /modules
parent69130532239ee7ade82977f456c12826e1adeb1e (diff)
downloadgitea-78b2a1cc3689e1b7555bd874763eea7eb28982f9.tar.gz
gitea-78b2a1cc3689e1b7555bd874763eea7eb28982f9.zip
Remove unnecessary template helper repoAvatar (#26387)
And simplify the "repo/icon" code
Diffstat (limited to 'modules')
-rw-r--r--modules/templates/helper.go1
-rw-r--r--modules/templates/util_avatar.go11
2 files changed, 0 insertions, 12 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index cfcfbbed38..30ca767cae 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -59,7 +59,6 @@ func NewFuncMap() template.FuncMap {
"avatarHTML": AvatarHTML,
"avatarByAction": AvatarByAction,
"avatarByEmail": AvatarByEmail,
- "repoAvatar": RepoAvatar,
"EntryIcon": base.EntryIcon,
"MigrationIcon": MigrationIcon,
"ActionIcon": ActionIcon,
diff --git a/modules/templates/util_avatar.go b/modules/templates/util_avatar.go
index 9f8f8f87a9..81961041a0 100644
--- a/modules/templates/util_avatar.go
+++ b/modules/templates/util_avatar.go
@@ -60,17 +60,6 @@ func AvatarByAction(ctx context.Context, action *activities_model.Action, others
return Avatar(ctx, action.ActUser, others...)
}
-// RepoAvatar renders repo avatars. args: repo, size(int), class (string)
-func RepoAvatar(repo *repo_model.Repository, others ...any) template.HTML {
- size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...)
-
- src := repo.RelAvatarLink()
- if src != "" {
- return AvatarHTML(src, size, class, repo.FullName())
- }
- return template.HTML("")
-}
-
// AvatarByEmail renders avatars by email address. args: email, name, size (int), class (string)
func AvatarByEmail(ctx context.Context, email, name string, others ...any) template.HTML {
size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...)