fixes #1: login form can also be used to register a new user
This commit is contained in:
parent
a05a6a7ec0
commit
7be6ab388a
1 changed files with 15 additions and 3 deletions
|
@ -6,9 +6,12 @@
|
|||
</md-button>
|
||||
</span>
|
||||
<span v-else class="button-spacer"> </span>
|
||||
<h2 id="toolbar-title" class="md-title">ibt2</h2>
|
||||
<h2 id="toolbar-title" class="md-title"><router-link :to="{name: 'home'}" class="home-link">ibt2</router-link></h2>
|
||||
<span v-if="loggedInUser.username">
|
||||
<md-button id="logged-in-icon" class="md-icon-button" @click="toUserPage()">
|
||||
<md-button v-if="loggedInUser.isAdmin" id="users-icon" class="md-icon-button" @click="toUserPage()">
|
||||
<md-icon>people_outline</md-icon>
|
||||
</md-button>
|
||||
<md-button id="logged-in-icon" class="md-icon-button" @click="toUsersPage()">
|
||||
<md-icon>person_pin</md-icon>
|
||||
</md-button>
|
||||
<span id="logged-in" class="md-subheading">
|
||||
|
@ -27,7 +30,7 @@
|
|||
<md-input ref="usernameInput" @keyup.enter.native="focusToPassword()" v-model="username" placeholder="username" md-inline />
|
||||
</md-input-container>
|
||||
<span id="password-block">
|
||||
<md-input-container id="password-input" class="login-input" md-inline>
|
||||
<md-input-container id="password-input" class="login-input" md-has-password md-inline>
|
||||
<md-input ref="passwordInput" @keyup.enter.native="login()" v-model="password" placeholder="password" type="password" md-line />
|
||||
</md-input-container>
|
||||
<md-button id="login-button" class="md-icon-button" @click="login()">
|
||||
|
@ -87,6 +90,10 @@ export default {
|
|||
this.$router.push(this.userUrl);
|
||||
},
|
||||
|
||||
toUsersPage() {
|
||||
this.$router.push('/user/');
|
||||
},
|
||||
|
||||
focusToLoginForm() {
|
||||
this.showLoginForm = true;
|
||||
var that = this;
|
||||
|
@ -213,4 +220,9 @@ export default {
|
|||
width: 52px;
|
||||
}
|
||||
|
||||
.home-link {
|
||||
font-weight: bold;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Reference in a new issue