-
+
+
-
+
-
+
@@ -24,7 +31,8 @@
-
+
@@ -47,6 +55,8 @@
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 UserWidget from '@/components/UserWidget';
import VisibilityAction from '@/components/visibility/VisibilityAction';
import EyeIcon from '@/components/icons/EyeIcon';
import PenIcon from '@/components/icons/PenIcon';
@@ -55,6 +65,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 +99,9 @@
VisibilityAction,
EyeIcon,
PenIcon,
- TrashIcon
+ TrashIcon,
+ MoreOptionsWidget,
+ UserWidget
},
computed: {
@@ -150,11 +164,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 +230,13 @@
},
data() {
return {
- showVisibility: false
+ showVisibility: false,
+ me: {}
}
+ },
+
+ apollo: {
+ me: meQuery
}
}
@@ -217,6 +249,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 +275,27 @@
@include regular-text();
}
- &__actions {
+ &__visibility {
position: absolute;
left: -70px;
top: -4px;
display: grid;
}
+ &__actions {
+ position: absolute;
+ top: 10px;
+ right: -45px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ }
+
+ &__user-widget {
+ margin-right: 0;
+ margin-bottom: $small-spacing;
+ }
+
&__action-button {
cursor: pointer;
}
@@ -275,13 +338,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?
diff --git a/server/core/management/commands/import_users.py b/server/core/management/commands/import_users.py
index 1dd90c35..18554ba9 100644
--- a/server/core/management/commands/import_users.py
+++ b/server/core/management/commands/import_users.py
@@ -33,7 +33,7 @@ class Command(BaseCommand):
user, created = User.objects.get_or_create(email=email, username=email)
user.first_name = first_name
user.last_name = last_name
- user.set_unusable_password()
+ user.set_password(User.objects.make_random_password())
user.save()
if row['Rolle'] == 'Lehrer':