Merge branch 'circle-admin-role' into 'staging'

Circle admin role

See merge request startinblox/applications/sib-app!89
This commit is contained in:
Jean-Baptiste Pasquier 2019-12-20 15:28:33 +00:00
commit 17d2cd3137
15 changed files with 161 additions and 100 deletions

View File

@ -25,10 +25,10 @@ sib-router(default-route='circle-profile', hidden)
sib-display.block( sib-display.block(
bind-resources bind-resources
fields='team' fields='members'
multiple-team='' multiple-members=''
widget-team='circle-team-template' widget-members='circle-team-template'
) )
div.box-button div.box-button

View File

@ -7,6 +7,7 @@ sib-router(default-route='project-profile', hidden)
include templates/hd-captain.pug include templates/hd-captain.pug
include templates/hd-circle-team.pug include templates/hd-circle-team.pug
include templates/hd-customer.pug include templates/hd-customer.pug
include templates/hd-project-team.pug
.content-box__info .content-box__info
@ -65,10 +66,10 @@ sib-router(default-route='project-profile', hidden)
sib-display( sib-display(
bind-resources bind-resources
fields='team' fields='members'
widget-team='circle-team-template' widget-members='hd-project-team'
multiple-team multiple-members
) )
sib-widget(name='project-leave-button') sib-widget(name='project-leave-button')

View File

@ -4,4 +4,4 @@
@import 'howto'; @import 'howto';
@import 'sidebar'; @import 'sidebar';
@import 'skills'; @import 'skills';
@import 'user-role'; @import 'tags';

View File

@ -0,0 +1,19 @@
%tag-role {
border: 1px solid $color-45-95-54;
border-radius: 3px;
color: $color-210-4-50;
font-size: 1.4rem;
font-weight: 400;
margin-right: 0.6rem;
padding: 0.2rem 0.98rem;
}
%tag-admin {
border: 1px solid $color-244-73-62;
border-radius: 3px;
color: $color-244-73-62;
font-size: 1.4rem;
font-weight: 400;
margin-left: 0.6rem;
padding: 0.3rem 0.98rem;
}

View File

@ -1,9 +0,0 @@
%user-role {
border: 1px solid $color-45-95-54;
border-radius: 3px;
color: $color-210-4-50;
font-size: 1.4rem;
font-weight: 400;
margin-right: 0.4rem;
padding: 0.2rem 0.98rem;
}

View File

@ -133,7 +133,7 @@
display: flex; display: flex;
[name='groups'] { [name='groups'] {
@extend %user-role; @extend %tag-role;
} }
} }
} }

View File

@ -15,15 +15,9 @@
} }
} }
>div { /* peut-être à mettre dans main.scss */ /* peut-être à mettre dans main.scss */
>sib-multiple { circle-team-template>sib-display>div {
label {
display: none;
}
>div>circle-team-template[name='team']>sib-display>div {
display: grid; display: grid;
grid-column-gap: 1.6rem; grid-column-gap: 1.6rem;
grid-template-columns: 7vh auto; grid-template-columns: 7vh auto;
@ -60,24 +54,30 @@
} }
>[name='sup'] { >[name='sup'] {
align-items: center;
align-self: end; align-self: end;
display: flex; display: flex;
grid-column: 2 / span 1; grid-column: 2 / span 1;
grid-row: 1 / span 1; grid-row: 1 / span 1;
margin-bottom: 0.50rem; margin-bottom: 0.50rem;
[name='name'] { .user-name {
font-weight: 600; font-weight: 600;
} }
sib-multiple { .tag-group {
display: flex; display: flex;
margin-left: 1rem; margin-bottom: 1px;
margin-left: 0.6rem;
[name='groups'] { [name='user.groups'] {
@extend %user-role; @extend %tag-role;
} }
} }
.tag-admin:not(:empty) {
@extend %tag-admin;
}
} }
>[name='sub'] { >[name='sub'] {
@ -86,7 +86,7 @@
grid-row: 2 / span 1; grid-row: 2 / span 1;
margin-top: 0.50rem; margin-top: 0.50rem;
>[name$='profile.city']:not(:empty) { >.city:not(:empty) {
@include mdi('atom'); @include mdi('atom');
align-items: center; align-items: center;
display: flex; display: flex;
@ -99,6 +99,4 @@
} }
} }
} }
}
}
} }

View File

@ -135,7 +135,7 @@
display: flex; display: flex;
[name='groups'] { [name='groups'] {
@extend %user-role; @extend %tag-role;
} }
} }
} }

View File

@ -88,7 +88,7 @@ sib-job-board {
} }
>* { >* {
@extend %user-role; @extend %tag-role;
} }
} }

View File

@ -32,7 +32,7 @@
} }
member-info-groups { member-info-groups {
@extend %user-role; @extend %tag-role;
} }
#members-list { #members-list {

View File

@ -50,7 +50,7 @@
} }
hd-captain>sib-display>div, hd-captain>sib-display>div,
circle-team-template>sib-display>div { /* Maybe move it in main.scss. /!\ some fields are different */ hd-project-team>sib-display>div { /* Maybe move it in main.scss. /!\ some fields are different */
display: grid; display: grid;
grid-column-gap: 1.6rem; grid-column-gap: 1.6rem;
grid-template-columns: 7vh auto; grid-template-columns: 7vh auto;
@ -93,7 +93,7 @@
grid-row: 1 / span 1; grid-row: 1 / span 1;
margin-bottom: 0.50rem; margin-bottom: 0.50rem;
[name='name'] { .user-name {
font-weight: 600; font-weight: 600;
} }
@ -101,8 +101,9 @@
display: flex; display: flex;
margin-left: 1rem; margin-left: 1rem;
[name='groups'] { [name='groups'],
@extend %user-role; [name='user.groups'] {
@extend %tag-role;
} }
} }
} }
@ -117,12 +118,28 @@
@include mdi('atom'); @include mdi('atom');
align-items: center; align-items: center;
display: flex; display: flex;
margin-right: 1.6rem;
&::before { &::before {
color: $color-43-100-50; color: $color-43-100-50;
margin-right: 0.50rem; margin-right: 0.50rem;
} }
} }
>[name$='name']:not(:empty),
>[name='is_lead'] {
@include icon('eyeglass');
align-items: center;
display: flex;
&::before {
color: $color-43-100-50;
font-size: 1.9rem;
font-weight: bold;
margin-left: 0;
margin-right: 0.50rem;
}
}
} }
} }

View File

@ -35,7 +35,7 @@
padding-left: 1.4rem; padding-left: 1.4rem;
groups-name { groups-name {
@extend %user-role; @extend %tag-role;
} }
} }
} }

View File

@ -4,8 +4,14 @@ sib-widget(name='hd-captain')
template template
sib-display( sib-display(
data-src="${await value}" data-src="${await value}"
fields='account.picture, sup(name), sub(profile.city)' fields='account.picture, sup(name), sub(profile.city, is_lead)'
class-name='user-name'
class-profile.city='city'
widget-account.picture='hd-user-avatar' widget-account.picture='hd-user-avatar'
widget-is_lead='hd-user-lead'
) )
sib-widget(name='hd-user-lead')
template Project lead

View File

@ -3,14 +3,23 @@ include hd-user-avatar.pug
sib-widget(name='circle-team-template') sib-widget(name='circle-team-template')
template template
sib-display( sib-display(
data-src="${await value}" data-src='${await value}'
fields='account.picture, sup(name, groups), sub(profile.city)' 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-account.picture='hd-user-avatar'
widget-groups='hd-user-groups' widget-is_admin='hd-user-admin'
widget-user.groups='hd-user-groups'
multiple-groups='' multiple-user.groups=''
) )
sib-widget(name='hd-user-admin')
template ${await value ? "Administrator" : ""}
sib-widget(name='hd-user-groups') sib-widget(name='hd-user-groups')
template ${await value.name} template ${await value.name}

View File

@ -0,0 +1,20 @@
include hd-user-avatar.pug
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)'
class-user.name='user-name'
class-user.groups='tag-group'
class-user.profile.city='city'
widget-account.picture='hd-user-avatar'
widget-user.groups='hd-user-groups'
multiple-user.groups=''
)
sib-widget(name='hd-user-groups')
template ${await value.name}