Use branded OAuth buttons

This includes the platform mark with each login button and uses
brand colors. It also uses the same style on the Account Settings
page. And it wraps buttons on login / signup pages.
pull/370/head
Matt Baer 4 years ago
parent a78b36b871
commit 455e50c9a8
  1. 50
      less/login.less
  2. BIN
      static/img/mark/writeas-white.png
  3. 15
      templates/include/oauth.tmpl
  4. 18
      templates/user/settings.tmpl

@ -9,17 +9,63 @@
*/ */
.row.signinbtns { .row.signinbtns {
justify-content: space-evenly; justify-content: center;
font-size: 1em; font-size: 1em;
margin-top: 2em; margin-top: 2em;
margin-bottom: 1em; margin-bottom: 1em;
flex-wrap: wrap;
.loginbtn { .loginbtn {
height: 40px; height: 40px;
margin: 0.5em;
&.btn.cta { &.btn {
box-sizing: border-box; box-sizing: border-box;
font-size: 17px; font-size: 17px;
white-space: nowrap;
img {
height: 1.5em;
vertical-align: middle;
}
}
&#writeas-login, &#slack-login {
img {
margin-top: -0.2em;
}
}
&#gitlab-login {
background-color: #fc6d26;
border-color: #fc6d26;
&:hover {
background-color: darken(#fc6d26, 5%);
border-color: darken(#fc6d26, 5%);
}
}
&#gitea-login {
background-color: #2ecc71;
border-color: #2ecc71;
&:hover {
background-color: #2cc26b;
border-color: #2cc26b;
}
}
&#slack-login, &#gitlab-login, &#gitea-login, &#generic-oauth-login {
font-size: 0.86em;
font-family: @sansFont;
}
&#slack-login, &#generic-oauth-login {
color: @lightTextColor;
background-color: @lightNavBG;
border-color: @lightNavBorder;
&:hover {
background-color: @lightNavHoverBG;
}
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -5,13 +5,22 @@
<a class="loginbtn" href="/oauth/slack"><img alt="Sign in with Slack" height="40" width="172" src="/img/sign_in_with_slack.png" srcset="/img/sign_in_with_slack.png 1x, /img/sign_in_with_slack@2x.png 2x" /></a> <a class="loginbtn" href="/oauth/slack"><img alt="Sign in with Slack" height="40" width="172" src="/img/sign_in_with_slack.png" srcset="/img/sign_in_with_slack.png 1x, /img/sign_in_with_slack@2x.png 2x" /></a>
{{ end }} {{ end }}
{{ if .WriteAsEnabled }} {{ if .WriteAsEnabled }}
<a class="btn cta loginbtn" id="writeas-login" href="/oauth/write.as">Sign in with <strong>Write.as</strong></a> <a class="btn cta loginbtn" id="writeas-login" href="/oauth/write.as">
<img src="/img/mark/writeas-white.png" />
Sign in with <strong>Write.as</strong>
</a>
{{ end }} {{ end }}
{{ if .GitLabEnabled }} {{ if .GitLabEnabled }}
<a class="btn cta loginbtn" id="gitlab-login" href="/oauth/gitlab">Sign in with <strong>{{.GitLabDisplayName}}</strong></a> <a class="btn cta loginbtn" id="gitlab-login" href="/oauth/gitlab">
<img src="/img/mark/gitlab.png" />
Sign in with <strong>{{.GitLabDisplayName}}</strong>
</a>
{{ end }} {{ end }}
{{ if .GiteaEnabled }} {{ if .GiteaEnabled }}
<a class="btn cta loginbtn" id="gitea-login" href="/oauth/gitea">Sign in with <strong>{{.GiteaDisplayName}}</strong></a> <a class="btn cta loginbtn" id="gitea-login" href="/oauth/gitea">
<img src="/img/mark/gitea.png" />
Sign in with <strong>{{.GiteaDisplayName}}</strong>
</a>
{{ end }} {{ end }}
{{ if .GenericEnabled }} {{ if .GenericEnabled }}
<a class="btn cta loginbtn" id="generic-oauth-login" href="/oauth/generic">Sign in with <strong>{{.GenericDisplayName}}</strong></a> <a class="btn cta loginbtn" id="generic-oauth-login" href="/oauth/generic">Sign in with <strong>{{.GenericDisplayName}}</strong></a>

@ -107,48 +107,48 @@ h3 { font-weight: normal; }
<div class="option"> <div class="option">
<h2>Link External Accounts</h2> <h2>Link External Accounts</h2>
<p>Connect additional accounts to enable logging in with those providers, instead of using your username and password.</p> <p>Connect additional accounts to enable logging in with those providers, instead of using your username and password.</p>
<div class="row"> <div class="row signinbtns">
{{ if .OauthWriteAs }} {{ if .OauthWriteAs }}
<div class="section oauth-provider"> <div class="section oauth-provider">
<img src="/img/mark/writeas.png" alt="Write.as" />
<a class="btn cta loginbtn" id="writeas-login" href="/oauth/write.as?attach=t"> <a class="btn cta loginbtn" id="writeas-login" href="/oauth/write.as?attach=t">
<img src="/img/mark/writeas-white.png" alt="Write.as" />
Link <strong>Write.as</strong> Link <strong>Write.as</strong>
</a> </a>
</div> </div>
{{ end }} {{ end }}
{{ if .OauthSlack }} {{ if .OauthSlack }}
<div class="section oauth-provider"> <div class="section oauth-provider">
<a class="btn cta loginbtn" id="slack-login" href="/oauth/slack?attach=t">
<img src="/img/mark/slack.png" alt="Slack" /> <img src="/img/mark/slack.png" alt="Slack" />
<a class="btn cta loginbtn" href="/oauth/slack?attach=t">
Link <strong>Slack</strong> Link <strong>Slack</strong>
</a> </a>
</div> </div>
{{ end }} {{ end }}
{{ if .OauthGitLab }} {{ if .OauthGitLab }}
<div class="section oauth-provider"> <div class="section oauth-provider">
<img src="/img/mark/gitlab.png" alt="GitLab" />
<a class="btn cta loginbtn" id="gitlab-login" href="/oauth/gitlab?attach=t"> <a class="btn cta loginbtn" id="gitlab-login" href="/oauth/gitlab?attach=t">
<img src="/img/mark/gitlab.png" alt="GitLab" />
Link <strong>{{.GitLabDisplayName}}</strong> Link <strong>{{.GitLabDisplayName}}</strong>
</a> </a>
</div> </div>
{{ end }} {{ end }}
{{ if .OauthGitea }} {{ if .OauthGitea }}
<div class="section oauth-provider"> <div class="section oauth-provider">
<img src="/img/mark/gitea.png" alt="Gitea" />
<a class="btn cta loginbtn" id="gitea-login" href="/oauth/gitea?attach=t"> <a class="btn cta loginbtn" id="gitea-login" href="/oauth/gitea?attach=t">
<img src="/img/mark/gitea.png" alt="Gitea" />
Link <strong>{{.GiteaDisplayName}}</strong> Link <strong>{{.GiteaDisplayName}}</strong>
</a> </a>
</div> </div>
{{ end }} {{ end }}
</div>
{{ if .OauthGeneric }} {{ if .OauthGeneric }}
<div class="row">
<div class="section oauth-provider"> <div class="section oauth-provider">
<p><a class="btn cta loginbtn" id="generic-oauth-login" href="/oauth/generic?attach=t">Link <strong>{{ .OauthGenericDisplayName }}</strong></a></p> <a class="btn cta loginbtn" id="generic-oauth-login" href="/oauth/generic?attach=t">
</div> Link <strong>{{ .OauthGenericDisplayName }}</strong>
</a>
</div> </div>
{{ end }} {{ end }}
</div> </div>
</div>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>

Loading…
Cancel
Save