Basic status posting.
This commit is contained in:
parent
8630f91a13
commit
7980558461
6 changed files with 117 additions and 22 deletions
20
src/components/post_status_form/post_status_form.js
Normal file
20
src/components/post_status_form/post_status_form.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import statusPoster from '../../services/status_poster/status_poster.service.js'
|
||||
|
||||
const PostStatusForm = {
|
||||
data() {
|
||||
return {
|
||||
newStatus: { }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
postStatus(newStatus) {
|
||||
statusPoster.postStatus({
|
||||
status: newStatus.status,
|
||||
store: this.$store
|
||||
})
|
||||
this.newStatus = { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default PostStatusForm
|
20
src/components/post_status_form/post_status_form.vue
Normal file
20
src/components/post_status_form/post_status_form.vue
Normal file
|
@ -0,0 +1,20 @@
|
|||
<template>
|
||||
<div class="post-status-form">
|
||||
<form v-on:submit.prevent="postStatus(newStatus)">
|
||||
<div class="form-group" >
|
||||
<textarea v-model="newStatus.status" placeholder="Just landed in L.A." rows="3" class="form-control"></textarea>
|
||||
</div>
|
||||
<div class="attachments">
|
||||
<div class="attachment" v-for="file in newStatus.files">
|
||||
<img class="thumbnail media-upload" :src="file.image"></img>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-bottom'>
|
||||
<media-upload files="newStatus.files"></media-upload>
|
||||
<button type="submit" class="btn btn-default" >Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./post_status_form.js"></script>
|
|
@ -1,4 +1,5 @@
|
|||
import LoginForm from '../login_form/login_form.vue'
|
||||
import PostStatusForm from '../post_status_form/post_status_form.vue'
|
||||
|
||||
const UserPanel = {
|
||||
computed: {
|
||||
|
@ -11,7 +12,8 @@ const UserPanel = {
|
|||
}
|
||||
},
|
||||
components: {
|
||||
LoginForm
|
||||
LoginForm,
|
||||
PostStatusForm
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</div>
|
||||
|
||||
<div class="panel-footer">
|
||||
<post-status-form></post-status-form>
|
||||
<post-status-form v-if='user'></post-status-form>
|
||||
</div>
|
||||
</div>
|
||||
<login-form v-if='!user'></login-form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue