1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-09-28 08:10:01 +02:00
gitea/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
analyze
auth
avatar
base
cache
charset
context
convert API: add html urls to notification subjects (#17178) 2021-09-30 07:17:39 +03:00
cron
csv
doctor
emoji
eventsource
generate
git
gitgraph
graceful
hcaptcha
highlight
httpcache Avatar refactor, move avatar code from models to models.avatars, remove duplicated code (#17123) 2021-10-06 01:25:46 +02:00
httplib
indexer
json
lfs
log
markup
matchlist
metrics Add metrics to get issues by repository (#17225) 2021-10-05 20:39:37 +02:00
migrations
nosql
notification
options
password
pprof
private
process
proxy
public
queue
recaptcha
references
repofiles
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
structs API: add html urls to notification subjects (#17178) 2021-09-30 07:17:39 +03:00
svg
sync
task
templates Avatar refactor, move avatar code from models to models.avatars, remove duplicated code (#17123) 2021-10-06 01:25:46 +02:00
test
timeutil
translation
typesniffer
upload
uri
user
util
validation
web