From 0e30f0bd45db149be5e060bc6fea32aeb5d85c72 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Fri, 14 Sep 2018 15:57:57 +0200 Subject: [PATCH] Add new room page --- client/src/components/rooms/AddRoom.vue | 5 +- client/src/components/rooms/NewRoom.vue | 77 +++++++++++++++++ client/src/components/rooms/RoomColors.vue | 85 +++++++++++++++++++ client/src/layouts/DefaultLayout.vue | 2 +- client/src/pages/newRoom.vue | 23 +++++ client/src/pages/room.vue | 2 + client/src/router/index.js | 2 + client/src/styles/_buttons.scss | 4 + client/src/styles/_variables.scss | 6 +- server/book/factories.py | 4 +- .../core/management/commands/dummy_rooms.py | 12 +-- 11 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 client/src/components/rooms/NewRoom.vue create mode 100644 client/src/components/rooms/RoomColors.vue create mode 100644 client/src/pages/newRoom.vue diff --git a/client/src/components/rooms/AddRoom.vue b/client/src/components/rooms/AddRoom.vue index be4d774c..532b4ec8 100644 --- a/client/src/components/rooms/AddRoom.vue +++ b/client/src/components/rooms/AddRoom.vue @@ -1,7 +1,7 @@ + + diff --git a/client/src/components/rooms/RoomColors.vue b/client/src/components/rooms/RoomColors.vue new file mode 100644 index 00000000..aae1557e --- /dev/null +++ b/client/src/components/rooms/RoomColors.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/client/src/layouts/DefaultLayout.vue b/client/src/layouts/DefaultLayout.vue index 3bdb07c3..b255b2e8 100644 --- a/client/src/layouts/DefaultLayout.vue +++ b/client/src/layouts/DefaultLayout.vue @@ -85,7 +85,7 @@ align-items: center; justify-content: space-around; background-color: $color-white; - grid-auto-rows: 60px; + grid-auto-rows: 50px; width: 100%; grid-template-columns: 1fr 1fr 1fr; diff --git a/client/src/pages/newRoom.vue b/client/src/pages/newRoom.vue new file mode 100644 index 00000000..380cefcc --- /dev/null +++ b/client/src/pages/newRoom.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/client/src/pages/room.vue b/client/src/pages/room.vue index a940adab..aad94a13 100644 --- a/client/src/pages/room.vue +++ b/client/src/pages/room.vue @@ -119,6 +119,7 @@ }, roomAppearance: { set(value) { + // todo: remove, this does nothing this.$store.dispatch('setSpecialContainerClass', value); }, get() { @@ -139,6 +140,7 @@ result({data, loading, networkStatus}) { if (!loading) { this.room = Object.assign({}, this.$getRidOfEdges(data).room); + this.$store.dispatch('setSpecialContainerClass', this.room.appearance); } } } diff --git a/client/src/router/index.js b/client/src/router/index.js index 3c87da3f..78d8bb78 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -6,6 +6,7 @@ import book from '@/pages/book' import module from '@/pages/module' import rooms from '@/pages/rooms' import room from '@/pages/room' +import newRoom from '@/pages/newRoom' import article from '@/pages/article' import basicknowledge from '@/pages/basicknowledge' import p404 from '@/pages/p404' @@ -14,6 +15,7 @@ const routes = [ {path: '/', name: 'module', component: module}, {path: '/module', name: 'module', component: module}, {path: '/rooms', name: 'rooms', component: rooms}, + {path: '/room/new', name: 'new-room', component: newRoom}, {path: '/room/:slug', name: 'room', component: room, props: true}, {path: '/article', name: 'article', component: article, meta: {layout: 'simple'}}, {path: '/basic-knowledge', name: 'basic-knowledge', component: basicknowledge, meta: {layout: 'simple'}}, diff --git a/client/src/styles/_buttons.scss b/client/src/styles/_buttons.scss index e61e1459..a8ce398c 100644 --- a/client/src/styles/_buttons.scss +++ b/client/src/styles/_buttons.scss @@ -11,4 +11,8 @@ &--active { border-color: $color-brand; } + + &--primary { + border-color: $color-brand; + } } diff --git a/client/src/styles/_variables.scss b/client/src/styles/_variables.scss index 538348fb..6dd3718b 100644 --- a/client/src/styles/_variables.scss +++ b/client/src/styles/_variables.scss @@ -24,11 +24,13 @@ $color-brand-light: #ddf3ee; /* greyscale */ $color-darkgrey-1: #333333; $color-darkgrey-2: #515151; -$color-grey: #a1a1a1; +$color-grey: rgba(51, 51, 51, 0.5); +$color-lightgrey-2: #dbdbdb; $color-lightgrey: #f3f3f3; $color-white: #ffffff; + $header-color: $color-darkgrey-1; $intro-color: $color-grey; @@ -44,7 +46,7 @@ $green: #6DD79A; $brown: #EB9E77; - +$default-border-radius: 13px; //modal stuff $modal-lateral-padding: 34px; diff --git a/server/book/factories.py b/server/book/factories.py index af326d64..a8e1618a 100644 --- a/server/book/factories.py +++ b/server/book/factories.py @@ -58,7 +58,7 @@ class BasicKnowledgeBlockFactory(wagtail_factories.StructBlockFactory): class ImageUrlBlockBlockFactory(wagtail_factories.StructBlockFactory): title = fake_title() - url = factory.LazyAttribute(lambda x: 'https://picsum.photos/300/200/?random') + url = factory.LazyAttribute(lambda x: 'https://picsum.photos/600/400/?random') class Meta: model = ImageUrlBlock @@ -66,7 +66,7 @@ class ImageUrlBlockBlockFactory(wagtail_factories.StructBlockFactory): class LinkBlockFactory(wagtail_factories.StructBlockFactory): text = fake_title() - url = factory.LazyAttribute(lambda x: 'https://picsum.photos/300/200/?random') + url = factory.LazyAttribute(lambda x: 'https://picsum.photos/600/400/?random') class Meta: model = LinkBlock diff --git a/server/core/management/commands/dummy_rooms.py b/server/core/management/commands/dummy_rooms.py index d3a28c8f..2481fea9 100644 --- a/server/core/management/commands/dummy_rooms.py +++ b/server/core/management/commands/dummy_rooms.py @@ -25,7 +25,7 @@ data = [ 'type': 'image_url', 'value': { 'title': 'Ein Bild sagt mehr als 1000 Worte', - 'url': 'https://picsum.photos/300/200/?random' + 'url': 'https://picsum.photos/600/400/?random' } }, { @@ -51,7 +51,7 @@ data = [ 'type': 'image_url', 'value': { 'title': 'Ein Bild sagt mehr als 1000 Worte', - 'url': 'https://picsum.photos/300/200/?random' + 'url': 'https://picsum.photos/600/400/?random' } }, { @@ -77,7 +77,7 @@ data = [ 'type': 'image_url', 'value': { 'title': 'Ein Bild sagt mehr als 1000 Worte', - 'url': 'https://picsum.photos/300/200/?random' + 'url': 'https://picsum.photos/600/400/?random' } }, { @@ -97,7 +97,7 @@ data = [ 'type': 'image_url', 'value': { 'title': 'Ein Bild sagt mehr als 1000 Worte', - 'url': 'https://picsum.photos/300/200/?random' + 'url': 'https://picsum.photos/600/400/?random' } }, { @@ -129,7 +129,7 @@ data = [ 'type': 'image_url', 'value': { 'title': 'Ein Bild sagt mehr als 1000 Worte', - 'url': 'https://picsum.photos/300/200/?random' + 'url': 'https://picsum.photos/600/400/?random' } }, { @@ -155,7 +155,7 @@ data = [ 'type': 'image_url', 'value': { 'title': 'Ein Bild sagt mehr als 1000 Worte', - 'url': 'https://picsum.photos/300/200/?random' + 'url': 'https://picsum.photos/600/400/?random' } }, {