added showrooms pages, made page-title color
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<article class="showroom">
|
||||
<header>
|
||||
<h1 v-html="item.name" />
|
||||
</header>
|
||||
<section class="images">
|
||||
<figure v-html="item.field_visuels"></figure>
|
||||
</section>
|
||||
<section class="content">
|
||||
<address v-html="item.field_public_address" />
|
||||
<div class="phone" v-html="item.field_public_phone" />
|
||||
<div class="email" v-html="item.field_public_email" />
|
||||
</section>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { JSONAPI } from 'vuejs/api/json-axios'
|
||||
import router from 'vuejs/route'
|
||||
|
||||
let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
|
||||
|
||||
export default {
|
||||
name: "Showroom",
|
||||
router,
|
||||
props: ['item'],
|
||||
// data(){
|
||||
// return {
|
||||
// alias: this.item.view_node.replace(/^.?\/showroom\//g, '')
|
||||
// }
|
||||
// },
|
||||
// methods:{}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
@ -155,25 +155,27 @@ export default {
|
||||
obj.data.forEach((e) => {
|
||||
// get the included values
|
||||
let included = inc.find((i) => { return i.id == e.id })
|
||||
// fill the values
|
||||
switch (key) {
|
||||
case 'field_visuel':
|
||||
field = e.meta
|
||||
field.id = e.id
|
||||
field.src = included.links.card_medium.href
|
||||
break;
|
||||
case 'field_linked_materials':
|
||||
case 'field_thesaurus':
|
||||
case 'field_tags':
|
||||
field = included.attributes
|
||||
field.id = included.id
|
||||
break;
|
||||
// case 'field_showroom':
|
||||
// field = included.attributes
|
||||
// break
|
||||
default:
|
||||
if(typeof included != 'undefined'){
|
||||
// fill the values
|
||||
switch (key) {
|
||||
case 'field_visuel':
|
||||
field = e.meta
|
||||
field.id = e.id
|
||||
field.src = included.links.card_medium.href
|
||||
break;
|
||||
case 'field_linked_materials':
|
||||
case 'field_thesaurus':
|
||||
case 'field_tags':
|
||||
field = included.attributes
|
||||
field.id = included.id
|
||||
break;
|
||||
// case 'field_showroom':
|
||||
// field = included.attributes
|
||||
// break
|
||||
default:
|
||||
}
|
||||
this.content[key].push(field)
|
||||
}
|
||||
this.content[key].push(field)
|
||||
})
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div id="showrooms">
|
||||
<div class="loading" v-if="!items.length">
|
||||
<span>Loading ...</span>
|
||||
</div>
|
||||
<Showroom
|
||||
v-else
|
||||
v-for="item in items"
|
||||
v-bind:key="item.uuid"
|
||||
:item="item"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import Showroom from 'vuejs/components/Content/Showroom'
|
||||
import { mapState, mapActions } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "Showrooms",
|
||||
// data() {
|
||||
// return {
|
||||
// items:[],
|
||||
// page:0
|
||||
// }
|
||||
// },
|
||||
computed: {
|
||||
...mapState({
|
||||
items: state => state.Showrooms.items
|
||||
})
|
||||
},
|
||||
created(){
|
||||
if(!this.items.length)
|
||||
this.getItems()
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
getItems: 'Showrooms/getItems'
|
||||
})
|
||||
},
|
||||
components: {
|
||||
Showroom
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
Reference in New Issue
Block a user