update: add administration & circle creation

This commit is contained in:
Jean-Baptiste Pasquier 2019-10-25 19:15:45 +02:00
parent 1c2789812e
commit 09f35bd3c0
No known key found for this signature in database
GPG Key ID: F2702E6D22ED4D62
11 changed files with 285 additions and 185 deletions

View File

@ -38,5 +38,8 @@ html(lang="en")
#messages(hidden).with-sidebar
include page-messages.pug
#admin(hidden).with-sidebar
include page-admin.pug
//- #my-profile(hidden).no-sidebar
//- include page-user-profile.pug

View File

@ -15,8 +15,8 @@ nav#main__menu
//- sib-route.menu(name='job-offers', rdf-type='hd:joboffer')
//- div.menu-label Job offers
//- div.menu-icon.icon-briefcase
//- sib-route(hidden, name='job-offer-create')
//- sib-route(hidden, name='job-offer-edit', use-id)
//- sib-route(name='job-offer-create')
//- sib-route(name='job-offer-edit', use-id)
//- div.divider
//- div.menu-wrapper
//- div.menu
@ -24,7 +24,7 @@ nav#main__menu
//- div.menu-icon.icon-arrow-up
//- div.menu-label Projects
//- div.menu-icon.icon-folder-alt
//- sib-route(hidden,name='project', id-prefix=`${endpoints.projects}`, rdf-type='hd:project', use-id='')
//- sib-route(name='project', rdf-type='hd:project', use-id='')
//- div.sub-menu.menu-notification
//- sib-display(
//- data-src=`${endpoints.projects}`
@ -46,7 +46,7 @@ nav#main__menu
div.menu-icon.icon-arrow-up
div.menu-label Circles
div.menu-icon.icon-folder-alt
sib-route(hidden,name='circle', id-prefix=`${endpoints.circles}`, rdf-type='hd:circle', use-id='')
sib-route(name='circle', rdf-type='hd:circle', use-id='')
div.sub-menu.menu-notification
sib-display(
data-src=`${endpoints.circles}`
@ -70,7 +70,7 @@ nav#main__menu
div.menu-icon.icon-arrow-up
div.menu-label Chat
div.menu-icon.icon-envelope-letter
sib-route(hidden, name='messages', id-prefix=`${endpoints.users}`, rdf-type='foaf:user', use-id='')
sib-route(name='messages', rdf-type='foaf:user', use-id='')
div.sub-menu.menu-notification
sib-display(
data-src=`${endpoints.users}`
@ -82,6 +82,7 @@ nav#main__menu
next='messages'
)
sib-route(name='admin')
//- div.divider
//- sib-route.menu(hidden, name='my-profile', rdf-type='foaf:user', use-id='')

View File

@ -0,0 +1,19 @@
div.content-box__info
sib-link(class="backlink", next='admin-circle-list') Back
h1 New circle
p.center Here you can create a new circle according to your interests, what you want to share, etc.
sib-form.block(
data-src=`${endpoints.circles}`
fields='name, description'
class-name='form-label is-light is-full-width'
class-description='form-label is-light is-full-width'
widget-description='sib-form-textarea'
submit-button='Save'
)

View File

@ -0,0 +1,56 @@
.content-box.full-width.with-form
sib-router(default-route='admin-circle-list')
sib-route(name='admin-circle-list')
sib-route(name='admin-circle-create')
div.content-box__header
h2 Administration
#admin-circle-list(hidden)
sib-widget(name="admin-circle-leave")
template
sib-ac-checker(
permission="acl:Delete"
data-src="${value['@id']}"
)
sib-delete(
data-src="${value['@id']}"
data-label='Leave'
)
sib-widget(name="admin-circle-join")
template
sib-form(
data-src="${src}"
nested-field='members'
fields='user'
label-user=''
range-user=`${endpoints.users}`
widget-user='sib-form-dropdown'
set-user-id-select="user"
submit-button='Join'
)
div.content-box__info
sib-link(class="right-btn", next="admin-circle-create") Create a new circle
h3 Circles
sib-display.block(
data-src=`${endpoints.circles}`
fields="name, owner.name, buttons(members, button)"
search-fields="name"
search-label-name="Search a Circle"
multiple-groups=""
widget-members="admin-circle-leave"
multiple-members=""
widget-button="admin-circle-join"
action-button="button"
)
#admin-circle-create(hidden)
include page-admin-circles-create.pug

View File

@ -0,0 +1,10 @@
.content-box.full-width.with-form
sib-router(default-route='admin-project-list')
sib-route(name='admin-project-list')
sib-route(name='admin-project-create')
#admin-project-list(hidden)
#admin-project-create(hidden)

18
src/page-admin-users.pug Normal file
View File

@ -0,0 +1,18 @@
.content-box.full-width.with-form
sib-router(default-route='admin-users-list')
sib-route(name='admin-users-list')
sib-route(name='admin-users-create')
div.content-box__header
h2 Administration
#admin-users-list(hidden)
div.content-box__info
sib-display.block(
data-src=`${endpoints.users}`
fields="account.picture, name, username, email, groups"
multiple-groups=""
)
#admin-users-create(hidden)

21
src/page-admin.pug Normal file
View File

@ -0,0 +1,21 @@
.views-container
#admin-circles(hidden)
include page-admin-circles.pug
//- #admin-users(hidden)
//- include page-admin-users.pug
//- #admin-projects(hidden)
//- include page-admin-projects.pug
nav.jsRightMenu(role='navigation')
sib-router(default-route='admin-circles')
ul
li.jsOffsiteToggle
a Fold menu
//- sib-route(name='admin-users')
li
a Users
sib-route(name='admin-circles')
li
a Circles
//- sib-route(name='admin-projects')
li
a Projects

View File

@ -1,26 +0,0 @@
.content-box.with-padding.with-form.full-width
h1 New group
p Here you can create a new group according to your interests, what you want to share, etc.
sib-form(
data-src=`${endpoints.circles}`,
range-owner=`${endpoints.users}`,
range-team=`${endpoints.users}`
fields='name, description, description-text, owner, owner-text, team, team-text, jabberRoom, foaf:jabberID',
label-name="Channel's name",
label-description='Description',
label-owner='Owner of this channel',
label-foaf:jabberID='Chatroom id',
label-team='Member(s) of this channel',
value-description-text='You can write a short description like "Here, we are like Pinky and the Brain, we talk about strategy to conquer the world".',
value-owner-text='The one who will admin this channel',
value-team-text='Add any members as you want.',
widget-description='sib-form-textarea',
widget-jabberRoom='sib-form-checkbox',
)
//- widget-team='sib-form-multiple-dropdown'

View File

@ -4,6 +4,6 @@ nav(role="user's functionalities menu")
//- sib-link(next='my-profile') My profile
//-li
sib-link(next='user-settings') Settings
//-li
sib-link(name='user-admin') Admin
li
sib-link(next='admin') Admin
button(role='log out' onclick="document.querySelector('sib-auth').logout();") Log out

View File

@ -46,9 +46,9 @@ document.addEventListener('DOMContentLoaded', function (event) {
for(sibForm of document.querySelectorAll('[set-user-id-select]')) {
sibForm.addEventListener('populate', () => {
document.querySelector('sib-form[submit-button="Join Circle"]').style.display = 'none';
if(document.querySelectorAll('sib-ac-checker:not([hidden]) > sib-delete[data-label="Leave circle"]').length == 0) {
document.querySelector('sib-form[submit-button="Join Circle"]').style.display = 'inline-block';
document.querySelectorAll('sib-form[submit-button^="Join"]').forEach(el=>el.style.display = 'none');
if(document.querySelectorAll('sib-ac-checker:not([hidden]) > sib-delete[data-label="^Leave"]').length == 0) {
document.querySelectorAll('sib-form[submit-button^="Join"]').forEach(el=>el.style.display = 'inline-block');
}
// BUG: Populate event trigger before the view is fully loaded! - https://git.happy-dev.fr/startinblox/framework/sib-core/issues/521
for(select of sibForm.querySelectorAll('select[name="'+sibForm.getAttribute('set-user-id-select')+'"]')) {
@ -58,6 +58,9 @@ document.addEventListener('DOMContentLoaded', function (event) {
}
});
}
for(leaveBtn of document.querySelectorAll('admin-circle-leave > sib-ac-checker:not([hidden])')) {
leaveBtn.parentNode.parentNode.parentNode.nextElementSibling.style.display = "none"; // Hide Join button
}
}
}).catch(error => console.log(error));

View File

@ -1,6 +1,5 @@
#circle-edit {
.table-header {
.table-header {
background: $color-228-25-79;
color: white;
display: flex;
@ -23,9 +22,9 @@
display: none;
}
}
}
}
.table-body div team-template-edit {
.table-body div team-template-edit {
display: flex;
justify-content: space-between;
@ -120,27 +119,21 @@
width: 100%;
}
<<<<<<< HEAD:src/styles/layout/circle-profile/circle-edit.scss
object {
height: 45%;
width: 45%;
}
=======
[name='name'] {
font-weight: 600;
margin-right: 1rem;
>>>>>>> 81d885730dd7673ee424a72b6f0c663c7c1cc5b7:src/styles/layout/circle/circle-edit.scss
}
>[name='sup'] {
align-self: end;
display: flex;
<<<<<<< HEAD:src/styles/layout/circle-profile/circle-edit.scss
grid-column: 2 / span 1;
grid-row: 1 / span 1;
margin-bottom: 0.50rem;
=======
>>>>>>> 81d885730dd7673ee424a72b6f0c663c7c1cc5b7:src/styles/layout/circle/circle-edit.scss
[name='name'] {
font-weight: 600;
@ -175,4 +168,6 @@
}
}
}
}
}
}