forked from tomluence/monkov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
403 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<template lang="html"> | ||
<div class="container-with-aside"> | ||
<nav-aside></nav-aside> | ||
<section class="draft-list-column"> | ||
<h3 class="page-title"> | ||
<i class="icon-wenzhang iconfont"></i> | ||
Draft List | ||
<i class="iconfont icon-jiahao draft-add" @click="newDraft"></i> | ||
</h3> | ||
<draft-list></draft-list> | ||
</section> | ||
<div class="draft-edit"> | ||
<draft-editor v-if="currentId"></draft-editor> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import DraftEditor from 'components/common/DraftEditor' | ||
import DraftList from 'components/common/DraftList' | ||
import NavAside from 'components/common/NavAside' | ||
import { | ||
mapGetters, | ||
mapActions | ||
} from 'vuex' | ||
import api from 'src/api' | ||
export default { | ||
components: { | ||
NavAside, | ||
DraftEditor, | ||
DraftList | ||
}, | ||
computed: { ...mapGetters(['saved', 'titleSaved', 'currentId']) | ||
}, | ||
methods: { ...mapActions(['getDraftList', 'createDraft']), | ||
newDraft() { | ||
if (this.saved && this.titleSaved) this.createDraft() | ||
else window.alert('Current draft is saving, please try again') | ||
} | ||
}, | ||
watch: { | ||
'$route': 'getDraftList' | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus"> | ||
@import '../stylus/simplemde.styl' | ||
@import '../stylus/_settings.styl' | ||
.container-with-aside | ||
margin-left 70px | ||
height 100% | ||
.draft-list-column | ||
float left | ||
border-right 1px solid $border | ||
height 100% | ||
width 300px | ||
overflow-y auto | ||
.draft-add | ||
cursor pointer | ||
float right | ||
margin-right 10px | ||
margin-top 2px | ||
.page-title | ||
color $light | ||
padding-left 25px | ||
font-weight 400 | ||
.draft-edit | ||
overflow auto | ||
height 100% | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
<template lang="html"> | ||
<div> | ||
<header class="banner"> | ||
<!-- <img src="../assets/img/logo.png" class="banner-logo" alt="logo"> --> | ||
</header> | ||
<div class="center-box"> | ||
<div class="flash-bar danger" v-show="loginErr">Loging Failed {{loginErrMsg}}</div> | ||
<section class="login-box"> | ||
<div class="login-header"> | ||
<h3> | ||
Blog Login | ||
</h3> | ||
</div> | ||
<div class="login-body"> | ||
<input type="text" class="form-control top" placeholder="username" v-model="username"> | ||
<input type="password" class="form-control bottom" placeholder="password" v-model="password" @keyup.13="login"> | ||
</div> | ||
<div class="login-footer"> | ||
<div class="login-button-Container"> | ||
<button class="btn btn-save btn-block" @click="login"> | ||
Login | ||
</button> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { | ||
mapActions | ||
} from 'vuex' | ||
import api from 'src/api' | ||
import md5 from 'md5' | ||
export default { | ||
data() { | ||
return { | ||
username: '', | ||
password: '', | ||
loginErr: false, | ||
loginErrMsg: '' | ||
} | ||
}, | ||
methods: { ...mapActions(['createToken']), | ||
login() { | ||
this.createToken(this.username, md5(this.password).toUpperCase()).catch(err => { | ||
console.log(err) | ||
this.loginErr = true | ||
this.loginErrMsg = err.error_message.error | ||
}) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus"> | ||
@import '../stylus/_settings.styl' | ||
.banner | ||
padding 10px 0 | ||
text-align center | ||
border-bottom 1px solid #EEE | ||
margin-bottom 20px | ||
.banner-logo | ||
height 35px | ||
.center-box | ||
max-width 400px | ||
margin 0 auto | ||
padding 32px 15px | ||
.login-box | ||
background #fafafa | ||
border-radius 10px | ||
box-shadow 0 0px 2px #CCC | ||
padding 15px | ||
.login-header | ||
text-align center | ||
line-height 1.5 | ||
margin 0 0 10px 0 | ||
.login-button-Container | ||
width 200px | ||
margin 0 auto | ||
.flash-bar | ||
box-sizing border-box | ||
width 100% | ||
padding 15px | ||
color #fff | ||
border 1px solid transparent | ||
border-radius: 6px; | ||
margin-bottom: 10px; | ||
&.success | ||
background-color $blue | ||
border-color $blue | ||
&.danger | ||
background-color $red | ||
border-color $red | ||
&.info | ||
background-color $darkGrey | ||
border-color $darkGrey | ||
text-align center | ||
.btn | ||
cursor pointer | ||
border 1px solid transparent | ||
border-radius 3px | ||
padding 6px 10px | ||
text-align center | ||
vertical-align middle | ||
outline 0 | ||
&.btn-save | ||
color #fff | ||
background-color $green | ||
border-color $green | ||
&.btn-info | ||
color #fff | ||
background-color $grey | ||
border-color $grey | ||
&.btn-border | ||
color $dark | ||
background-color white | ||
border-color $grey | ||
&:hover | ||
border-color $green | ||
&.btn-cancel | ||
color #fff | ||
background-color $red | ||
border-color $red | ||
&.btn-block | ||
width 100% | ||
box-sizing border-box | ||
.form-control | ||
color $black | ||
box-sizing border-box | ||
padding 10px 8px | ||
width 100% | ||
height auto | ||
box-shadow none | ||
border 1px solid $border | ||
background-color #fff | ||
outline 0 | ||
&.top | ||
border-radius 5px 5px 0 0 | ||
margin-bottom 0 | ||
&.bottom | ||
border-radius 0 0 5px 5px | ||
border-top 0 | ||
margin-bottom 20px | ||
</style> |
Oops, something went wrong.