Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
253dcd1446
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="content-block__container hideable-element" :class="{'hideable-element--hidden': hidden}">
|
<div class="content-block__container hideable-element" :class="{'hideable-element--hidden': hidden}">
|
||||||
<div class="content-block" :class="specialClass">
|
<div class="content-block" :class="specialClass">
|
||||||
<div class="block-actions" v-if="canEditContentBlock && editModule">
|
<div class="block-actions" v-if="canEditContentBlock && editModule">
|
||||||
<user-widget v-bind="me" class="block-actions__user-widget content-block__user-widget"></user-widget>
|
<user-widget :show-menu="false" v-bind="me" class="block-actions__user-widget content-block__user-widget"></user-widget>
|
||||||
<more-options-widget>
|
<more-options-widget>
|
||||||
<li class="popover-links__link"><a @click="deleteContentBlock(contentBlock)">Löschen</a></li>
|
<li class="popover-links__link"><a @click="deleteContentBlock(contentBlock)">Löschen</a></li>
|
||||||
<li class="popover-links__link"><a @click="editContentBlock(contentBlock)">Bearbeiten</a></li>
|
<li class="popover-links__link"><a @click="editContentBlock(contentBlock)">Bearbeiten</a></li>
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
},
|
},
|
||||||
contentBlocksWithContentLists() {
|
contentBlocksWithContentLists() {
|
||||||
/*
|
/*
|
||||||
collects all conent_list_items in content_lists:
|
collects all content_list_items in content_lists:
|
||||||
{
|
{
|
||||||
text_block,
|
text_block,
|
||||||
content_list_item: [contents...],
|
content_list_item: [contents...],
|
||||||
|
|
@ -146,18 +146,21 @@
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
let contentList = [];
|
let contentList = [];
|
||||||
|
let startingIndex = 0;
|
||||||
let newContent = this.contentBlock.contents.reduce((newContents, content, index) => {
|
let newContent = this.contentBlock.contents.reduce((newContents, content, index) => {
|
||||||
// collect content_list_items
|
// collect content_list_items
|
||||||
if (content.type === 'content_list_item') {
|
if (content.type === 'content_list_item') {
|
||||||
contentList = [...contentList, content]
|
contentList = [...contentList, content]
|
||||||
if (index === this.contentBlock.contents.length - 1) { // content is last element of contents array
|
if (index === this.contentBlock.contents.length - 1) { // content is last element of contents array
|
||||||
return [...newContents, ...this.createContentListOrBlocks(contentList)];
|
startingIndex = this.updateStartingIndex(startingIndex, contentList);
|
||||||
|
return [...newContents, ...this.createContentListOrBlocks(contentList, startingIndex)];
|
||||||
}
|
}
|
||||||
return newContents
|
return newContents;
|
||||||
} else {
|
} else {
|
||||||
// handle all other items and reset current content_list if necessary
|
// handle all other items and reset current content_list if necessary
|
||||||
if (contentList.length !== 0) {
|
if (contentList.length !== 0) {
|
||||||
newContents = [...newContents, ...this.createContentListOrBlocks(contentList), content];
|
newContents = [...newContents, ...this.createContentListOrBlocks(contentList, startingIndex), content];
|
||||||
|
startingIndex = this.updateStartingIndex(startingIndex, contentList);
|
||||||
contentList = [];
|
contentList = [];
|
||||||
return newContents;
|
return newContents;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -165,9 +168,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return Object.assign({}, this.contentBlock, {
|
return Object.assign({}, this.contentBlock, {
|
||||||
contents: newContent
|
contents: this.removeSingleContentListItem(newContent, startingIndex)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
schoolClass() {
|
schoolClass() {
|
||||||
|
|
@ -209,18 +211,29 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
createContentListOrBlocks(contentList) {
|
createContentListOrBlocks(contentList, startingIndex) {
|
||||||
// if list contains only one item, return blocks
|
|
||||||
if (contentList.length === 1) {
|
|
||||||
return contentList[0].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
type: 'content_list',
|
type: 'content_list',
|
||||||
contents: contentList,
|
contents: contentList,
|
||||||
id: contentList[0].id
|
id: contentList[0].id,
|
||||||
|
startingIndex
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
updateStartingIndex(startingIndex, contentList) {
|
||||||
|
return contentList.length > 1 ? startingIndex + contentList.length : startingIndex;
|
||||||
|
},
|
||||||
|
removeSingleContentListItem(content, index) {
|
||||||
|
// just handle the case where we have one contentlistItem ( no index like "a)"" will be shown)
|
||||||
|
if (index > 0) {
|
||||||
|
return content;
|
||||||
|
};
|
||||||
|
|
||||||
|
let contentListIndex = content.findIndex(contentItem => contentItem.type === 'content_list');
|
||||||
|
if (contentListIndex < 0) {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
return [...content.slice(0, contentListIndex), ...content[contentListIndex].contents[0].value, ...content.slice(contentListIndex + 1)];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,28 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="user-widget" :class="{'user-widget--is-profile': isProfile}">
|
<div class="user-widget" :class="{'user-widget--is-profile': isProfile}">
|
||||||
<div class="user-widget__avatar" @click="toggleShowPopover()">
|
<div class="user-widget__avatar" @click="toggleShowPopover()">
|
||||||
<avatar :avatar-url="avatarUrl" :icon-highlighted="isProfile"/>
|
<avatar :avatar-url="avatarUrl" :icon-highlighted="isProfile"/>
|
||||||
</div>
|
|
||||||
<widget-popover v-if="showPopover"
|
|
||||||
@hide-me="showPopover = false"
|
|
||||||
:mobile="mobile"
|
|
||||||
class="user-widget__popover ">
|
|
||||||
<li class="popover-links__link popover-links__link--large popover-links__link--emph">{{firstName}} {{lastName}}</li>
|
|
||||||
<li class="popover-links__link popover-links__link--large">
|
|
||||||
<router-link to="/me/activity" @click="toggleShowPopover()">Aktivität</router-link>
|
|
||||||
</li>
|
|
||||||
<li class="popover-links__link popover-links__link--large" @click="toggleShowPopover()">
|
|
||||||
<router-link to="/me/profile">Profil</router-link>
|
|
||||||
</li>
|
|
||||||
<li class="popover-links__link popover-links__link--large" @click="toggleShowPopover()">
|
|
||||||
<router-link to="/me/myclasses">Klassenliste</router-link>
|
|
||||||
</li>
|
|
||||||
<li class="popover-links__link popover-links__link--large" data-cy="logout" @click="logout()">
|
|
||||||
<a>Logout</a>
|
|
||||||
</li>
|
|
||||||
</widget-popover>
|
|
||||||
</div>
|
</div>
|
||||||
|
<widget-popover v-if="showPopover && showMenu"
|
||||||
|
@hide-me="showPopover = false"
|
||||||
|
:mobile="mobile"
|
||||||
|
class="user-widget__popover ">
|
||||||
|
<li class="popover-links__link popover-links__link--large popover-links__link--emph">{{firstName}} {{lastName}}
|
||||||
|
</li>
|
||||||
|
<li class="popover-links__link popover-links__link--large">
|
||||||
|
<router-link to="/me/activity" @click="toggleShowPopover()">Aktivität</router-link>
|
||||||
|
</li>
|
||||||
|
<li class="popover-links__link popover-links__link--large" @click="toggleShowPopover()">
|
||||||
|
<router-link to="/me/profile">Profil</router-link>
|
||||||
|
</li>
|
||||||
|
<li class="popover-links__link popover-links__link--large" @click="toggleShowPopover()">
|
||||||
|
<router-link to="/me/myclasses">Klassenliste</router-link>
|
||||||
|
</li>
|
||||||
|
<li class="popover-links__link popover-links__link--large" data-cy="logout" @click="logout()">
|
||||||
|
<a>Logout</a>
|
||||||
|
</li>
|
||||||
|
</widget-popover>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -34,15 +35,19 @@
|
||||||
firstName: {
|
firstName: {
|
||||||
type: String
|
type: String
|
||||||
},
|
},
|
||||||
lastName: {
|
lastName: {
|
||||||
type: String
|
type: String
|
||||||
},
|
},
|
||||||
avatarUrl: {
|
avatarUrl: {
|
||||||
type: String
|
type: String
|
||||||
},
|
},
|
||||||
mobile: {
|
mobile: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
showMenu: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -54,13 +59,17 @@
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toggleShowPopover() {
|
toggleShowPopover() {
|
||||||
this.showPopover = !this.showPopover;
|
if (this.showMenu) {
|
||||||
|
this.showPopover = !this.showPopover;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$apollo.mutate({
|
this.$apollo.mutate({
|
||||||
mutation: LOGOUT_MUTATION,
|
mutation: LOGOUT_MUTATION,
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data.logout.success) { location.replace('/') }
|
if (data.logout.success) {
|
||||||
|
location.replace('/')
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
<router-link tag="div" class="book-subnavigation__item" to="/instruments/sprache-kommunikation">Sprache und Kommunikation</router-link>
|
<router-link tag="div" class="book-subnavigation__item" to="/instruments/sprache-kommunikation">Sprache und Kommunikation</router-link>
|
||||||
<router-link tag="div" class="book-subnavigation__item" to="/instruments/gesellschaft">Gesellschaft</router-link>
|
<router-link tag="div" class="book-subnavigation__item" to="/instruments/gesellschaft">Gesellschaft</router-link>
|
||||||
</sub-navigation-item>
|
</sub-navigation-item>
|
||||||
<sub-navigation-item title="News">
|
<!--<sub-navigation-item title="News">-->
|
||||||
<template slot="title">
|
<!--<template slot="title">-->
|
||||||
<h2 class="sub-navigation__title" slot="title">ABU News</h2>
|
<!--<h2 class="sub-navigation__title" slot="title">ABU News</h2>-->
|
||||||
</template>
|
<!--</template>-->
|
||||||
</sub-navigation-item>
|
<!--</sub-navigation-item>-->
|
||||||
</aside>
|
</aside>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="content-list-block__container">
|
<div class="content-list-block__container">
|
||||||
<div class="content-list-wrapper">
|
<div class="content-list-wrapper">
|
||||||
<ol class="content-list">
|
<ol class="content-list" :style="`counter-reset: list ${startingIndex}`">
|
||||||
<li class="content-list__item contentlist-item" :key="contentBlock.id" v-for="contentBlock in contentBlocks">
|
<li class="content-list__item contentlist-item" :key="contentBlock.id" v-for="contentBlock in contentBlocks">
|
||||||
<content-block :contentBlock="contentBlock"></content-block>
|
<content-block :contentBlock="contentBlock"></content-block>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// import ContentBlock from '@/components/ContentBlock';
|
// import ContentBlock from '@/components/ContentBlock';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['contents', 'parent'],
|
props: ['contents', 'parent', 'startingIndex'],
|
||||||
name: 'content-block-list',
|
name: 'content-block-list',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -43,7 +43,6 @@
|
||||||
.content-list-wrapper {
|
.content-list-wrapper {
|
||||||
.content-list {
|
.content-list {
|
||||||
/* https://stackoverflow.com/questions/1632005/ordered-list-html-lower-alpha-with-right-parentheses */
|
/* https://stackoverflow.com/questions/1632005/ordered-list-html-lower-alpha-with-right-parentheses */
|
||||||
counter-reset: list;
|
|
||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
v-if="editModule"
|
v-if="editModule"
|
||||||
:block="objective"></visibility-action>
|
:block="objective"></visibility-action>
|
||||||
<div class="block-actions" v-if="editModule && canEdit">
|
<div class="block-actions" v-if="editModule && canEdit">
|
||||||
<user-widget class="block-actions__user-widget objective__user-widget" v-bind="me"></user-widget>
|
<user-widget class="block-actions__user-widget objective__user-widget" :show-menu="false" v-bind="me"></user-widget>
|
||||||
<more-options-widget>
|
<more-options-widget>
|
||||||
<div class="popover-links__link"><a @click="deleteObjective(objective)">Löschen</a></div>
|
<div class="popover-links__link"><a @click="deleteObjective(objective)">Löschen</a></div>
|
||||||
</more-options-widget>
|
</more-options-widget>
|
||||||
|
|
|
||||||
|
|
@ -35,16 +35,16 @@
|
||||||
<portfolio-illustration></portfolio-illustration>
|
<portfolio-illustration></portfolio-illustration>
|
||||||
</section-block>
|
</section-block>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="start-page__news news">-->
|
<div class="start-page__news news">
|
||||||
<!-- <h2 class="news__title">News</h2>-->
|
<h2 class="news__title">News</h2>
|
||||||
<!-- <news-teaser date="19. Dezember 2018" title="Bilder eines Jahres"-->
|
<news-teaser date="9. September 2019" title="Klima – was sonst?"
|
||||||
<!-- url="https://www.brennpunkt-welt.ch/jahresrückblick-2018/"></news-teaser>-->
|
url="https://abunews-1f178193a10edaabf-4caff67b27d10.webflow.io/"></news-teaser>
|
||||||
<!-- <news-teaser date="20. November 2018" title="100 Jahre Erster Weltkrieg"-->
|
<!--<news-teaser date="20. November 2018" title="100 Jahre Erster Weltkrieg"-->
|
||||||
<!-- url="http://abunews-1f178193a10edaabff3ab828e30af44.webflow.io/"></news-teaser>-->
|
<!--url="http://abunews-1f178193a10edaabff3ab828e30af44.webflow.io/"></news-teaser>-->
|
||||||
<!-- <news-teaser date="31. Oktober 2018" title="Sommerzeit - Festivalzeit"-->
|
<!--<news-teaser date="31. Oktober 2018" title="Sommerzeit - Festivalzeit"-->
|
||||||
<!-- url="https://abunews.webflow.io/"></news-teaser>-->
|
<!--url="https://abunews.webflow.io/"></news-teaser>-->
|
||||||
<!-- <div class="news__more">Mehr...</div>-->
|
<div class="news__more">Mehr...</div>
|
||||||
<!-- </div>-->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
@include light-border(top);
|
@include light-border(top);
|
||||||
|
|
||||||
|
&:last-of-type {
|
||||||
|
@include light-border(bottom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
@include light-border(bottom);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue