Procházet zdrojové kódy

make login pretty

pull/342/head
Guillaume Vincent před 8 roky
rodič
revize
834ced01ce
6 změnil soubory, kde provedl 22 přidání a 32 odebrání
  1. +2
    -8
      src/components/sidebar.vue
  2. +0
    -0
      src/images/logo.png
  3. +1
    -1
      src/landing-page/LoginBar/LoginBar.vue
  4. +1
    -1
      src/landing-page/Navbar/Navbar.vue
  5. +5
    -1
      src/main.js
  6. +13
    -21
      src/pages/login.vue

+ 2
- 8
src/components/sidebar.vue Zobrazit soubor

@@ -60,12 +60,6 @@
<div class="sidebar">
<ul class="sidebar-menu main">
<li class="sidebar-item" v-link-active>
<a v-link="{ path: '/', activeClass: 'active', exact: true}" class="sidebar-link">
<i class="icon ion-ios-home-outline"></i>
<span>home</span>
</a>
</li>
<li class="sidebar-item" v-link-active>
<a v-link="{ path: '/entries/', activeClass: 'active' }" class="sidebar-link">
<i class="icon ion-ios-key-outline"></i>
<span>passwords</span>
@@ -80,7 +74,7 @@
</a>
</li>
<li class="sidebar-item">
<a href="#" class="sidebar-link" @click="logout()">
<a class="sidebar-link" @click.stop.prevent="logout()">
<i class="icon ion-ios-log-out-outline"></i>
<span>logout</span>
</a>
@@ -97,7 +91,7 @@
logout(){
auth.logout();
logging.success('Thank you for spending quality time with LessPass');
this.$router.go('/login/');
this.$router.go('/');
}
}
}


src/landing-page/Navbar/logo.png → src/images/logo.png Zobrazit soubor


+ 1
- 1
src/landing-page/LoginBar/LoginBar.vue Zobrazit soubor

@@ -19,7 +19,7 @@
<div id="login-bar">
<div class="container">
<nav class="nav nav-inline pull-xs-right">
<a class="nav-link bg-primary" v-link="{ path: '/app/' }">
<a class="nav-link bg-primary" v-link="{ path: '/entries/' }">
{{ $t('login.LOGIN') }}
</a>
<a class="nav-link" v-link="{ path: '/register/' }">


+ 1
- 1
src/landing-page/Navbar/Navbar.vue Zobrazit soubor

@@ -20,7 +20,7 @@
<ul class="nav navbar-nav">
<li class="nav-item">
<a href="/">
<img id="navbar__logo" src="logo.png" alt="logo">
<img id="navbar__logo" src="../../images/logo.png" alt="logo">
</a>
</li>
</ul>


+ 5
- 1
src/main.js Zobrazit soubor

@@ -48,7 +48,11 @@ auth.localStorage = localStorage;
router.beforeEach(transition => {
auth.checkAuth()
.then(() => {
transition.next();
if (transition.to.path === '/') {
transition.redirect('/entries/');
} else {
transition.next();
}
})
.catch(() => {
if (transition.to.authRequired) {


+ 13
- 21
src/pages/login.vue Zobrazit soubor

@@ -1,37 +1,29 @@
<template>
<div id="login-page">
<div class="col-sm-4 col-sm-offset-4">
<div class="card card-block">
<h4 class="card-title">LessPass</h4>
<p class="card-text">You must log in to continue.</p>
<div class="col-sm-3 col-sm-offset-4">
<div class="card card-block m-y-2">
<div class="text-xs-center">
<img class="m-t-1 m-b-2" src="../images/logo.png" alt="logo">
</div>
<form @submit="login()">
<fieldset class="form-group">
<label for="email">Email</label>
<label for="email" class="sr-only">Email</label>

<div class="input-group">
<span class="input-group-addon"><i class="icon ion-ios-person"></i></span>
<input type="text" class="form-control" id="email"
<input type="text" class="form-control" id="email"
placeholder="Enter your email"
v-model="user.email" autofocus>
</div>
</fieldset>
<fieldset class="form-group">
<label for="password">Password</label>
<label for="password" class="sr-only">Password</label>

<div class="input-group">
<span class="input-group-addon"><i class="icon ion-ios-key"></i></span>
<input type="password" class="form-control" id="password"
<input type="password" class="form-control" id="password"
v-model="user.password"
placeholder="Enter your password">
</div>
</fieldset>
<button type="submit" class="btn btn-primary btn-block">Login</button>
<fieldset class="form-group row text-xs-center m-t-2">
<div class="col-xs-6">
<a v-link="{ path: '/sign_up/'}"><u>Sign Up</u></a>
</div>
<div class="col-xs-6">
<a v-link="{ path: '/reset/'}"><u>forget password?</u></a>
<fieldset class="form-group row m-t-2">
<div class="col-xs-12">
help, I <a v-link="{ path: '/reset/'}"><u>forgot my password</u></a>
</div>
</fieldset>
</form>
@@ -57,7 +49,7 @@
auth.login(this.user)
.then(()=> {
logging.success('Welcome to LessPass');
this.$router.go('/');
this.$router.go('/entries/');
})
.catch(() => {
logging.error('Invalid login credentials');


Načítá se…
Zrušit
Uložit