diff --git a/config.sample.federated.json b/config.sample.federated.json index 57aa616..eb316c9 100644 --- a/config.sample.federated.json +++ b/config.sample.federated.json @@ -15,6 +15,7 @@ "events": "http://localhost:8000/events/", "typeevents": "http://localhost:8000/typeevents/", "users": "http://localhost:8000/users/", + "groups": "http://localhost:8000/groups/", "uploads": "http://localhost:8000/upload/" }, "post": { @@ -24,6 +25,7 @@ "events": "http://localhost:8000/events/", "typeevents": "http://localhost:8000/typeevents/", "users": "http://localhost:8000/users/", + "groups": "http://localhost:8000/groups/", "uploads": "http://localhost:8000/upload/" } }, diff --git a/config.sample.json b/config.sample.json index 1741c1c..753554f 100644 --- a/config.sample.json +++ b/config.sample.json @@ -12,6 +12,7 @@ "projects": "http://localhost:8000/projects/", "customers": "http://localhost:8000/customers/", "events": "http://localhost:8000/events/", + "groups": "http://localhost:8000/groups/", "typeevents": "http://localhost:8000/typeevents/", "users": "http://localhost:8000/users/", "uploads": "http://localhost:8000/upload/" diff --git a/src/page-admin.pug b/src/page-admin.pug index 4876a37..0dea326 100644 --- a/src/page-admin.pug +++ b/src/page-admin.pug @@ -5,7 +5,7 @@ if endpoints.projects || (endpoints.get && endpoints.get.projects) #admin-projects(hidden) include views/admin/page-admin-projects.pug - if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) + if (endpoints.users || (endpoints.get && endpoints.get.users)) #admin-users(hidden) include views/admin/page-admin-users.pug nav.jsRightMenu(role='navigation') @@ -13,7 +13,7 @@ nav.jsRightMenu(role='navigation') ul li.jsOffsiteToggle a Fold menu - if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) + if (endpoints.users || (endpoints.get && endpoints.get.users)) sib-route(name='admin-users') li a Users diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss index 6fc03d4..a36eacb 100644 --- a/src/styles/base/form.scss +++ b/src/styles/base/form.scss @@ -1,5 +1,7 @@ #admin-circle-create, -#admin-project-create { +#admin-project-create, +#admin-users-create, +#admin-users-edit { input[type='submit'] { @extend .button, @@ -42,12 +44,17 @@ margin-bottom: 2.75rem; } + [name$='border-top'] { + border-top: 1px solid $color-221-51-90; + margin-top: 3rem; + } + form { display: flex; flex-direction: column; } - sib-set-default { + sib-set-default:not([name='user-thumb']) { clear: both; display: flex!important; flex-wrap: wrap; @@ -314,6 +321,14 @@ sib-multiple-select { + &.select-groups .ss-values .ss-disabled::before { + content: "Select groups"; + } + + &.select-skills .ss-values .ss-disabled::before { + content: "Select skills"; + } + sib-form-auto-completion > label { display: flex; flex-direction: column; @@ -363,7 +378,6 @@ &::before { color: $color-213-4-50; - content: "Select skills"; font-weight: normal; } } diff --git a/src/styles/base/main.scss b/src/styles/base/main.scss index 5c06575..0dd0cb7 100644 --- a/src/styles/base/main.scss +++ b/src/styles/base/main.scss @@ -82,7 +82,8 @@ nav { /* Quick fix. Will be removed later */ #admin-circles, -#admin-projects { +#admin-projects, +#admin-users { display: contents; } @@ -384,7 +385,8 @@ a, &.rounded { border-radius: 50%; - padding: 0.5rem 1rem; + font-size: 1.8rem; + padding: 1rem; } &.button-link { diff --git a/src/styles/base/table.scss b/src/styles/base/table.scss index cb5e2a7..dc4931d 100644 --- a/src/styles/base/table.scss +++ b/src/styles/base/table.scss @@ -4,7 +4,8 @@ #admin-circle-create, #project-edit, #admin-project-list, -#admin-project-create { +#admin-project-create, +#admin-users-list { .table { @@ -68,13 +69,39 @@ } } + .cell-with-buttons { + align-items: center; + display: flex; + justify-content: center; + + [name='button'] { + + input[type='submit'] { + @extend .button, + .text-bold, + .text-uppercase, + .reversed, + .button-blue, + .bordered, + .btn-margin-left; + } + } + } + + .cell-with-groups { + align-items: center; + display: flex; + justify-content: center; + } + .cell-with-name { color: $color-233-18-29; font-weight: 600; padding-top: 2.5rem; } - .user-thumb>div /* for the table in circle-edit and captain's cell in project-admin */ { + .user-thumb>div /* for the table in circle-edit and captain's cell in project-admin */, + [name='user-thumb'] { @extend %user-thumb__grid; padding: 0 2.2rem; @@ -107,22 +134,15 @@ } } - .cell-with-buttons { + .cell-with-groups { align-items: center; display: flex; justify-content: center; - [name='button'] { - - input[type='submit'] { - @extend .button, - .text-bold, - .text-uppercase, - .reversed, - .button-blue, - .bordered, - .btn-margin-left; - } + >div { + display: flex; + justify-content: space-evenly; + width: 100%; } } diff --git a/src/styles/components/sidebar.scss b/src/styles/components/sidebar.scss index 8b90344..49bdc9c 100644 --- a/src/styles/components/sidebar.scss +++ b/src/styles/components/sidebar.scss @@ -82,6 +82,13 @@ } } + &[name*='users'] { + + >li::before { + font-size: 5rem; + } + } + &[name$='chat']>li { @include ci('chat'); } @@ -102,6 +109,10 @@ @include ci('file'); } + &[name='admin-users']>li { + @include ci('drawing'); + } + &[name='admin-circles']>li { @include ci('bubble-add'); } diff --git a/src/styles/layout/user/_index.scss b/src/styles/layout/user/_index.scss index 1174ebd..f15713e 100644 --- a/src/styles/layout/user/_index.scss +++ b/src/styles/layout/user/_index.scss @@ -1 +1,2 @@ -@import 'user-profile'; \ No newline at end of file +@import 'user-profile'; +@import 'admin-users'; diff --git a/src/styles/layout/user/admin-users.scss b/src/styles/layout/user/admin-users.scss new file mode 100644 index 0000000..61f0e46 --- /dev/null +++ b/src/styles/layout/user/admin-users.scss @@ -0,0 +1,6 @@ +/* Fix. Could disappear when we can add .class on set fields */ +sib-set-default[name='cell-1'] { + @extend .w33; + @extend .cell; + @extend .border; +} \ No newline at end of file diff --git a/src/views/admin/page-admin-circles-create.pug b/src/views/admin/page-admin-circles-create.pug index 607bb7d..f45bf6d 100644 --- a/src/views/admin/page-admin-circles-create.pug +++ b/src/views/admin/page-admin-circles-create.pug @@ -8,6 +8,9 @@ div.content-box__info fields='name, description' + label-name='Name *' + label-description='Description *' + class-name='form-label is-light is-full-width' class-description='form-label is-light is-full-width' diff --git a/src/views/admin/page-admin-users-create.pug b/src/views/admin/page-admin-users-create.pug new file mode 100644 index 0000000..635bd77 --- /dev/null +++ b/src/views/admin/page-admin-users-create.pug @@ -0,0 +1,35 @@ +div.content-box__info + sib-link(class='backlink right', next='admin-users-list') Back + + h1.centered Add a new user to the platform + + sib-form( + data-src=`${endpoints.users || endpoints.post.users}` + range-groups=`${endpoints.groups || endpoints.get.groups}` + + fields='line-1(first_name, last_name), line-2(username, email), line-3(password), line-4-border-top(groups)' + + class-first_name='form-label is-light is-half-width' + class-last_name='form-label is-light is-half-width' + class-username='form-label is-light is-half-width' + class-email='form-label is-light is-half-width' + class-groups='form-label is-light is-half-width select-groups' + + label-first_name='First Name *' + label-last_name='Last Name *' + label-username='Username *' + label-email='Email *' + label-groups='Groups' + + multiple-groups='sib-multiple-select' + widget-groups='sib-form-auto-completion' + + value-password='' + widget-password='sib-form-hidden' + + next='admin-user-list' + + submit-button='Create' + ) + + p Administrators of your platform can create new Groups on the Django Administration. diff --git a/src/views/admin/page-admin-users-edit.pug b/src/views/admin/page-admin-users-edit.pug new file mode 100644 index 0000000..4e2a8cb --- /dev/null +++ b/src/views/admin/page-admin-users-edit.pug @@ -0,0 +1,35 @@ +div.content-box__info + sib-link(class='backlink right', next='admin-users-list') Back + + h1.centered + span Edit user + sib-display( + bind-resources='' + fields='name' + ) + + sib-form( + bind-resources='' + range-groups=`${endpoints.groups || endpoints.get.groups}` + + fields='line-1(first_name, last_name), line-2(username, email), line-4-border-top(groups)' + + class-first_name='form-label is-light is-half-width' + class-last_name='form-label is-light is-half-width' + class-username='form-label is-light is-half-width' + class-email='form-label is-light is-half-width' + class-groups='form-label is-light is-half-width select-groups' + + label-first_name='First Name *' + label-last_name='Last Name *' + label-username='Username *' + label-email='Email *' + label-groups='Groups' + + multiple-groups='sib-multiple-select' + widget-groups='sib-form-auto-completion' + + next='admin-user-list' + + submit-button='Save user' + ) diff --git a/src/views/admin/page-admin-users.pug b/src/views/admin/page-admin-users.pug index b916ba1..1617d38 100644 --- a/src/views/admin/page-admin-users.pug +++ b/src/views/admin/page-admin-users.pug @@ -2,17 +2,70 @@ sib-router(default-route='admin-users-list', hidden) sib-route(name='admin-users-list') sib-route(name='admin-users-create') + sib-route(name='admin-users-edit') div.content-box__header - h2 Administration + h1.without-margin Administration + + sib-widget(name='sib-action-hd-custom') + template + sib-ac-checker(data-src="${src}", permission='acl:Write') + sib-link( + class='button rounded reversed button-blue bordered icon-pencil' + data-src="${src}" + next="${value}" + ) - #admin-users-list(hidden) - div.content-box__info + sib-widget(name='hd-user-admin-groups-display') + template sib-display( - data-src=`${endpoints.users || endpoints.get.users}` - fields="account.picture, name, username, email, groups" - multiple-groups="" + data-src="${value}" + fields="name" ) + #admin-users-list(hidden) + div.content-box__info + div.admin-header + div.admin-header__title Users + sib-ac-checker(data-src=`${endpoints.users || endpoints.post.users}`, permission='acl:Append') + sib-link( + class='button text-bold text-uppercase reversed button-yellow bordered with-icon icon-plus' + next='admin-users-create' + ) Create a new user + + .table + div.table-header.grey-color + div Name + div Groups + div + + sib-display( + class='table-body' + data-src=`${endpoints.users || endpoints.get.users}` + fields='cell-1(user-thumb(account.picture, sup(name), sub(username))), groups, actions' + + class-account.picture='user-thumb__picture' + class-name='user-thumb__name' + class-username='user-thumb__username' + class-profile.city='user-thumb__city' + widget-account.picture='hd-user-avatar' + + class-groups='w33 cell border cell-with-groups' + multiple-groups='' + widget-groups='hd-user-admin-groups-display' + + label-actions='Edit' + action-actions='admin-users-edit' + class-actions='w33 cell border cell-with-buttons' + widget-actions='sib-action-hd-custom' + + order-by='username' + ) + + #admin-users-create(hidden) + include page-admin-users-create.pug + + #admin-users-edit(hidden) + include page-admin-users-edit.pug diff --git a/src/views/job-offer/page-job-offer-create.pug b/src/views/job-offer/page-job-offer-create.pug index 3164807..bc9c1d6 100644 --- a/src/views/job-offer/page-job-offer-create.pug +++ b/src/views/job-offer/page-job-offer-create.pug @@ -14,7 +14,7 @@ label-description='Description*' widget-description='sib-form-textarea' - class-skills='form-label is-dark' + class-skills='form-label is-dark select-skills' label-skills='The required skills for this mission:*' multiple-skills='sib-multiple-select' widget-skills='sib-form-auto-completion' diff --git a/src/views/job-offer/page-job-offer-edit.pug b/src/views/job-offer/page-job-offer-edit.pug index 95e57b8..7fde4ff 100644 --- a/src/views/job-offer/page-job-offer-edit.pug +++ b/src/views/job-offer/page-job-offer-edit.pug @@ -14,7 +14,7 @@ label-description='Description*' widget-description='sib-form-textarea' - class-skills='form-label is-dark' + class-skills='form-label is-dark select-skills' label-skills='The required skills for this mission:*' multiple-skills='sib-multiple-select' widget-skills='sib-form-auto-completion'