diff --git a/src/config.sample.json b/src/config.sample.json index 743f6eb48a34df828c4988752bcd96b1f4c6c7c7..f4e2db46aeeaaff00636ceef192fe59b7ab775f8 100644 --- a/src/config.sample.json +++ b/src/config.sample.json @@ -3,20 +3,44 @@ "sdn": "http://127.0.0.1:8000", "cdn": "https://cdn.happy-dev.fr", "xmpp": "https://jabber.happy-dev.fr/http-bind/", - "client_id": "833925" + "client_id": "833925", + "endpoints": { + "resources": "http://127.0.0.1:8000/resources/", + "fields": "http://127.0.0.1:8000/fields/", + "formats": "http://127.0.0.1:8000/formats/", + "types": "http://127.0.0.1:8000/types/", + "languages": "http://127.0.0.1:8000/languages/", + "steps": "http://127.0.0.1:8000/steps/" + } }, "staging": { "sdn": "http://test-paris.happy-dev.fr", "cdn": "https://cdn.happy-dev.fr", "xmpp": "https://jabber.happy-dev.fr/http-bind/", - "client_id": "833925" + "client_id": "833925", + "endpoints": { + "resources": "http://127.0.0.1:8000/resources/", + "fields": "http://127.0.0.1:8000/fields/", + "formats": "http://127.0.0.1:8000/formats/", + "types": "http://127.0.0.1:8000/types/", + "languages": "http://127.0.0.1:8000/languages/", + "steps": "http://127.0.0.1:8000/steps/" + } }, "prod": { "sdn": "https://api.alpha.happy-dev.fr", "cdn": "https://cdn.happy-dev.fr", "xmpp": "https://jabber.happy-dev.fr/http-bind/", - "client_id": "833925" + "client_id": "833925", + "endpoints": { + "resources": "http://127.0.0.1:8000/resources/", + "fields": "http://127.0.0.1:8000/fields/", + "formats": "http://127.0.0.1:8000/formats/", + "types": "http://127.0.0.1:8000/types/", + "languages": "http://127.0.0.1:8000/languages/", + "steps": "http://127.0.0.1:8000/steps/" + } } } diff --git a/src/includes/dashboard.pug b/src/includes/dashboard.pug deleted file mode 100644 index 8112419cd3c1e7b9822a09479ac23748a84c8482..0000000000000000000000000000000000000000 --- a/src/includes/dashboard.pug +++ /dev/null @@ -1,3 +0,0 @@ -//TODO: Dashboard is the Mentor Dashboard, only -//accessible when logged-in, so should be protected -//by sid-oidc. \ No newline at end of file diff --git a/src/includes/entrepreneur/create.pug b/src/includes/entrepreneur/create.pug new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/includes/entrepreneur/dashboard.pug b/src/includes/entrepreneur/dashboard.pug new file mode 100644 index 0000000000000000000000000000000000000000..9889cac62ca09ef9984d83adcf1cf49c76ed25c0 --- /dev/null +++ b/src/includes/entrepreneur/dashboard.pug @@ -0,0 +1,34 @@ +// 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 + +section#home + h1 Mentorship program + + p International index of resources for cooperative mentors and entrepreneurs + + //TODO: + //-Distinguish the search form from the listing + //-Create two Sib-displays getting the resources by "types" + // 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 diff --git a/src/includes/entrepreneur/login.pug b/src/includes/entrepreneur/login.pug new file mode 100644 index 0000000000000000000000000000000000000000..3ca1e327fbff9c50d998f1e33bd4dc39be73c2ee --- /dev/null +++ b/src/includes/entrepreneur/login.pug @@ -0,0 +1,10 @@ +h2 I am an 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 \ No newline at end of file diff --git a/src/includes/home.pug b/src/includes/home.pug deleted file mode 100644 index 499e58b9497135903036d0288c7976e6a3aa5441..0000000000000000000000000000000000000000 --- a/src/includes/home.pug +++ /dev/null @@ -1,38 +0,0 @@ -section#home - h1 Mentorship program - - p International index of resources for cooperative mentors and entrepreneurs - - p: a Watch a presentation - - h2 Search for a resource - //TODO: - //-Distinguish the search form from the listing - //-Create two Sib-displays getting the resources by "types" - // From two different endpoints I guess - //-Testing the group-by right after the 0.8 version release - //-Work on the page architecture - - sib-widget(name='resource-format-title') - template - p ${value.title} - - - #circles - sib-display#circles-list( - data-src=`${sdn}/resources/`, - data-fields='title, description, format, author, publication_year, language.name, steps', - search-fields='title, description, format', - widget-format='resource-format-title', - multiple-format, - - widget-steps='resource-format-title', - multiple-steps, - - set-content='title, description', - set-info='author, publication_year, language.name', - next='detail' - ) - - - //- group-by='step' diff --git a/src/includes/mentor/create.pug b/src/includes/mentor/create.pug new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/includes/mentor/dashboard.pug b/src/includes/mentor/dashboard.pug new file mode 100644 index 0000000000000000000000000000000000000000..82438c418ece36127a31b62412cb2d0b71d3ed1a --- /dev/null +++ b/src/includes/mentor/dashboard.pug @@ -0,0 +1,7 @@ +// 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 diff --git a/src/includes/mentor/login.pug b/src/includes/mentor/login.pug new file mode 100644 index 0000000000000000000000000000000000000000..005ae88470298f2269610c422f0f0b424f590e6a --- /dev/null +++ b/src/includes/mentor/login.pug @@ -0,0 +1,10 @@ +h2 I am a mentor + +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 diff --git a/src/includes/mentor/profile.pug b/src/includes/mentor/profile.pug new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/includes/menu.pug b/src/includes/menu.pug index ad6ce620b342c2e9c9933c2af18bc353494f9867..b1a5f44a76ae25705d1cc0b656f9ddb12f441215 100644 --- a/src/includes/menu.pug +++ b/src/includes/menu.pug @@ -1,11 +1,14 @@ -sib-router(default-route="home") - .d-flex - details - summary menu - .d-flex.menu-opened - .clients-menu.d-flex.flex-column.col-md-4.col-12.text-center - h2 Clients - .talents-menu.d-flex.flex-column.col-md-4.col-12.text-center - h2 Talents - .about-menu.d-flex.flex-column.col-md-4.col-12.text-center - h2 À propos +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 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9599513286b0156baafb0c9fed9640a247410eea 100644 --- a/src/includes/resource/create.pug +++ b/src/includes/resource/create.pug @@ -0,0 +1,58 @@ +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 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a38e3e943ba07803d37d83f21ee0a0b23945758b 100644 --- a/src/includes/resource/edit.pug +++ b/src/includes/resource/edit.pug @@ -0,0 +1,26 @@ +h2 Edit this resource + +sib-form.block( + bind-resources + + data-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/resource/list.pug b/src/includes/resource/list.pug new file mode 100644 index 0000000000000000000000000000000000000000..dd4eca3f9208c218324344aa9f269019c1c0944f --- /dev/null +++ b/src/includes/resource/list.pug @@ -0,0 +1,32 @@ +sib-widget(name='resource-format-name') + template + div + p ${value.name} + +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/`, + data-fields='title, description, format, author, publication_year, language.name, steps', + search-fields='title, description, format', + widget-format='resource-format-name', + multiple-format, + + widget-steps='resource-format-name', + multiple-steps, + + set-content='title, description', + set-info='author, publication_year, language.name', + next='edit' + + ) + + //- group-by='step' \ No newline at end of file diff --git a/src/includes/resources.pug b/src/includes/resources.pug deleted file mode 100644 index a5c721492e2d2691e0cf2160db98b641486bdd95..0000000000000000000000000000000000000000 --- a/src/includes/resources.pug +++ /dev/null @@ -1,7 +0,0 @@ -#circles - sib-display#circles-list( - data-src=`${sdn}/resources/`, - data-fields='title, description', - search-fields='title, description', - next='group' - ) diff --git a/src/includes/splash.pug b/src/includes/splash.pug new file mode 100644 index 0000000000000000000000000000000000000000..c0e742a2ab462d49274bf254b7adb78f4dcd3e9e --- /dev/null +++ b/src/includes/splash.pug @@ -0,0 +1,17 @@ +sib-router + sib-route(name='mentor-login') + sib-route(name='entrepreneur-login') + +h2 Welcome to our international index of resources for cooperative mentors and entrepreneurs + +sib-link(next='mentor-login') + div I am a mentor + +sib-link(next='entrepreneur-login') + div I am an entrepreneur + +#mentor-login(hidden).no-sidebar + include mentor/login.pug + +#entrepreneur-login(hidden).no-sidebar + include entrepreneur/login.pug \ No newline at end of file diff --git a/src/includes/header.pug b/src/includes/templates/header.pug similarity index 82% rename from src/includes/header.pug rename to src/includes/templates/header.pug index 0285464a6e1c54246a0013b40ec84bd563384478..16d06eeba07c2d27e7f0da9f0b3c668bf91ce3d8 100644 --- a/src/includes/header.pug +++ b/src/includes/templates/header.pug @@ -20,14 +20,7 @@ sib-widget(name='account-user-name') button(role='log in' onclick="document.querySelector('sib-auth').login();") Login - #resources(hidden).no-sidebar - include home.pug - - #resource-create(hidden).no-sidebar - sib-link(class="backlink", next="resources") Back - include resource/create.pug - - + button(role='log out' onclick="document.querySelector('sib-auth').logout();") Logout sib-auth sib-auth-provider( diff --git a/src/index.pug b/src/index.pug index d94604fcbb450b5a5ee6ccc7d5f8c4437f64eb61..c8374c44cae88e1ee4b36a885b2e0c5a1e9b3e2c 100644 --- a/src/index.pug +++ b/src/index.pug @@ -2,5 +2,5 @@ doctype html html include includes/head.pug body - include includes/header.pug - include includes/home.pug + include includes/splash.pug +