update: user avatar on admin

This commit is contained in:
Jean-Baptiste Pasquier 2019-10-29 14:59:57 +01:00
parent a5a63bd162
commit 3c72a4fee0
No known key found for this signature in database
GPG Key ID: F2702E6D22ED4D62
4 changed files with 21 additions and 59 deletions

View File

@ -35,9 +35,6 @@ html(lang="en")
#circle(hidden).with-sidebar #circle(hidden).with-sidebar
include page-circle.pug include page-circle.pug
#circle-admin(hidden).no-sidebar
include page-circle-admin.pug
#messages(hidden).with-sidebar #messages(hidden).with-sidebar
include page-messages.pug include page-messages.pug

View File

@ -8,7 +8,7 @@
#admin-circle-list(hidden) #admin-circle-list(hidden)
sib-widget(name="admin-circle-leave") sib-widget(name="circle-admin-leave-button-template")
template template
sib-ac-checker( sib-ac-checker(
permission="acl:Delete" permission="acl:Delete"
@ -19,37 +19,46 @@
data-label='Leave' data-label='Leave'
) )
sib-widget(name="admin-circle-join") sib-widget(name="circle-admin-join-button-template")
template template
//- BUG: Populate event trigger before the view is fully loaded! - https://git.happy-dev.fr/startinblox/framework/sib-core/issues/521 //- BUG: Populate event trigger before the view is fully loaded! - https://git.happy-dev.fr/startinblox/framework/sib-core/issues/521
sib-form( sib-form.circle-admin-join-button(
data-src="${src}" data-src="${src}"
nested-field='members' nested-field='members'
fields='user' fields='user'
widget-user='sib-form-dropdown'
label-user='' label-user=''
range-user=`${endpoints.users}` range-user=`${endpoints.users}`
widget-user='sib-form-dropdown'
set-user-id-select="user"
submit-button='Join' submit-button='Join'
set-user-id-select="user"
) )
include hd-user-avatar.pug
div.content-box__info div.content-box__info
sib-link(class="right-btn", next="admin-circle-create") Create a new circle sib-link(class="right-btn", next="admin-circle-create") Create a new circle
h3 Circles h3 Circles
sib-display.block(
div.table-header
div.cell Name
div.cell Admins
div.cell Join
sib-display.table-body(
data-src=`${endpoints.circles}` data-src=`${endpoints.circles}`
fields="name, owner.name, buttons(members, button)" fields="name, own(owner.account.picture, owner.name), buttons(members, button)"
search-fields="name" search-fields="name"
search-label-name="Search a Circle" search-label-name="Search a Circle"
multiple-groups="" multiple-groups=""
widget-members="admin-circle-leave" widget-members="circle-admin-leave-button-template"
multiple-members="" multiple-members=""
widget-button="admin-circle-join"
widget-button="circle-admin-join-button-template"
action-button="button" action-button="button"
widget-owner.account.picture='hd-user-avatar'
) )

View File

@ -1,44 +0,0 @@
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='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
div.table-header
div.cell Name
div.cell Admins
div.cell Join
sib-display.table-body(
data-src=`${endpoints.circles}`
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'
)

View File

@ -1,2 +1,2 @@
sib-widget(name='hd-user-avatar') sib-widget(name='hd-user-avatar')
template ${value ? `<img src="${value}" style="max-width:100%; max-height: 100%;" />` : `<object type="image/svg+xml" data="/images/alien.svg"></object>`} template ${await value ? `<img src="${await value}" style="max-width:100%; max-height: 100%;" />` : `<object type="image/svg+xml" data="/images/alien.svg"></object>`}