2019-05-24 23:11:42 +00:00
|
|
|
<template>
|
2019-05-25 00:04:57 +00:00
|
|
|
<div id="app" class="antialiased min-h-screen font-sans bg-gray-100 text-black p-12">
|
2019-05-25 15:21:05 +00:00
|
|
|
<div class="w-full max-w-2xl mx-auto">
|
|
|
|
<accepted-sessions-list :sessions="sortedSessions" />
|
2019-06-02 22:36:07 +00:00
|
|
|
<session-form></session-form>
|
2019-05-25 15:21:05 +00:00
|
|
|
</div>
|
2019-05-24 23:11:42 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2019-05-24 23:24:36 +00:00
|
|
|
<style src="./css/app.css"></style>
|
2019-05-24 23:45:57 +00:00
|
|
|
|
|
|
|
<script>
|
2019-05-25 11:33:43 +00:00
|
|
|
import _ from 'lodash'
|
2019-05-25 11:08:54 +00:00
|
|
|
import AcceptedSessionsList from '@/components/AcceptedSessionsList'
|
2019-06-02 22:36:07 +00:00
|
|
|
import SessionForm from '@/components/SessionForm'
|
2019-05-25 11:08:54 +00:00
|
|
|
|
2019-05-24 23:45:57 +00:00
|
|
|
const axios = require('axios')
|
2019-05-25 00:04:57 +00:00
|
|
|
|
2019-05-25 11:08:54 +00:00
|
|
|
export default {
|
|
|
|
components: {
|
2019-06-02 22:36:07 +00:00
|
|
|
AcceptedSessionsList,
|
|
|
|
SessionForm
|
2019-05-25 11:08:54 +00:00
|
|
|
},
|
|
|
|
|
2019-05-25 00:04:57 +00:00
|
|
|
data () {
|
|
|
|
return {
|
2019-05-25 10:39:00 +00:00
|
|
|
loaded: false,
|
2019-05-25 00:04:57 +00:00
|
|
|
sessions: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-05-25 11:03:13 +00:00
|
|
|
mounted () {
|
2019-05-25 00:04:57 +00:00
|
|
|
const baseUrl = 'http://drupaltestcamp.docksal'
|
|
|
|
|
2019-05-25 11:17:34 +00:00
|
|
|
axios.get(`${baseUrl}/jsonapi/node/session`)
|
2019-05-25 00:04:57 +00:00
|
|
|
.then(({ data }) => {
|
2019-05-25 10:39:00 +00:00
|
|
|
this.loaded = true
|
2019-05-25 00:04:57 +00:00
|
|
|
this.sessions = data.data
|
|
|
|
})
|
2019-05-25 11:33:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
sortedSessions: function () {
|
|
|
|
return _(this.sessions).sortBy(session => {
|
|
|
|
return session.attributes.title
|
|
|
|
})
|
|
|
|
}
|
2019-05-25 00:04:57 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-24 23:45:57 +00:00
|
|
|
</script>
|