From 9162c1c68a62bdca8e963b4ccd4e7de74875dc0b Mon Sep 17 00:00:00 2001 From: Christophe Henry <contact@c-henry.fr> Date: Thu, 3 Oct 2019 15:27:57 +0200 Subject: [PATCH] Solves #145: add project captains to project page --- src/page-project-profile.pug | 21 ++++++++++++++++--- .../project-profile/project-profile.scss | 8 +++++++ src/templates/template-captain.pug | 19 +++++++++++++++++ src/templates/template-team.pug | 15 +++++++------ 4 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 src/templates/template-captain.pug diff --git a/src/page-project-profile.pug b/src/page-project-profile.pug index c3aa6d36..21770035 100644 --- a/src/page-project-profile.pug +++ b/src/page-project-profile.pug @@ -5,7 +5,7 @@ include templates/template-team.pug sib-display( - fields='block-title(const-title1, number, customer.name, const-title2, name, entitled, creationDate), infos(block-description(label-description, description), block-logo(customer.logo)), block-lead, block-fee(label-fee, businessProvider), block-customer(label-customer, customer), block-team(label-team, members)', + fields='block-title(const-title1, number, customer.name, const-title2, name, entitled, creationDate), infos(block-description(label-description, description), block-logo(customer.logo)), block-lead, block-fee(label-fee, businessProvider), block-customer(label-customer, customer)', value-const-title1='N°', value-const-title2='-', @@ -19,10 +19,25 @@ value-label-customer='CUSTOMER INFORMATIONS:', widget-customer='customer-template', - + + bind-resources + ) + + sib-display( + fields='block-captain(label-captain, captain)', + + value-label-captain='CAPTAIN:', + widget-captain='captain-template', + + bind-resources + ) + + sib-display( + fields='block-team(label-team, members)', + value-label-team='TEAM:', widget-members='team-template', - multiple-members='', + multiple-members, bind-resources ) diff --git a/src/styles/layout/project-profile/project-profile.scss b/src/styles/layout/project-profile/project-profile.scss index 67adc47c..e9af5715 100644 --- a/src/styles/layout/project-profile/project-profile.scss +++ b/src/styles/layout/project-profile/project-profile.scss @@ -237,4 +237,12 @@ } } + .project-profile-user-avatar { + display: inline; + + * { + height: 100%; + width: 100%; + } + } } \ No newline at end of file diff --git a/src/templates/template-captain.pug b/src/templates/template-captain.pug new file mode 100644 index 00000000..e8191904 --- /dev/null +++ b/src/templates/template-captain.pug @@ -0,0 +1,19 @@ +include hd-user-avatar.pug + +sib-widget(name='captain-template') + template + sib-display.project-profile-user-avatar( + data-src="${value ? value['@id'] : ''}" + fields='account.picture', + widget-account.picture='hd-user-avatar' + ) + div(name='user.thumb') + sib-display( + data-src="${value ? value['@id'] : ''}" + fields='username' + ) + sib-display( + data-src="${value ? value['@id'] : ''}", + fields='name' + nested-field="groups" + ) diff --git a/src/templates/template-team.pug b/src/templates/template-team.pug index ac3a2ffc..a875a7d7 100644 --- a/src/templates/template-team.pug +++ b/src/templates/template-team.pug @@ -2,16 +2,19 @@ include hd-user-avatar.pug sib-widget(name='team-template') template - sib-display( - data-src="${value.user['@id']}" + sib-display.project-profile-user-avatar( + data-src="${value.user ? value.user['@id'] : ''}" fields='account.picture', widget-account.picture='hd-user-avatar' ) div(name='user.thumb') - span ${value.user.name} sib-display( - data-src="${value.user.groups['@id']}", - fields='name', - multiple-name + data-src="${value.user ? value.user['@id'] : ''}" + fields='name' + ) + sib-display( + data-src="${value.user ? value.user['@id'] : ''}", + fields='name' + nested-field="groups" ) span ${value.name} -- GitLab