From 1ae56e77cf3719f0b0d8fcd58df0949888793f04 Mon Sep 17 00:00:00 2001 From: Calum Mackervoy Date: Thu, 9 Jan 2020 09:00:21 +0000 Subject: [PATCH 1/2] Don't display null customer details --- .../layout/project-profile/project-profile.scss | 2 +- src/templates/hd-customer.pug | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/styles/layout/project-profile/project-profile.scss b/src/styles/layout/project-profile/project-profile.scss index b2c594e..2656725 100644 --- a/src/styles/layout/project-profile/project-profile.scss +++ b/src/styles/layout/project-profile/project-profile.scss @@ -150,7 +150,7 @@ li { margin-bottom: 0.5em; - &::before { + span::before { color: $color-43-100-50; font-size: 2.2rem; margin: 0 1rem 0 0; diff --git a/src/templates/hd-customer.pug b/src/templates/hd-customer.pug index df6beba..51563c2 100644 --- a/src/templates/hd-customer.pug +++ b/src/templates/hd-customer.pug @@ -5,15 +5,13 @@ sib-widget(name='hd-customer') h3 Client: ul li #[span Business name: ]${await value.name} - li #[span Company register: ]${await value.companyRegister} - li - span Address: - br - p ${await value.address} + li ${await value.companyRegister ? `Company register: ${await value.companyRegister}` : ``} + li ${await value.address ? `Address:

${await value.address}

`: ``} div h3 Contact: ul - li(class='mdi-account-outline') #[span ${await value.firstName} ${await value.lastName}], ${await value.role} - li(class='mdi-email-outline') - a(href='mailto:${await value.email}') ${await value.email} - li(class='mdi-cellphone-iphone') ${await value.phone} + li #[span(class='mdi-account-outline') ${await value.firstName} ${await value.lastName ? await value.lastName : ""}]${await value.role ? `, ${await value.role}` : ""} + li + span(class='mdi-email-outline') + a(href='mailto:${await value.email}') ${await value.email} + span ${await value.phone ? `
  • ${await value.phone}
  • ` : ``} From c17912b03f31f6e5e7d63c4acc4ca8ad33f44a72 Mon Sep 17 00:00:00 2001 From: Calum Mackervoy Date: Thu, 9 Jan 2020 09:03:48 +0000 Subject: [PATCH 2/2] project team displaying is_admin and avatar correctly --- .../project-profile/project-profile.scss | 1 + src/templates/hd-project-team.pug | 9 +++++-- src/templates/template-team.pug | 25 ------------------- 3 files changed, 8 insertions(+), 27 deletions(-) delete mode 100644 src/templates/template-team.pug diff --git a/src/styles/layout/project-profile/project-profile.scss b/src/styles/layout/project-profile/project-profile.scss index 2656725..8df4271 100644 --- a/src/styles/layout/project-profile/project-profile.scss +++ b/src/styles/layout/project-profile/project-profile.scss @@ -56,6 +56,7 @@ grid-template-columns: 7vh auto; grid-template-rows: repeat(2, 5.2vh); + >[name='user.account.picture'], >[name='account.picture'] { align-items: center; align-self: center; diff --git a/src/templates/hd-project-team.pug b/src/templates/hd-project-team.pug index 639e2ff..c08740a 100644 --- a/src/templates/hd-project-team.pug +++ b/src/templates/hd-project-team.pug @@ -4,17 +4,22 @@ sib-widget(name='hd-project-team') template sib-display( data-src='${await value}' - fields='account.picture, sup(user.name, user.groups), sub(user.profile.city, name)' + fields='user.account.picture, sup(user.name, is_admin, user.groups), sub(user.profile.city, name)' class-user.name='user-name' + class-is_admin='tag-admin' class-user.groups='tag-group' class-user.profile.city='city' - widget-account.picture='hd-user-avatar' + widget-user.account.picture='hd-user-avatar' + widget-is_admin='hd-user-admin' widget-user.groups='hd-user-groups' multiple-user.groups='' ) +sib-widget(name='hd-user-admin') + template ${await value ? "Administrator" : ""} + sib-widget(name='hd-user-groups') template ${await value.name} diff --git a/src/templates/template-team.pug b/src/templates/template-team.pug deleted file mode 100644 index 2ffd17f..0000000 --- a/src/templates/template-team.pug +++ /dev/null @@ -1,25 +0,0 @@ -include hd-user-avatar.pug - -sib-widget(name='project-team-template') - template - sib-display( - data-src='${await value}' - fields='account.picture, sup(user.name, is_admin, user.groups), sub(user.profile.city)' - - class-user.name='user-name' - class-is_admin='tag-admin' - class-user.groups='tag-group' - class-user.profile.city='city' - - widget-account.picture='hd-user-avatar' - widget-is_admin='hd-user-admin' - widget-user.groups='hd-user-groups' - - multiple-user.groups='' - ) - -sib-widget(name='hd-user-admin') - template ${await value ? "Administrator" : ""} - -sib-widget(name='hd-user-groups') - template ${await value.name}