From 92241576b3daf8d91fa65b529012100c3acac010 Mon Sep 17 00:00:00 2001 From: senderfm Date: Thu, 6 Jun 2019 19:34:28 +0200 Subject: [PATCH 01/12] Implement active Tabs --- webapp/pages/profile/_id/_slug.vue | 144 +++++++++++++++++------------ 1 file changed, 85 insertions(+), 59 deletions(-) diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 9a7af82ac..6e75a585f 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -132,69 +132,50 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + ' + str) + this.tabActive = str + }, uniq(items, field = 'id') { return uniqBy(items, field) }, @@ -370,8 +356,48 @@ export default { cursor: pointer; } -.ds-tab-nav .ds-card-content .ds-tab-nav-item:hover { - border-bottom: 3px solid #c9c6ce; +.Tab { + border-collapse: collapse; + padding-bottom: 5px; +} +.Tab:hover { + border-bottom: 2px solid #c9c6ce; +} + +.Tabs { + position: relative; + background-color: #fff; + &:after { + content: ' '; + display: table; + clear: both; + } + margin: 0; + padding: 0; + list-style: none; + &__tab { + float: left; + width: 33.333%; + text-align: center; + &:first-child.active ~ .Tabs__presentation-slider { + left: 0; + } + &:nth-child(2).active ~ .Tabs__presentation-slider { + left: 33.333%; + } + &:nth-child(3).active ~ .Tabs__presentation-slider { + left: calc(33.333% * 2); + } + } + &__presentation-slider { + position: absolute; + bottom: 0; + left: 0; + width: 33.333%; + height: 2px; + background-color: #17b53f; + transition: left 0.25s; + } } .profile-avatar.ds-avatar { From 4278c75d529ce90bdb85a8eb4bc95bd29bfc5622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Thu, 6 Jun 2019 18:20:30 +0200 Subject: [PATCH 02/12] Refactor profile page, separate requests --- webapp/graphql/UserProfile/Post.js | 38 +++++++++++++++++++ .../User.js} | 33 +--------------- webapp/pages/profile/_id/_slug.vue | 38 ++++++++++++------- 3 files changed, 64 insertions(+), 45 deletions(-) create mode 100644 webapp/graphql/UserProfile/Post.js rename webapp/graphql/{UserProfileQuery.js => UserProfile/User.js} (67%) diff --git a/webapp/graphql/UserProfile/Post.js b/webapp/graphql/UserProfile/Post.js new file mode 100644 index 000000000..aa5ae77fd --- /dev/null +++ b/webapp/graphql/UserProfile/Post.js @@ -0,0 +1,38 @@ +import gql from 'graphql-tag' + +export default app => { + const lang = app.$i18n.locale().toUpperCase() + return gql(` + query Post($filter: _PostFilter, $first: Int, $offset: Int) { + Post(filter: $filter, first: $first, offset: $offset, orderBy: createdAt_desc) { + id + slug + title + contentExcerpt + shoutedCount + commentsCount + deleted + image + createdAt + disabled + deleted + categories { + id + name + icon + } + author { + id + slug + avatar + name + disabled + deleted + location { + name: name${lang} + } + } + } + } + `) +} diff --git a/webapp/graphql/UserProfileQuery.js b/webapp/graphql/UserProfile/User.js similarity index 67% rename from webapp/graphql/UserProfileQuery.js rename to webapp/graphql/UserProfile/User.js index 16e7e1440..b30c5e617 100644 --- a/webapp/graphql/UserProfileQuery.js +++ b/webapp/graphql/UserProfile/User.js @@ -3,8 +3,8 @@ import gql from 'graphql-tag' export default app => { const lang = app.$i18n.locale().toUpperCase() return gql(` - query User($slug: String!, $first: Int, $offset: Int) { - User(slug: $slug) { + query User($id: ID!) { + User(id: $id) { id slug name @@ -69,35 +69,6 @@ export default app => { } } contributionsCount - contributions(first: $first, offset: $offset, orderBy: createdAt_desc) { - id - slug - title - contentExcerpt - shoutedCount - commentsCount - deleted - image - createdAt - disabled - deleted - categories { - id - name - icon - } - author { - id - slug - avatar - name - disabled - deleted - location { - name: name${lang} - } - } - } socialMedia { id url diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 6e75a585f..ef5d492f6 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -193,7 +193,7 @@ :key="post.id" :post="post" :width="{ base: '100%', md: '100%', xl: '50%' }" - @deletePost="user.contributions.splice(index, 1)" + @deletePost="Post.splice(index, 1)" />