forgejo/modules
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
..
activitypub Create pub/priv keypair for federation (#17071) 2021-09-28 15:19:22 -04:00
analyze Use git attributes to determine generated and vendored status for language stats and diffs (#16773) 2021-09-09 21:13:36 +01:00
auth Add bundle download for repository (#14538) 2021-08-24 11:47:09 -05:00
avatar refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
base
cache
charset refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
context Fix bug of get context user (#17169) 2021-09-28 21:13:04 +08:00
convert API: add html urls to notification subjects (#17178) 2021-09-30 07:17:39 +03:00
cron
csv
doctor Nicely handle missing user in collaborations (#17049) 2021-09-27 19:07:19 +01:00
emoji
eventsource
generate
git Don't return binary file changes in raw PR diffs by default (#17158) 2021-09-27 17:09:49 -04:00
gitgraph Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
graceful refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
hcaptcha
highlight Prevent panic in Org mode HighlightCodeBlock (#17140) 2021-09-24 14:29:32 +01:00
httpcache Avatar refactor, move avatar code from models to models.avatars, remove duplicated code (#17123) 2021-10-06 01:25:46 +02:00
httplib refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
indexer Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
json
lfs refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
log refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
markup Prevent panic in Org mode HighlightCodeBlock (#17140) 2021-09-24 14:29:32 +01:00
matchlist
metrics Add metrics to get issues by repository (#17225) 2021-10-05 20:39:37 +02:00
migrations Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
nosql
notification Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
options refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
password
pprof refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
private refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
process
proxy
public refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
queue refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
recaptcha refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
references
repofiles Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
repository Avatar refactor, move avatar code from models to models.avatars, remove duplicated code (#17123) 2021-10-06 01:25:46 +02:00
secret
session
setting Add metrics to get issues by repository (#17225) 2021-10-05 20:39:37 +02:00
ssh
storage refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
structs API: add html urls to notification subjects (#17178) 2021-09-30 07:17:39 +03:00
svg refactor: move from io/ioutil to io and os package (#17109) 2021-09-22 13:38:34 +08:00
sync
task Fix bug of migrated repository not index (#16991) 2021-09-08 18:43:19 +01:00
templates Avatar refactor, move avatar code from models to models.avatars, remove duplicated code (#17123) 2021-10-06 01:25:46 +02:00
test Move db related basic functions to models/db (#17075) 2021-09-19 19:49:59 +08:00
timeutil
translation
typesniffer
upload
uri
user
util
validation
web Clean-up HookPreReceive and restore functionality for pushing non-standard refs (#16705) 2021-09-16 15:34:54 +02:00