From feb6a878883c495accd6b0978bb681ff81549dfb Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 25 Jun 2020 15:19:42 +0200 Subject: [PATCH] Show recent modules on start page --- .../src/graphql/gql/fragments/userParts.gql | 8 ++ client/src/pages/start.vue | 113 +++++++----------- 2 files changed, 52 insertions(+), 69 deletions(-) diff --git a/client/src/graphql/gql/fragments/userParts.gql b/client/src/graphql/gql/fragments/userParts.gql index 6a57ae18..71d148eb 100644 --- a/client/src/graphql/gql/fragments/userParts.gql +++ b/client/src/graphql/gql/fragments/userParts.gql @@ -1,4 +1,5 @@ #import "./schoolClassParts.gql" +#import "./moduleParts.gql" fragment UserParts on UserNode { id pk @@ -19,6 +20,13 @@ fragment UserParts on UserNode { selectedClass { id } + recentModules(orderBy: "-visited") { + edges { + node { + ...ModuleParts + } + } + } schoolClasses { edges { node { diff --git a/client/src/pages/start.vue b/client/src/pages/start.vue index 47098720..81dc79fe 100644 --- a/client/src/pages/start.vue +++ b/client/src/pages/start.vue @@ -2,37 +2,15 @@
-
- - - - - - - - - - +
+

News

@@ -48,8 +26,6 @@ date="20. Dezember 2019" title="Blockchain" url="https://myskillbox-abu-news.webflow.io/blockchain"/> - -
Mehr...
@@ -58,6 +34,7 @@ import SectionBlock from '@/components/SectionBlock.vue'; import NewsTeaser from '@/components/NewsTeaser.vue'; import HeaderBar from '@/components/HeaderBar'; + import ModuleTeaser from '@/components/modules/ModuleTeaser'; import ContentsIllustration from '@/components/illustrations/ContentsIllustration'; import PortfolioIllustration from '@/components/illustrations/PortfolioIllustration'; @@ -77,7 +54,8 @@ NewsTeaser, ContentsIllustration, PortfolioIllustration, - RoomsIllustration + RoomsIllustration, + ModuleTeaser }, computed: { @@ -140,48 +118,45 @@ -1px 1px 0 $color-brand, 1px 1px 0 $color-brand;*/ } - } - .start-sections { - margin: 0 30px; - @include desktop { - padding-left: 120px; - padding-right: 120px; - } - display: -ms-grid; - -ms-grid-column-align: center; - -ms-grid-columns: 1fr 1fr 1fr; - margin-bottom: 90px; - @supports (display: grid) { - display: grid; - } - @include desktop { - grid-template-columns: 1fr 1fr 1fr; - } + &__modules { + margin: 0 30px; + display: -ms-grid; + -ms-grid-column-align: center; + -ms-grid-columns: 1fr 1fr 1fr; + margin-bottom: 90px; + @supports (display: grid) { + display: grid; + } + @include desktop { + padding-left: 120px; + padding-right: 120px; + grid-template-columns: 1fr 1fr 1fr; + } - grid-row-gap: 15px; - grid-column-gap: 50px; - justify-items: start; + grid-row-gap: 15px; + grid-column-gap: 50px; + justify-items: start; align-items: center; - /* - * For IE10+ - */ - & > :nth-child(1) { - -ms-grid-row: 1; - -ms-grid-column: 1; - } + /* + * For IE10+ + */ + & > :nth-child(1) { + -ms-grid-row: 1; + -ms-grid-column: 1; + } - & > :nth-child(2) { - -ms-grid-row: 1; - -ms-grid-column: 2; - } + & > :nth-child(2) { + -ms-grid-row: 1; + -ms-grid-column: 2; + } - & > :nth-child(3) { - -ms-grid-row: 1; - -ms-grid-column: 3; + & > :nth-child(3) { + -ms-grid-row: 1; + -ms-grid-column: 3; + } } - } .news {