From f0ba87fda88c7bb601eee17f3e3a72bea8a71521 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 6 Oct 2021 07:25:46 +0800 Subject: Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123) Why this refactor The goal is to move most files from `models` package to `models.xxx` package. Many models depend on avatar model, so just move this first. And the existing logic is not clear, there are too many function like `AvatarLink`, `RelAvatarLink`, `SizedRelAvatarLink`, `SizedAvatarLink`, `MakeFinalAvatarURL`, `HashedAvatarLink`, etc. This refactor make everything clear: * user.AvatarLink() * user.AvatarLinkWithSize(size) * avatars.GenerateEmailAvatarFastLink(email, size) * avatars.GenerateEmailAvatarFinalLink(email, size) And many duplicated code are deleted in route handler, the handler and the model share the same avatar logic now. --- templates/repo/issue/view_content/comments.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/repo/issue') diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index dabba7bc74..c7d7574231 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -746,7 +746,7 @@
- + {{svg "octicon-x" 16}} -- cgit v1.2.3