2020-12-24 16:37:38 -09:00
|
|
|
<template>
|
|
|
|
<v-container fill-height>
|
2021-01-08 22:57:59 -09:00
|
|
|
<v-row>
|
2020-12-24 16:37:38 -09:00
|
|
|
<v-col sm="12">
|
|
|
|
<v-card
|
|
|
|
v-for="(meal, index) in mealPlan.meals"
|
|
|
|
:key="index"
|
|
|
|
class="my-2"
|
|
|
|
>
|
|
|
|
<v-row dense no-gutters align="center" justify="center">
|
|
|
|
<v-col order="1" md="6" sm="12">
|
2021-01-08 22:57:59 -09:00
|
|
|
<v-card
|
|
|
|
flat
|
|
|
|
class="align-center justify-center"
|
|
|
|
align="center"
|
|
|
|
justify="center"
|
|
|
|
>
|
|
|
|
<v-card-title class="justify-center">
|
|
|
|
{{ meal.name }}
|
|
|
|
</v-card-title>
|
2020-12-24 16:37:38 -09:00
|
|
|
<v-card-subtitle> {{ meal.dateText }}</v-card-subtitle>
|
|
|
|
|
|
|
|
<v-card-text> {{ meal.description }} </v-card-text>
|
|
|
|
|
2021-01-08 22:57:59 -09:00
|
|
|
<v-btn
|
|
|
|
align="center"
|
|
|
|
color="secondary"
|
|
|
|
text
|
|
|
|
@click="$router.push(`/recipe/${meal.slug}`)"
|
|
|
|
>
|
|
|
|
View Recipe
|
|
|
|
</v-btn>
|
2020-12-24 16:37:38 -09:00
|
|
|
</v-card>
|
|
|
|
</v-col>
|
|
|
|
<v-col order-sm="0" :order-md="getOrder(index)" md="6" sm="12">
|
|
|
|
<v-card>
|
|
|
|
<v-img :src="getImage(meal.image)" max-height="300"> </v-img>
|
|
|
|
</v-card>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-card>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-container>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-01-08 17:09:03 -09:00
|
|
|
import api from "../api";
|
|
|
|
import utils from "../utils";
|
2020-12-24 16:37:38 -09:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
mealPlan: {},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
this.mealPlan = await api.mealPlans.thisWeek();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getOrder(index) {
|
|
|
|
if (index % 2 == 0) return 2;
|
|
|
|
else return 0;
|
|
|
|
},
|
|
|
|
getImage(image) {
|
|
|
|
return utils.getImageURL(image);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
</style>
|