diff --git a/src/page-circle-admin.pug b/src/page-circle-admin.pug index 43ae78d..2731be5 100644 --- a/src/page-circle-admin.pug +++ b/src/page-circle-admin.pug @@ -1,20 +1,28 @@ -h1 Circles +sib-widget(name='circle-admin-leave-button-template') + template + sib-ac-checker( + permission="acl:Delete" + data-src="${await value['@id']}" + ) + sib-delete( + data-src="${await value['@id']}" + data-label='Leave the circle' + ) -sib-widget(name='template-admin-circle') - template - sib-display( - fields='name' - bind-resources - ) - sib-display( - data-src='${await value.owner}' - fields='account.picture, sup(name)' - widget-account.picture='hd-user-avatar' - ) - sib-display( - fields='team' - bind-resources - ) +sib-widget(name='circle-admin-join-button-template') + template + sib-form.circle-admin-join-button( + data-src='${src}' + nested-field='members' + fields='user' + widget-user='sib-form-dropdown' + label-user='' + range-user=`${endpoints.users}` + submit-button='Join' + set-user-id-select="user" + ) + +h1 Circles div //- Search a circle @@ -26,7 +34,11 @@ div.table-header sib-display.table-body( data-src=`${endpoints.circles}` - fields='circles(name, team, owner)' - multiple-circles - widget-circles='template-admin-circle' + fields="name,own(owner.name,owner.account['@id']),members,button" + + widget-members='circle-admin-leave-button-template' + multiple-members + + widget-button='circle-admin-join-button-template' + action-button='button' ) \ No newline at end of file diff --git a/src/styles/base/main.scss b/src/styles/base/main.scss index 4a12793..b4e3ce1 100644 --- a/src/styles/base/main.scss +++ b/src/styles/base/main.scss @@ -260,4 +260,5 @@ sib-delete { // Other base components @import 'form'; @import 'header'; -@import 'menu-left'; \ No newline at end of file +@import 'menu-left'; +@import 'user-avatar'; \ No newline at end of file diff --git a/src/styles/base/user-avatar.scss b/src/styles/base/user-avatar.scss new file mode 100644 index 0000000..0c93093 --- /dev/null +++ b/src/styles/base/user-avatar.scss @@ -0,0 +1,29 @@ +.project-profile-user-avatar { + align-self: center; + grid-column: 1 / span 1; + grid-row: 1 / span 2; + display: inline; + + * { + height: 100%; + width: 100%; + } + + div { + background-color: $color-0-0-100; + border-radius: 50%; + height: 7vh; + overflow: hidden; + position: relative; + width: 7vh; + + img { + height: 100%; + left: 0; + object-fit: cover; + position: absolute; + top: 0; + width: 100%; + } + } +} \ No newline at end of file diff --git a/src/styles/layout/circle/_index.scss b/src/styles/layout/circle/_index.scss index 6efac3d..350cfc1 100644 --- a/src/styles/layout/circle/_index.scss +++ b/src/styles/layout/circle/_index.scss @@ -1,2 +1,3 @@ @import 'circle-profile'; -@import 'circle-edit'; \ No newline at end of file +@import 'circle-edit'; +@import 'circle-admin'; \ No newline at end of file diff --git a/src/styles/layout/circle/circle-admin.scss b/src/styles/layout/circle/circle-admin.scss new file mode 100644 index 0000000..04813c0 --- /dev/null +++ b/src/styles/layout/circle/circle-admin.scss @@ -0,0 +1,3 @@ +.circle-admin-join-button select[name='user'] { + display: none; +} \ No newline at end of file diff --git a/src/styles/layout/circle/circle-edit.scss b/src/styles/layout/circle/circle-edit.scss index 547e399..f5812cf 100644 --- a/src/styles/layout/circle/circle-edit.scss +++ b/src/styles/layout/circle/circle-edit.scss @@ -13,11 +13,22 @@ h2 { justify-content: space-around; text-align: center; - >*{ - border-right: 1px solid $color-228-25-79; + .cell { + border-bottom: none; + border-top: none; flex: 1; padding: 1rem; width: 50%; + + &:not(:last-child) { + border-left: none; + border-right: 1px solid white; + } + + &:not(:last-child) { + border-left: 1px solid white; + border-right: none; + } } >*:last-of-type { diff --git a/src/styles/layout/project-profile/project-profile.scss b/src/styles/layout/project-profile/project-profile.scss index 1a8b0f2..ae54b38 100644 --- a/src/styles/layout/project-profile/project-profile.scss +++ b/src/styles/layout/project-profile/project-profile.scss @@ -169,30 +169,6 @@ display: none; } - sib-display.project-profile-user-avatar { - align-self: center; - grid-column: 1 / span 1; - grid-row: 1 / span 2; - - div { - background-color: $color-0-0-100; - border-radius: 50%; - height: 7vh; - overflow: hidden; - position: relative; - width: 7vh; - - img { - height: 100%; - left: 0; - object-fit: cover; - position: absolute; - top: 0; - width: 100%; - } - } - } - team-template[name='members'], captain-template[name='captain'] { display: grid; grid-column-gap: 1.6rem; @@ -231,13 +207,4 @@ } } } - - .project-profile-user-avatar { - display: inline; - - * { - height: 100%; - width: 100%; - } - } } \ No newline at end of file