start-login id -> class so we can have more than one login link on a page

This commit is contained in:
Simon Redfern 2015-07-16 01:31:04 +02:00
parent 97727a2af1
commit cdaeec5942
4 changed files with 18 additions and 9 deletions

View File

@ -41,8 +41,8 @@ import net.liftweb.http.js.JsCmds.Noop
class Login {
// TODO show currenctly loggedin user / name
private def loggedIn = {
".logged-out *" #> "" &
".logout [onclick+]" #> SHtml.onEvent(s => {
OAuthClient.logoutAll()
@ -52,7 +52,7 @@ class Login {
def loggedOut = {
".logged-in *" #> "" &
"#start-login [onclick]" #> {
".start-login [onclick]" #> {
def actionJS: JsCmd = {
OAuthClient.redirectToOauthLogin()
Noop

View File

@ -34,12 +34,21 @@ Berlin 13359, Germany
Sorry, we couldn't find the page you were looking for.
</p>
<p>
Maybe this is because you don't have the right permissions
<lift:TestCond.loggedOut>
(you are not logged in).
</lift:TestCond.loggedOut>
Maybe this is because you don't have the right permissions.
</p>
<div class="lift:Login.login">
<div class="logged-out">
You might like to <a class="start-login" href="#">login</a>
</div>
<div class="logged-in">
<div class="profile-info">
Please double check the URL or <span class="logout">logout</span> and login as a different user.
</div>
</div>
</div>
</div>

View File

@ -10,7 +10,7 @@ h1 {
margin-bottom: 10px;
}
#start-login,
.start-login,
.logout,
a {
color: #1C8B77;
@ -21,7 +21,7 @@ a:hover {
color: #156759;
}
#start-login:hover,
.start-login:hover,
.logout:hover {
color: #156759;
text-decoration: underline;

View File

@ -57,7 +57,7 @@ Berlin 13359, Germany
<div id="account">
<div class="lift:Login.login">
<div class="logged-out">
<a id="start-login" href="#">Login</a>
<a class="start-login" href="#">Login</a>
</div>
<div class="logged-in">
<div class="profile-info">