add cohorts and back to home in default template
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
<template>
|
||||
<v-container id='home' fluid>
|
||||
<div class="mt-3 mb-1 ml-1">
|
||||
<v-btn text color='primary' to='/'><v-icon v-text='mdiChevronLeft'/></v-btn>
|
||||
<v-btn v-for='cohort in cohorts' text color='primary' :key='cohort.id' :to='`/g/${cohort.name}`' v-text='cohort.name' />
|
||||
</div>
|
||||
|
||||
<h1 class='d-block text-h3 font-weight-black text-center align-center text-uppercase mt-10 mb-12 mx-auto w-100 text-underline'><u>{{cohort}}</u></h1>
|
||||
|
||||
@@ -15,23 +11,16 @@
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import { mdiChevronLeft } from '@mdi/js'
|
||||
import Event from '@/components/Event'
|
||||
|
||||
export default {
|
||||
name: 'Tag',
|
||||
components: { Event },
|
||||
data ({ $route }) {
|
||||
return { mdiChevronLeft, cohort: $route.params.cohort, cohorts: [] }
|
||||
},
|
||||
async fetch () {
|
||||
this.cohorts = await this.$axios.$get('/cohorts')
|
||||
},
|
||||
async asyncData ({ $axios, params, error }) {
|
||||
try {
|
||||
const cohort = params.cohort
|
||||
const events = await $axios.$get(`/cohorts/${cohort}`)
|
||||
return { events }
|
||||
return { events, cohort }
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
error({ statusCode: 400, message: 'Error!' })
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<v-container id='home' fluid>
|
||||
<div class="mt-3 mb-1 ml-1">
|
||||
<v-btn text color='primary' to='/'><v-icon v-text='mdiChevronLeft'/></v-btn>
|
||||
</div>
|
||||
|
||||
<h1 class='d-block text-h4 font-weight-black text-center text-uppercase mt-5 mx-auto w-100 text-underline'><u>{{place.name}}</u></h1>
|
||||
<span class="d-block text-subtitle text-center w-100 mb-14">{{place.address}}</span>
|
||||
@@ -15,15 +12,11 @@
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import { mdiChevronLeft } from '@mdi/js'
|
||||
import Event from '@/components/Event'
|
||||
|
||||
export default {
|
||||
name: 'Tag',
|
||||
components: { Event },
|
||||
data () {
|
||||
return { mdiChevronLeft }
|
||||
},
|
||||
asyncData ({ $axios, params, error }) {
|
||||
try {
|
||||
const place = params.place
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<v-container id='home' fluid>
|
||||
<div class="mt-3 mb-1 ml-1">
|
||||
<v-btn text color='primary' to='/'><v-icon v-text='mdiChevronLeft'/></v-btn>
|
||||
</div>
|
||||
|
||||
<h1 class='d-block text-h3 font-weight-black text-center align-center text-uppercase mt-5 mb-16 mx-auto w-100 text-underline'><u>{{tag}}</u></h1>
|
||||
|
||||
@@ -14,15 +11,11 @@
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import { mdiChevronLeft } from '@mdi/js'
|
||||
import Event from '@/components/Event'
|
||||
|
||||
export default {
|
||||
name: 'Tag',
|
||||
components: { Event },
|
||||
data () {
|
||||
return { mdiChevronLeft }
|
||||
},
|
||||
async asyncData ({ $axios, params, error }) {
|
||||
try {
|
||||
const tag = params.tag
|
||||
|
||||
Reference in New Issue
Block a user