Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework OAuth login buttons, swap github logo to monocolor #24740

Merged
merged 10 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion public/img/svg/gitea-github.svg

This file was deleted.

2 changes: 1 addition & 1 deletion public/img/svg/gitea-gitlab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/gitea-openid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions templates/repo/migrate/migrate.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
<div class="ui three stackable cards">
{{range .Services}}
<a class="ui card gt-df gt-ac" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}">
{{if eq .Name "github"}}
{{svg "octicon-mark-github" 184 "gt-p-4"}}
{{else if eq .Name "gitlab"}}
{{svg "gitea-gitlab" 184 "gt-p-4"}}
{{else if eq .Name "gitbucket"}}
{{svg "gitea-gitbucket" 184 "gt-p-4"}}
{{else}}
{{svg (printf "gitea-%s" .Name) 184}}
{{end}}
<div class="content">
<div class="header gt-tc">
{{.Title}}
Expand Down
25 changes: 18 additions & 7 deletions templates/user/auth/signin_inner.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,32 @@
{{end}}

{{if and .OrderedOAuth2Names .OAuth2Providers}}
<div class="ui attached segment">
<hr class="ui divider"/>
<div class="oauth2 center">
<div id="oauth2-login-loader" class="ui disabled centered loader"></div>
<div>
<div id="oauth2-login-navigator">
<p>{{.locale.Tr "sign_in_with"}}</p>
<div id="oauth2-login-navigator" class="gt-df gt-jc">
<span class="gt-self-center gt-mr-3">{{.locale.Tr "sign_in_with"}}</span>
<div class="gt-df gt-fw gt-gap-4">
{{range $key := .OrderedOAuth2Names}}
{{$provider := index $.OAuth2Providers $key}}
<a href="{{AppSubUrl}}/user/oauth2/{{$key}}">
<a class="{{$provider.Name}} silenced oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}" data-tooltip-content="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}">
{{if eq $provider.Name "github"}}
{{svg "octicon-mark-github" 40}}
{{else if eq $provider.Name "gitlab"}}
{{svg "gitea-gitlab" 40}}
{{else if eq $provider.Name "openidConnect"}}
{{svg "gitea-openid" 40}}
{{else}}
<img
class="gt-object-contain"
width="40"
height="40"
alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
title="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
class="{{$provider.Name}} oauth-login-image"
src="{{AppSubUrl}}{{$provider.Image}}"
></a>
>
{{end}}
</a>
{{end}}
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ a {
text-decoration-skip-ink: all;
}

/* muted link = only colored when hovered */
/* silenced link = never colored */

a.muted,
a.silenced,
.muted-links a {
color: inherit;
}
Expand All @@ -350,6 +354,10 @@ a.muted:hover [class*="color-text"],
color: var(--color-primary);
}

a.silenced:hover {
color: inherit;
}

.delete-button,
.delete-button:hover {
color: var(--color-red);
Expand Down
26 changes: 0 additions & 26 deletions web_src/css/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,32 +206,6 @@ textarea:focus,
}
}

.signin .oauth2 div {
display: inline-block;
}

.signin .oauth2 div p {
margin: 10px 5px 0 0;
float: left;
}

.signin .oauth2 a {
margin-right: 3px;
}

.signin .oauth2 a:last-child {
margin-right: 0;
}

.signin .oauth2 img {
width: 32px;
height: 32px;
}

.signin .oauth2 img.openidConnect {
width: auto;
}

@media (min-width: 768px) {
.g-recaptcha-style,
.h-captcha-style {
Expand Down
2 changes: 2 additions & 0 deletions web_src/css/helpers.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Gitea's private styles use `g-` prefix.
.gt-whitespace-nowrap { white-space: nowrap !important; }
.gt-whitespace-pre { white-space: pre !important; }
.gt-whitespace-pre-wrap { white-space: pre-wrap !important; }
.gt-object-contain { object-fit: contain !important; }
.gt-self-center { align-self: center !important; }

.gt-overflow-x-auto { overflow-x: auto !important; }
.gt-overflow-x-scroll { overflow-x: scroll !important; }
Expand Down
1 change: 0 additions & 1 deletion web_src/svg/gitea-github.svg

This file was deleted.

2 changes: 1 addition & 1 deletion web_src/svg/gitea-gitlab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web_src/svg/gitea-openid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.