-
+
+
-
+
-
+
@@ -24,7 +30,8 @@
-
+
@@ -47,6 +54,7 @@
import Survey from '@/components/content-blocks/SurveyBlock';
import Solution from '@/components/content-blocks/Solution';
import AddContentBlockButton from '@/components/AddContentBlockButton';
+ import MoreOptionsWidget from '@/components/MoreOptionsWidget';
import VisibilityAction from '@/components/visibility/VisibilityAction';
import EyeIcon from '@/components/icons/EyeIcon';
import PenIcon from '@/components/icons/PenIcon';
@@ -55,6 +63,8 @@
import CHAPTER_QUERY from '@/graphql/gql/chapterQuery.gql';
import DELETE_CONTENT_BLOCK_MUTATION from '@/graphql/gql/mutations/deleteContentBlock.gql';
+ import {meQuery} from '@/graphql/queries';
+
import {mapGetters} from 'vuex';
const instruments = {
@@ -87,7 +97,8 @@
VisibilityAction,
EyeIcon,
PenIcon,
- TrashIcon
+ TrashIcon,
+ MoreOptionsWidget
},
computed: {
@@ -150,11 +161,24 @@
return [...newContents, content]
}
}
- }, [])
+ }, []);
return Object.assign({}, this.contentBlock, {
contents: newContent
});
+ },
+ schoolClass() {
+ return this.me.selectedClass;
+ },
+ hidden() {
+ if (this.contentBlock.userCreated) {
+ if (this.schoolClass.id === '') {
+ return false;
+ }
+ return !this.contentBlock.visibleFor.map(entry => entry.id).includes(this.schoolClass.id);
+ } else {
+ return this.contentBlock.hiddenFor.map(entry => entry.id).includes(this.schoolClass.id);
+ }
}
},
@@ -203,8 +227,13 @@
},
data() {
return {
- showVisibility: false
+ showVisibility: false,
+ me: {}
}
+ },
+
+ apollo: {
+ me: meQuery
}
}
@@ -217,6 +246,23 @@
margin-bottom: 2.5em;
position: relative;
+ &__container {
+ position: relative;
+
+ &--hidden {
+ &::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ background: rgba(255,255,255,0.5);
+ z-index: 10;
+ }
+ }
+ }
+
&__title {
line-height: 1.5;
}
@@ -226,13 +272,19 @@
@include regular-text();
}
- &__actions {
+ &__visibility {
position: absolute;
left: -70px;
top: -4px;
display: grid;
}
+ &__actions {
+ position: absolute;
+ top: 10px;
+ right: -45px;
+ }
+
&__action-button {
cursor: pointer;
}
@@ -275,13 +327,15 @@
}
}
- /deep/ ul {
- padding-left: 25px;
- }
+ /deep/ .text-block {
+ ul {
+ padding-left: 25px;
+ }
- /deep/ li {
- list-style: disc;
- line-height: 1.5;
+ li {
+ list-style: disc;
+ line-height: 1.5;
+ }
}
}
diff --git a/client/src/components/visibility/VisibilityAction.vue b/client/src/components/visibility/VisibilityAction.vue
index 87703ed4..e5dd3778 100644
--- a/client/src/components/visibility/VisibilityAction.vue
+++ b/client/src/components/visibility/VisibilityAction.vue
@@ -31,7 +31,7 @@
return this.block.__typename === 'ContentBlockNode';
},
schoolClass() {
- return this.me.selectedClass || {id: 'U2Nob29sQ2xhc3NOb2RlOjE='}; // todo: remove after merge with select class feature
+ return this.me.selectedClass;
},
hidden() {
// is this content block / objective group user created?