Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
shg-dsi committed Oct 16, 2017
2 parents a233609 + 409f19d commit 4518464
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/newsstories/story/Story.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/resources/static/js/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vueapp/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</q-toolbar-title>
</q-toolbar>
<router-view></router-view>
<q-fixed-position corner="bottom-right" :offset="[560, 16]">
<q-fixed-position corner="bottom-right" :offset="[16, 16]">
<q-fab
ref="createstory"
color="primary"
Expand Down
5 changes: 5 additions & 0 deletions vueapp/src/components/Feeds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</q-card-main>
<q-card-separator />
<q-card-actions>
<q-btn flat @click="edit( story.id )">Edit</q-btn>
<q-btn flat @click="getStory( story.id )">HTML</q-btn>
<q-btn flat @click="getStoryJson( story.id )">JSON</q-btn>
<q-btn flat @click="getStoryXml( story.id )">XML</q-btn>
Expand Down Expand Up @@ -72,6 +73,10 @@ export default {
getStoryXml (storyId) {
this.$router.push({name: 'news_detail_xml', params: {id: storyId}})
},
edit (storyId) {
this.$router.push({name: 'edit_news', params: {id: storyId}})
}
}
}
Expand Down
1 change: 1 addition & 0 deletions vueapp/src/components/NewsDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</q-card-main>
<q-card-separator />
<q-card-actions>
<q-btn flat @click="edit( story.id )">Edit</q-btn>
<q-btn flat @click="back()">Back</q-btn>
</q-card-actions>
</q-card>
Expand Down
37 changes: 28 additions & 9 deletions vueapp/src/components/NewsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
<div class="layout-padding docs-input row justify-center">
<div style="width: 500px; max-width: 90vw; text-align: left">
<q-card>
<q-card-title>
Create News Story
</q-card-title>
<q-card-title v-if="this.$route.params.id">Edit News Story</q-card-title>
<q-card-title v-else>Create News Story</q-card-title>
<q-card-main>
<q-field>
<q-input v-model="story.title" float-label="Title" :value="story.title" />
<q-input v-model="story.title" float-label="Title" />
</q-field>
<q-field>
<q-input v-model="story.author.fullName" float-label="Author" :value="story.author.fullName" />
<q-input v-model="story.author.fullName" float-label="Author" />
</q-field>
<q-field>
<q-datetime v-model="story.publishedDate" format="ddd, DD-MMM-YYYY hh:mm:ss A" type="datetime" />
<q-datetime v-model="story.publishedDate" format="ddd, DD-MMM-YYYY hh:mm:ss A" type="datetime" float-label="Publish Date" />
</q-field>
<q-field>
<q-input type="textarea" v-model="story.body" float-label="Details" :value="story.body" />
<q-input type="textarea" v-model="story.body" float-label="Details" :min-rows="4" />
</q-field>
</q-card-main>
<q-card-separator />
<q-card-actions>
<q-btn flat color="secondary" @click="submit()">Submit</q-btn>
<q-btn flat @click="cancel()">Cancel</q-btn>
</q-card-actions>
</q-card>
</div>
Expand Down Expand Up @@ -68,12 +68,23 @@ export default {
},
data () {
return {
let data = {
story: {
title: '',
body: '',
publishedDate: new Date(),
author: {}
author: {
fullName: ''
}
}
}
if (this.$route.params.id) {
this.$http.get('/stories/' + this.$route.params.id)
.then(resp => {
data.story = resp.data
})
}
return data
},
methods: {
Expand All @@ -84,6 +95,14 @@ export default {
.then(resp => {
this.$router.push({name: 'feeds'})
})
},
edit (storyId) {
this.$router.push({name: 'edit_news', params: {id: storyId}})
},
cancel () {
this.$router.go(-1)
}
}
}
Expand Down

0 comments on commit 4518464

Please sign in to comment.