Skip to content

Commit bfd81ed

Browse files
futa-ikedacslzchen
andcommitted
[ENG-8787] Username/password and 2FA login page (#97)
* Add background image * Update email + password login page * Update 2fa login page * Adjust position of the reveal-password icon slightly --------- Co-authored-by: Longze Chen <[email protected]>
1 parent f5beae8 commit bfd81ed

File tree

6 files changed

+70
-38
lines changed

6 files changed

+70
-38
lines changed

src/main/resources/static/css/cas.css

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,17 @@ aside, section, main {
102102
top: 56px;
103103
}
104104

105-
.mdc-drawer-app-content {
106-
/* flex: auto; */
107-
/* overflow: auto; */
108-
/* position: relative; */
105+
.flex-column {
109106
flex-direction: column;
107+
}
110108

109+
.full-width {
110+
width: 100%;
111+
}
112+
113+
.center-align-text {
114+
display: inline-block;
115+
text-align: center;
111116
}
112117

113118
.main-content {
@@ -164,6 +169,7 @@ header>nav .cas-brand .cas-logo {
164169
border-right: var(--cas-theme-border-light, 1px solid rgba(0, 0, 0, .2));
165170
padding: 2rem 2.5rem;
166171
flex: 1;
172+
background: #fff;
167173
}
168174

169175
.login-section:last-child {
@@ -448,7 +454,8 @@ button.close {
448454
}
449455

450456
.mdc-button--raised:not(:disabled) {
451-
background-color: var(--mdc-theme-primary, #153E50);
457+
background-color: transparent;
458+
font-weight: bold;
452459
}
453460

454461
.mdc-button--raised.mdc-button-twitter:not(:disabled) {
@@ -668,7 +675,9 @@ button.close {
668675
--cas-theme-osf-footer: #efefef;
669676
--cas-theme-osf-grey: #eeeeee;
670677
--cas-theme-osf-green: #357935;
671-
--cas-theme-osf-blue: ##337ab7;
678+
--cas-theme-osf-blue: #337ab7;
679+
--cas-theme-osf-blue-hover: #0089ff;
680+
--cas-theme-grey-hover: #f5f8fb;
672681
--cas-theme-osf-red: #b52b27;
673682
--cas-theme-osf-disabled: #eeeeee;
674683
--cas-theme-osf-disabled-dark: #cccccc;
@@ -747,8 +756,20 @@ body {
747756
margin: 0.25rem 0;
748757
}
749758

759+
.form-button-column {
760+
display: flex;
761+
flex-direction: column;
762+
margin: 0.25rem 0;
763+
764+
.mdc-button {
765+
margin: 0.25rem 0;
766+
padding: 0 8px;
767+
}
768+
}
769+
750770
.form-button .mdc-button,
751-
.form-button-inline .mdc-button {
771+
.form-button-inline .mdc-button,
772+
.form-button-column .mdc-button {
752773
width: 100%;
753774
min-width: fit-content;
754775
text-transform: none;
@@ -777,8 +798,13 @@ body {
777798

778799
.form-button .button-osf-grey,
779800
.form-button-inline .button-osf-grey {
780-
background-color: var(--cas-theme-osf-grey, #eeeeee);
781-
box-shadow: 0px 5px 4px 0px rgba(0, 0, 0, 0.2), 0px 4px 4px 0px rgba(0, 0, 0, 0.14), 0px 3px 8px 0px rgba(0, 0, 0, 0.12);
801+
background-color: transparent;
802+
box-shadow: 0 0 4px 0 #00000029;
803+
display: inline-flex;
804+
805+
&:hover {
806+
background: var(--cas-theme-grey-hover, #f5f8fb);
807+
}
782808
}
783809

784810
.form-button .button-osf-green,
@@ -789,6 +815,10 @@ body {
789815
.form-button .button-osf-blue,
790816
.form-button-inline .button-osf-blue {
791817
background-color: var(--cas-theme-osf-blue, #337ab7);
818+
819+
&:hover {
820+
background-color: var(--cas-theme-osf-blue-hover, #0089ff);
821+
}
792822
}
793823

794824
.form-button .button-osf-red,
@@ -935,25 +965,20 @@ body {
935965
}
936966

937967
.form-button-inline .delegation-button-logo {
938-
position: absolute;
939-
left: 4px;
940-
top: 12px;
941968
padding: 6px;
942969
height: 36px;
943970
}
944971

945972
.form-button-inline .delegation-button-label {
946973
font-size: 0.875rem;
947-
color: black;
974+
font-weight: 700;
975+
color: var(--cas-theme-osf-blue, #337ab7);
948976
white-space: nowrap;
949977
padding-left: 28px;
950978
letter-spacing: normal;
951979
}
952980

953981
.form-button .delegation-button-logo {
954-
position: absolute;
955-
left: 20px;
956-
top: 11px;
957982
padding: 2px;
958983
height: 36px;
959984
}
@@ -986,7 +1011,9 @@ body {
9861011
}
9871012

9881013
.login-section .reveal-password {
989-
background-color: var(--cas-theme-osf-blue, #337ab7);
1014+
color: #94a3b8;
1015+
inset-inline-end: 0rem;
1016+
position: absolute;
9901017
}
9911018

9921019
.login-section .login-error-list {
502 KB
Loading

src/main/resources/templates/fragments/loginform.html

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
<span th:utext="#{screen.welcome.tips}"></span>
2727
</section>
2828

29-
<section class="form-button-inline" th:if="${osfCasLoginContext.orcidLoginUrl}">
29+
<section class="form-button" th:if="${osfCasLoginContext.orcidLoginUrl}">
3030
<a class="mdc-button mdc-button--raised button-osf-grey" id="orcidlogin" th:href="@{${osfCasLoginContext.orcidLoginUrl}}">
3131
<img class="delegation-button-logo" src="/images/orcid-logo.png" alt="ORCiD logo">
3232
<span class="delegation-button-label" th:utext="#{screen.welcome.button.orcidlogin}"></span>
3333
</a>
34-
<a class="mdc-button mdc-button--raised button-osf-grey" id="instnLogin" th:href="@{/login(campaign=institution, institutionId=${institutionId ?: ''}, service=${service?.originalUrl ?: ''})}">
34+
<a class="mdc-button mdc-button--raised button-osf-grey margin-large-vertical" id="instnLogin" th:href="@{/login(campaign=institution, institutionId=${institutionId ?: ''}, service=${service?.originalUrl ?: ''})}">
3535
<img class="delegation-button-logo" src="/images/institution-logo.png" alt="Institution logo">
3636
<span class="delegation-button-label" th:utext="#{screen.welcome.button.institutionlogin}"></span>
3737
</a>
@@ -103,17 +103,17 @@
103103
th:field="*{password}"
104104
autocomplete="current-password" />
105105
<label for="password" class="mdc-floating-label" th:utext="#{screen.welcome.label.password}"></label>
106+
<button class="reveal-password mdc-button mdc-input-group-append" type="button">
107+
<i class="mdi mdi-eye reveal-password-icon"></i>
108+
<span class="sr-only">Toggle Password</span>
109+
</button>
106110
</div>
107111
<div class="mdc-text-field-helper-line caps-warn">
108112
<p class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg text-danger">
109113
<span th:utext="#{screen.capslock.on}" />
110114
</p>
111115
</div>
112116
</div>
113-
<button class="reveal-password mdc-button mdc-button--raised mdc-input-group-append" type="button">
114-
<i class="mdi mdi-eye reveal-password-icon"></i>
115-
<span class="sr-only">Toggle Password</span>
116-
</button>
117117
</section>
118118

119119
<section id="loginformerrorlist" class="login-error-list" th:if="${#fields.hasErrors('*')}">
@@ -123,6 +123,11 @@
123123
</div>
124124
</div>
125125
</section>
126+
<section class="cas-field cas-field-primary cas-field-col-2 my-3">
127+
<span class="cas-field-float-right text-bold">
128+
<a th:href="@{${osfUrl.forgotPassword}}" th:utext="#{screen.welcome.link.resetpassword}"></a>
129+
</span>
130+
</section>
126131

127132
<section class="cas-field">
128133

@@ -138,19 +143,19 @@
138143
</span>
139144
</p>
140145
</section>
146+
<section>
147+
<span class="cas-field-float-left margin-large-vertical" th:if="${rememberMeAuthenticationEnabled}">
148+
<input type="checkbox" name="rememberMe" id="rememberMe" value="true"/>&nbsp;
149+
<label for="rememberMe" th:text="#{screen.welcome.checkbox.rememberme}"></label>
150+
</span>
151+
</section>
141152

142153
<section>
143154
<div th:replace="fragments/submitbutton :: submitButton (buttonDisabled=false, buttonCustomization='button-osf-blue', messageKey='screen.welcome.button.login')" />
144155
</section>
145156

146157
<section class="cas-field cas-field-primary cas-field-col-2">
147-
<span class="cas-field-float-left" th:if="${rememberMeAuthenticationEnabled}">
148-
<input type="checkbox" name="rememberMe" id="rememberMe" value="true"/>&nbsp;
149-
<label for="rememberMe" th:text="#{screen.welcome.checkbox.rememberme}"></label>
150-
</span>
151-
<span class="cas-field-float-right">
152-
<a th:href="@{${osfUrl.forgotPassword}}" th:utext="#{screen.welcome.link.resetpassword}"></a>
153-
<br>
158+
<span class="center-align-text full-width text-bold">
154159
<a href="https://help.osf.io/article/272-sign-in-to-osf" th:utext="#{screen.generic.link.support}"></a>
155160
</span>
156161
</section>

src/main/resources/templates/fragments/totploginform.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@
8383
autocomplete="one-time-code"
8484
autofocus />
8585
<label for="oneTimePassword" class="mdc-floating-label" th:utext="#{screen.twofactor.label.onetimepassword}"></label>
86+
<button class="reveal-password mdc-button mdc-input-group-append" type="button">
87+
<i class="mdi mdi-eye reveal-password-icon"></i>
88+
<span class="sr-only">Toggle One-time Password</span>
89+
</button>
8690
</div>
8791
</div>
88-
<button class="reveal-password mdc-button mdc-button--raised mdc-input-group-append" type="button">
89-
<i class="mdi mdi-eye reveal-password-icon"></i>
90-
<span class="sr-only">Toggle One-time Password</span>
91-
</button>
9292
</section>
9393

9494
<section id="loginformerrorlist" class="login-error-list" th:if="${#fields.hasErrors('*')}">
@@ -125,10 +125,10 @@
125125
</section>
126126

127127
<section class="cas-field-col-2">
128-
<span class="text-with-mdi cas-field-float-left">
128+
<span class="text-with-mdi cas-field-float-left text-bold">
129129
<span><a th:href="@{/logout(service=${osfUrl.logout})}" th:utext="#{screen.twofactor.link.cancel}"></a></span>
130130
</span>
131-
<span class="text-without-mdi cas-field-float-right">
131+
<span class="text-without-mdi cas-field-float-right text-bold">
132132
<a href="https://help.osf.io/article/239-enable-or-disable-two-factor-authentication" th:utext="#{screen.generic.link.support}"></a>
133133
</span>
134134
</section>

src/main/resources/templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<a href="fragments/leftpane.html"></a>
3030
</div>
3131

32-
<div class="mdc-drawer-app-content mdc-top-app-bar--fixed-adjust d-flex justify-content-center main-background-gradient flex-grow-1">
32+
<div class="flex-column mdc-top-app-bar--fixed-adjust d-flex justify-content-center main-background-gradient flex-grow-1">
3333

3434
<!-- Note: Sign-up button only shows up in osf layout -->
3535

src/main/resources/templates/layoutosf.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<a href="fragments/leftpaneosf.html"></a>
3030
</div>
3131

32-
<div class="mdc-drawer-app-content mdc-top-app-bar--fixed-adjust d-flex justify-content-center main-background-gradient flex-grow-1">
32+
<div class="flex-column mdc-top-app-bar--fixed-adjust d-flex justify-content-center main-background-gradient flex-grow-1">
3333

3434
<!-- Sign-up botton for Desktop (wide screen) view -->
3535
<div class="form-button desktop-only">

0 commit comments

Comments
 (0)