diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug new file mode 100644 index 0000000000000000000000000000000000000000..78a7557ef2eee73d76f26dd8af05a673d6f01b98 --- /dev/null +++ b/src/includes/components/widgets.pug @@ -0,0 +1,20 @@ +sib-widget(name='cs-section_header') + template + h2 ${label} + +sib-widget(name='cs-form-password') + template + label + div ${label} + input( + type='password' + value="${value}" + name="${name}" + ) + +sib-widget(name='cs-section_introduction') + template + div + h2 ${label} + p Informations will appear on your profile to inform entrepreneurs about your skills and activities. We will also use those information to address specific resources for validation. + \ No newline at end of file diff --git a/src/includes/request/create.pug b/src/includes/entrepreneur/components/header.pug similarity index 100% rename from src/includes/request/create.pug rename to src/includes/entrepreneur/components/header.pug diff --git a/src/includes/entrepreneur/dashboard.pug b/src/includes/entrepreneur/dashboard.pug index 9889cac62ca09ef9984d83adcf1cf49c76ed25c0..4bf507f122982b2b1eb4df1e0cf89971d5fd38c8 100644 --- a/src/includes/entrepreneur/dashboard.pug +++ b/src/includes/entrepreneur/dashboard.pug @@ -1,14 +1,10 @@ -// Mentor dashboard, containing -// 3 tabs: -// - History of my validated resources -// - Resources validation request -// - +// Dashboard for entrepreneur, containing the search engine // Access to all resources // Capabilities to request a resource // Like and comment header#header(role='banner') - include ../templates/header.pug + include components/header.pug section#home h1 Mentorship program @@ -18,17 +14,9 @@ section#home //TODO: //-Distinguish the search form from the listing //-Create two Sib-displays getting the resources by "types" + // and grouped by steps // From two different endpoints I guess - //-Testing the group-by right after the 0.8 version release //-Work on the page architecture - #list(hidden) - include resource/list.pug - - #create(hidden).no-sidebar - sib-link(class="backlink", next="list") Back to the list - include resource/create.pug - - #edit(hidden).no-sidebar - sib-link(class="backlink", next="list") Back to the list - include resource/edit.pug \ No newline at end of file + #entrepreneur-resource-list(hidden) + include resources/list.pug \ No newline at end of file diff --git a/src/includes/entrepreneur/login.pug b/src/includes/entrepreneur/login.pug index 70bb0b04af6f8efcc252b07fc8d48d53a4d27ce5..1323da754b0402569ece635b021eb608cf49f4e2 100644 --- a/src/includes/entrepreneur/login.pug +++ b/src/includes/entrepreneur/login.pug @@ -2,14 +2,5 @@ h2 I am an entrepreneur button(role='log in' onclick="document.querySelector('sib-auth').login();") Login as entrepreneur -//- form(method='POST' action='/login') -//- div.form-group -//- label(for='email') Email -//- input.form-control(type='text' id='email' placeholder='email' name='email') -//- div.form-group -//- label(for='password') Password -//- input.form-control(type='password' id='password' placeholder='password' name='password') -//- button.btn.btn-primary(type='submit') Log in - sib-link(next='entrepreneur-new-account') div Create an account \ No newline at end of file diff --git a/src/includes/resource/detail.pug b/src/includes/entrepreneur/requests/create.pug similarity index 100% rename from src/includes/resource/detail.pug rename to src/includes/entrepreneur/requests/create.pug diff --git a/src/includes/resource/validate.pug b/src/includes/entrepreneur/resources/detail.pug similarity index 100% rename from src/includes/resource/validate.pug rename to src/includes/entrepreneur/resources/detail.pug diff --git a/src/includes/resource/list.pug b/src/includes/entrepreneur/resources/list.pug similarity index 76% rename from src/includes/resource/list.pug rename to src/includes/entrepreneur/resources/list.pug index 8cfc6c603eaece50484d473ce1b31d649fc26730..2e805089a8b5dbd5e7ba4b4906157ea94c508add 100644 --- a/src/includes/resource/list.pug +++ b/src/includes/entrepreneur/resources/list.pug @@ -7,11 +7,6 @@ p: a Watch a video presentation h2 Search for a resource -div.resources__newresource - sib-link(next='create').plus-button - div.icon-plus - div Post a new Resource - #circles sib-display#circles-list( data-src=`${sdn}/resources/`, @@ -23,6 +18,6 @@ div.resources__newresource widget-steps='resource-format-name', multiple-steps, - next='edit' - ) - //- group-by='step' \ No newline at end of file + group-by='steps' + next='detail' + ) \ No newline at end of file diff --git a/src/includes/templates/header.pug b/src/includes/mentor/components/header.pug similarity index 53% rename from src/includes/templates/header.pug rename to src/includes/mentor/components/header.pug index 7d250afe9ebacfaa03a26bb03d298cbe8e9a0b91..c9f0553b643681bcd5166412589f8139b44b633a 100644 --- a/src/includes/templates/header.pug +++ b/src/includes/mentor/components/header.pug @@ -4,7 +4,8 @@ sib-widget(name='account-user-avatar') sib-widget(name='account-user-name') template - p Hello ${value} :-) + div + p Hello ${value} :-) .container .d-flex.justify-content-between @@ -13,23 +14,9 @@ sib-widget(name='account-user-name') sib-display#user-controls__profile( fields='first_name, account.picture', - widget-first_name='account-user-name', + widget-user.first_name='account-user-name', widget-account.picture='account-user-avatar', bind-user ) - button(role='log in' onclick="document.querySelector('sib-auth').login();") Login - - button(role='log out' onclick="document.querySelector('sib-auth').logout();") Logout - -sib-auth - sib-auth-provider( - class="sib-auth-provider" - data-authority=`${sdn}` - data-client_id=`${client_id}`, - data-id="coopstarter" - data-response_type='id_token token', - data-scope='openid profile email', - data-automaticSilentRenew='true', - data-loadUserInfo='true' - ) \ No newline at end of file + button(role='log out' onclick="document.querySelector('sib-auth').logout();") Logout \ No newline at end of file diff --git a/src/includes/mentor/components/menu.pug b/src/includes/mentor/components/menu.pug new file mode 100644 index 0000000000000000000000000000000000000000..a27d8ace9a6024821cbbe1121b9072213bb44cc2 --- /dev/null +++ b/src/includes/mentor/components/menu.pug @@ -0,0 +1,12 @@ +sib-router(default-route='mentor-resource-list') + sib-route(name='mentor-resource-list') + div.menu-label My Resources + div.menu-icon.icon-people + div.divider + sib-ac-checker(permission="acl:Write") + sib-route(name='mentor-resource-create') + div.menu-label Create a resource + div.menu-icon.icon-people + div.divider + sib-ac-checker(permission="acl:Write" bind-resources) + sib-route(id-prefix=`${endpoints.resources}`, name='mentor-resource-edit', use-id) \ No newline at end of file diff --git a/src/includes/mentor/create.pug b/src/includes/mentor/create.pug index 568c71883cbcfba77f7a6381b7ca77c8f83dfebb..3acffdd67cbcf698c9df27074585170a752b38e3 100644 --- a/src/includes/mentor/create.pug +++ b/src/includes/mentor/create.pug @@ -1,23 +1,5 @@ -sib-widget(name='cs-section_header') - template - h2 ${label} +include ../components/widgets -sib-widget(name='cs-form-password') - template - label - div ${label} - input( - type='password' - value="${value}" - name="${name}" - ) - -sib-widget(name='cs-section_introduction') - template - div - h2 ${label} - p Informations will appear on your profile to inform entrepreneurs about your skills and activities. We will also use those information to address specific resources for validation. - sib-form( data-src=`${endpoints.mentors}` fields="account_information(header_account, user.username, user.last_name, user.first_name, organisation,\ diff --git a/src/includes/mentor/dashboard.pug b/src/includes/mentor/dashboard.pug index 82438c418ece36127a31b62412cb2d0b71d3ed1a..ca4d4ce148cebd0cca356d4ed72d2df081961bbd 100644 --- a/src/includes/mentor/dashboard.pug +++ b/src/includes/mentor/dashboard.pug @@ -1,7 +1,29 @@ -// Dashboard for entrepreneur, containing the search engine +// Mentor dashboard, containing +// 3 tabs: +// - History of my validated resources +// - Resources validation request +// - // Access to all resources // Capabilities to request a resource // Like and comment header#header(role='banner') - include ../templates/header.pug + include ./components/header.pug + +section#home + h1 Mentorship program + + #mentor-resource-list(hidden).no-sidebar + include resources/list.pug + + #mentor-resource-create(hidden).no-sidebar + sib-link(class="backlink", next="mentor-resource-list") Back to the resources list + include resources/create.pug + + #mentor-resource-edit(hidden).no-sidebar + sib-link(class="backlink", next="mentor-resource-list") Back to the resources list + include resources/edit.pug + + #mentor-resource-validate(hidden).no-sidebar + sib-link(class="backlink", next="mentor-resource-list") Back to the resources list + include resources/validate.pug \ No newline at end of file diff --git a/src/includes/mentor/requests/list.pug b/src/includes/mentor/requests/list.pug new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/includes/mentor/resources/create.pug b/src/includes/mentor/resources/create.pug new file mode 100644 index 0000000000000000000000000000000000000000..0e584f41aeacaf3e83da9c06072ec9026a3661e5 --- /dev/null +++ b/src/includes/mentor/resources/create.pug @@ -0,0 +1,80 @@ +include ../../components/widgets + +h2 Post a resource + +p Thank you for enriching our database ! + +sib-form( + data-src=`${endpoints.resources}` + fields="mandatory_information(header_mandatory, name, country, language, uri,\ + format, field, author, publication_year, skills),\ + complementary_information(header_complementary, description, iframe_link,\ + preview_image, tags),classification(header_classification, target, type, steps),\ + access(header_access, sharing),related_section(header_related, related)" + + widget-header_mandatory='cs-section_header' + widget-header_complementary='cs-section_header' + widget-header_classification='cs-section_header' + widget-header_access='cs-section_header' + widget-header_related='cs-section_header' + + range-type=`${endpoints.types}` + range-format=`${endpoints.formats}` + range-steps=`${endpoints.steps}` + range-language=`${endpoints.languages}` + range-field=`${endpoints.fields}` + range-related=`${endpoints.resources}` + + label-header_mandatory='Mandatory information' + label-header_complementary='Complementary information' + label-header_classification='Classification' + label-header_access='Access' + label-header_related='Related resources' + + label-name='Title*' + label-country='Country*' + label-language='Language*' + label-uri='Location/weblink*' + label-format='Format*' + label-field='Field*' + label-author='Resource author*' + label-publication_year='Year of publication*' + label-skills='Learning outcomes, skills*' + label-description='Description' + label-iframe_link='For videos, report iframe link' + label-preview_image='Upload preview image' + label-tags='Add tags' + + label-target='Resource target*' + label-type='Type of content*' + label-steps='Categorisation*' + + label-sharing='Share with*' + + label-related='Add a resource' + + multiple-field='sib-multiple-select' + widget-field='sib-form-auto-completion' + + multiple-type='sib-multiple-select' + widget-type='sib-form-auto-completion' + + multiple-format='sib-multiple-select' + widget-format='sib-form-auto-completion' + + multiple-steps='sib-multiple-select' + widget-steps='sib-form-auto-completion' + + multiple-language='sib-multiple-select' + widget-language='sib-form-auto-completion' + + multiple-related='sib-multiple-select' + widget-related='sib-form-auto-completion' + + widget-description='sib-form-textarea' + widget-skills='sib-form-textarea' + widget-publication_year='sib-form-number' + + submit-button='Send for validation ->' + next="mentor-resource-list" +) \ No newline at end of file diff --git a/src/includes/mentor/resources/edit.pug b/src/includes/mentor/resources/edit.pug new file mode 100644 index 0000000000000000000000000000000000000000..650b18519867792a9480d3c3e4d15f4712fa04d0 --- /dev/null +++ b/src/includes/mentor/resources/edit.pug @@ -0,0 +1,80 @@ +include ../../components/widgets + +h2 Post a resource + +p Thank you for enriching our database ! + +sib-form( + bind-resources + fields="mandatory_information(header_mandatory, name, country, language, uri,\ + format, field, author, publication_year, skills),\ + complementary_information(header_complementary, description, iframe_link,\ + preview_image, tags),classification(header_classification, target, type, steps),\ + access(header_access, sharing),related_section(header_related, related)" + + widget-header_mandatory='cs-section_header' + widget-header_complementary='cs-section_header' + widget-header_classification='cs-section_header' + widget-header_access='cs-section_header' + widget-header_related='cs-section_header' + + range-type=`${endpoints.types}` + range-format=`${endpoints.formats}` + range-steps=`${endpoints.steps}` + range-language=`${endpoints.languages}` + range-field=`${endpoints.fields}` + range-related=`${endpoints.resources}` + + label-header_mandatory='Mandatory information' + label-header_complementary='Complementary information' + label-header_classification='Classification' + label-header_access='Access' + label-header_related='Related resources' + + label-name='Title*' + label-country='Country*' + label-language='Language*' + label-uri='Location/weblink*' + label-format='Format*' + label-field='Field*' + label-author='Resource author*' + label-publication_year='Year of publication*' + label-skills='Learning outcomes, skills*' + label-description='Description' + label-iframe_link='For videos, report iframe link' + label-preview_image='Upload preview image' + label-tags='Add tags' + + label-target='Resource target*' + label-type='Type of content*' + label-steps='Categorisation*' + + label-sharing='Share with*' + + label-related='Add a resource' + + multiple-field='sib-multiple-select' + widget-field='sib-form-auto-completion' + + multiple-type='sib-multiple-select' + widget-type='sib-form-auto-completion' + + multiple-format='sib-multiple-select' + widget-format='sib-form-auto-completion' + + multiple-steps='sib-multiple-select' + widget-steps='sib-form-auto-completion' + + multiple-language='sib-multiple-select' + widget-language='sib-form-auto-completion' + + multiple-related='sib-multiple-select' + widget-related='sib-form-auto-completion' + + widget-description='sib-form-textarea' + widget-skills='sib-form-textarea' + widget-publication_year='sib-form-number' + + submit-button='Send for validation ->' + next="mentor-resource-list" +) \ No newline at end of file diff --git a/src/includes/mentor/resources/list.pug b/src/includes/mentor/resources/list.pug new file mode 100644 index 0000000000000000000000000000000000000000..efb38ec9f6c2c4bef8e0913c0c5e7835f395544f --- /dev/null +++ b/src/includes/mentor/resources/list.pug @@ -0,0 +1,22 @@ +sib-widget(name='resource-format-name') + template + div + p ${value.name} + +div.resources__newresource + sib-link(next='mentor-resource-create').plus-button + div.icon-plus + div Post a new Resource + +#circles + sib-display#circles-list( + data-src=`${sdn}/resources/`, + fields='content(title, description), format, info(author, publication_year, language.name), steps', + widget-format='resource-format-name', + multiple-format, + + widget-steps='resource-format-name', + multiple-steps, + + next='mentor-resource-edit' + ) \ No newline at end of file diff --git a/src/includes/mentor/resources/validate.pug b/src/includes/mentor/resources/validate.pug new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/includes/menu.pug b/src/includes/menu.pug deleted file mode 100644 index b1a5f44a76ae25705d1cc0b656f9ddb12f441215..0000000000000000000000000000000000000000 --- a/src/includes/menu.pug +++ /dev/null @@ -1,14 +0,0 @@ -sib-router(default-route="list", use-hash) - sib-route(name='list') - div.menu-label Resources - div.menu-icon.icon-people - div.divider - sib-ac-checker(permission="acl:Write") - sib-route(name='create') - div.menu-label Create a resource - div.menu-icon.icon-people - div.divider - sib-ac-checker(permission="acl:Write" bind-resources) - sib-route(id-prefix=`${endpoints.resources}`, name='edit', use-id) - sib-route(name="mentor") - sib-route(name="entrepreneur") \ No newline at end of file diff --git a/src/includes/resource/create.pug b/src/includes/resource/create.pug deleted file mode 100644 index 9599513286b0156baafb0c9fed9640a247410eea..0000000000000000000000000000000000000000 --- a/src/includes/resource/create.pug +++ /dev/null @@ -1,58 +0,0 @@ -h2 Create a new resource - -details - summary All available fields: - sib-form( - data-src=`${endpoints.resources}` - range-type=`${endpoints.types}` - range-format=`${endpoints.format}` - range-steps=`${endpoints.steps}` - range-language=`${endpoints.language}` - range-field=`${endpoints.field}` - range-related=`${endpoints.resources}` - - class-field='form-label is-dark' - label-field='Select the fields of the resource:*' - multiple-field='sib-multiple-select' - widget-field='sib-form-auto-completion' - - class-type='form-label is-dark' - label-type='Select the types of the resource:*' - name-type='title' - multiple-type='sib-multiple-select' - widget-type='sib-form-auto-completion' - - class-format='form-label is-dark' - label-format='Select the format(s) of the resource:*' - multiple-format='sib-multiple-select' - widget-format='sib-form-auto-completion' - - class-steps='form-label is-dark' - label-steps='Select the steps related to the resource:*' - multiple-steps='sib-multiple-select' - widget-steps='sib-form-auto-completion' - - class-language='form-label is-dark' - label-language='Select the language of the resource:*' - multiple-language='sib-multiple-select' - widget-language='sib-form-auto-completion' - - class-related='form-label is-dark' - label-related='Select related resources:*' - multiple-related='sib-multiple-select' - widget-related='sib-form-auto-completion' - - class-description='field form-label is-light is-expanded' - label-description='Description*' - widget-description='sib-form-textarea' - - class-skills='field form-label is-light is-expanded' - label-skills='Skills you will blabla*' - widget-skills='sib-form-textarea' - - class-publication_year='form-label is-dark' - label-publication_year='Publication date:*' - widget-publication_year='sib-form-number' - - next="list" - ) \ No newline at end of file diff --git a/src/includes/resource/edit.pug b/src/includes/resource/edit.pug deleted file mode 100644 index 63c30f7f8baf36fa756547512be4fd06ab6d08db..0000000000000000000000000000000000000000 --- a/src/includes/resource/edit.pug +++ /dev/null @@ -1,26 +0,0 @@ -h2 Edit this resource - -sib-form.block( - bind-resources - - fields='title, description, skills, closingDate' - - class-title='field form-label is-light is-expanded' - label-title='Title*' - - class-description='field form-label is-light is-expanded' - label-description='Description*' - widget-description='sib-form-textarea' - - class-skills='form-label is-dark' - label-skills='The required skills for this mission:*' - multiple-skills='sib-multiple-select' - widget-skills='sib-form-auto-completion' - - class-closingDate='form-label is-dark' - label-closingDate='Publication end date:*' - widget-closingDate='sib-form-date' - - next='list' -) - diff --git a/src/includes/splash.pug b/src/includes/splash.pug index 8c90634d8d2cb384ecf318818d762d712c089e5c..caa93d28e8756c11e84d49679b53c4f40e0431d5 100644 --- a/src/includes/splash.pug +++ b/src/includes/splash.pug @@ -2,7 +2,7 @@ sib-router sib-route(name='mentor-login') sib-route(name='entrepreneur-login') -h2 Welcome to your international index of resources for cooperative mentors and entrepreneurs +h2 Welcome to our international index of resources for cooperative mentors and entrepreneurs sib-link(next='mentor-login') div I am a mentor diff --git a/src/index.pug b/src/index.pug index 08db7c68e13f1d1f29f1205b694202d20433e3b5..e58fa109624dacc17379e443c803e4c54b38a405 100644 --- a/src/index.pug +++ b/src/index.pug @@ -6,7 +6,16 @@ html sib-route(name='splash') sib-route(name='mentor-new-account') sib-route(name='entrepreneur-new-account') + sib-route(name='mentor-dashboard') + sib-route(name='entrepreneur-search-page') + body + #mentor-dashboard(hidden).no-sidebar + include includes/mentor/dashboard.pug + + #entrepreneur-search-page(hidden).no-sidebar + include includes/entrepreneur/dashboard.pug + #splash(hidden).no-sidebar include includes/splash.pug