ordered items display on wall

This commit is contained in:
2020-10-20 16:45:37 +02:00
parent 993ac3e515
commit 24caaf7bb2
+12 -8
View File
@@ -249,8 +249,8 @@ export default {
// create level if not exists // create level if not exists
if (!grid[t]) { if (!grid[t]) {
grid[t] = [] grid[t] = []
// skip the first level's row as we will display wall title // // skip the first level's row as we will display wall title
continue // continue
} }
// create cols for each rows // create cols for each rows
for (var l = cols - 1; l >= 0; l--) { // cols for (var l = cols - 1; l >= 0; l--) { // cols
@@ -519,7 +519,10 @@ export default {
return GRAPHQL.post('', { query: `query { return GRAPHQL.post('', { query: `query {
project(id: "${state.id}") { project(id: "${state.id}") {
visibles(where: { Published: "true" }){ visibles(
where: {Published: "true"},
sort: "Weight:desc"
){
id id
Name Name
Media { Media {
@@ -534,6 +537,7 @@ export default {
id id
Name Name
} }
Weight
} }
contexts(where: { Published: "true" }){ contexts(where: { Published: "true" }){
id id
@@ -580,8 +584,8 @@ export default {
}, },
computeContents ({ dispatch, commit, state }, contents) { computeContents ({ dispatch, commit, state }, contents) {
console.log('computeContents') console.log('computeContents')
return Promise.all(Object.keys(contents).map(function (key) { return Promise.all(Object.keys(contents).map(function (level) {
return Promise.all(contents[key].map(function (content) { return Promise.all(contents[level].map(function (content) {
if (content.Vimeo) { if (content.Vimeo) {
// console.log('Vimeo', content.Vimeo) // console.log('Vimeo', content.Vimeo)
// GET https://vimeo.com/api/oembed.json?url=https%3A//vimeo.com/286898202&width=480&height=360 // GET https://vimeo.com/api/oembed.json?url=https%3A//vimeo.com/286898202&width=480&height=360
@@ -605,10 +609,10 @@ export default {
return content return content
} }
})).then((cts) => { })).then((cts) => {
// return an object with the right key (visible, etc, ...) // return an object with the right level (visible, etc, ...)
// console.log(`${key} cts`, cts) // console.log(`${level} cts`, cts)
let o = {} let o = {}
o[key] = cts o[level] = cts
return o return o
}) })
})).then((a) => { })).then((a) => {