forked from forgejo/forgejo
Backport #25030 by @HesterG Close #24808 Co-Authour @wxiaoguang @silverwind 1. Most svgs are found from https://worldvectorlogo.com/ , and some are from conversion of png to svg. (facebook and nextcloud). And also changed `templates/user/settings/security/accountlinks.tmpl`. 2. Fixed display name and iconurl related logic # After <img width="1436" alt="Screen Shot 2023-06-05 at 14 09 05" src="a5db39d8
-1ab0-4676-82a4-fba60a1d1f84"> On mobile <img width="378" alt="Screen Shot 2023-06-05 at 14 09 46" src="71d0f51b
-baac-4f48-8ca2-ae0e013bd62e"> user/settings/security/accountlinks (The dropdown might be improved later) <img width="973" alt="Screen Shot 2023-06-01 at 10 01 44" src="27010e7e
-2785-4fc5-8c49-b06621898f37"> Co-authored-by: HesterG <hestergong@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
7679f4d51a
commit
0058453fd9
44 changed files with 80 additions and 270 deletions
|
@ -3,6 +3,8 @@
|
|||
|
||||
package oauth2
|
||||
|
||||
import "code.gitea.io/gitea/modules/setting"
|
||||
|
||||
// BaseProvider represents a common base for Provider
|
||||
type BaseProvider struct {
|
||||
name string
|
||||
|
@ -19,9 +21,14 @@ func (b *BaseProvider) DisplayName() string {
|
|||
return b.displayName
|
||||
}
|
||||
|
||||
// Image returns an image path for this provider
|
||||
func (b *BaseProvider) Image() string {
|
||||
return "/assets/img/auth/" + b.name + ".png"
|
||||
// IconURL returns an icon path for this provider
|
||||
// Use svg for default icons, providers_openid has its own IconURL function
|
||||
func (b *BaseProvider) IconURL() string {
|
||||
name := b.name
|
||||
if b.name == "gplus" {
|
||||
name = "google"
|
||||
}
|
||||
return setting.AppSubURL + "/assets/img/auth/" + name + ".svg"
|
||||
}
|
||||
|
||||
// CustomURLSettings returns the custom url settings for this provider
|
||||
|
@ -29,4 +36,4 @@ func (b *BaseProvider) CustomURLSettings() *CustomURLSettings {
|
|||
return nil
|
||||
}
|
||||
|
||||
var _ (Provider) = &BaseProvider{}
|
||||
var _ Provider = &BaseProvider{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue