forgejo/routers/web/repo
wxiaoguang f0ba87fda8
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.
2021-10-06 01:25:46 +02:00
..
activity.go
attachment.go
blame.go
branch.go
commit.go Support direct comparison (git diff a..b) as well merge comparison (a...b) (#16635) 2021-09-27 13:19:34 +01:00
compare.go Prevent NPE on invalid diff (#17197) 2021-09-30 21:31:02 +02:00
download.go
editor.go refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
editor_test.go Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
http.go Move twofactor to models/login (#17143) 2021-09-25 15:00:12 +02:00
http_test.go
issue.go Avatar refactor, move avatar code from models to models.avatars, remove duplicated code (#17123) 2021-10-06 01:25:46 +02:00
issue_dependency.go
issue_label.go Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
issue_label_test.go Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
issue_lock.go
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go
lfs.go refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
main_test.go Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
middlewares.go
migrate.go
milestone.go Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
projects.go Kanban colored boards (#16647) 2021-09-29 22:53:12 +02:00
projects_test.go Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
pull.go Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) 2021-10-05 16:41:48 +02:00
pull_review.go
release.go Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
release_test.go Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
repo.go DBContext is just a Context (#17100) 2021-09-23 23:45:36 +08:00
search.go
setting.go Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
setting_protected_branch.go
settings_test.go refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
tag.go
topic.go
view.go Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
webhook.go
wiki.go refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
wiki_test.go refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00