From 8c13487836ee660275ef01cfc0815ed7f8c451b0 Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Wed, 17 Jul 2019 20:09:50 +0200 Subject: [PATCH] Re-architecturing some stuff --- src/includes/entrepreneur/dashboard.pug | 12 +++------ src/includes/entrepreneur/login.pug | 9 ------- .../requests}/create.pug | 0 .../resources}/detail.pug | 0 .../resources}/list.pug | 11 +++----- src/includes/mentor/components/header.pug | 5 ++-- src/includes/mentor/components/menu.pug | 8 +++--- src/includes/mentor/dashboard.pug | 25 +++++++++++++------ .../validate.pug => mentor/requests/list.pug} | 0 .../{resource => mentor/resources}/create.pug | 0 .../{resource => mentor/resources}/edit.pug | 0 src/includes/mentor/resources/list.pug | 22 ++++++++++++++++ src/includes/mentor/resources/validate.pug | 0 13 files changed, 53 insertions(+), 39 deletions(-) rename src/includes/{request => entrepreneur/requests}/create.pug (100%) rename src/includes/{resource => entrepreneur/resources}/detail.pug (100%) rename src/includes/{resource => entrepreneur/resources}/list.pug (76%) rename src/includes/{resource/validate.pug => mentor/requests/list.pug} (100%) rename src/includes/{resource => mentor/resources}/create.pug (100%) rename src/includes/{resource => mentor/resources}/edit.pug (100%) create mode 100644 src/includes/mentor/resources/list.pug create mode 100644 src/includes/mentor/resources/validate.pug diff --git a/src/includes/entrepreneur/dashboard.pug b/src/includes/entrepreneur/dashboard.pug index 2d7caf6f..4bf507f1 100644 --- a/src/includes/entrepreneur/dashboard.pug +++ b/src/includes/entrepreneur/dashboard.pug @@ -1,8 +1,4 @@ -// 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 @@ -18,9 +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 \ 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 70bb0b04..1323da75 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/request/create.pug b/src/includes/entrepreneur/requests/create.pug similarity index 100% rename from src/includes/request/create.pug rename to src/includes/entrepreneur/requests/create.pug diff --git a/src/includes/resource/detail.pug b/src/includes/entrepreneur/resources/detail.pug similarity index 100% rename from src/includes/resource/detail.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 8cfc6c60..2e805089 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/mentor/components/header.pug b/src/includes/mentor/components/header.pug index 035526e8..c9f0553b 100644 --- a/src/includes/mentor/components/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,7 +14,7 @@ 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 ) diff --git a/src/includes/mentor/components/menu.pug b/src/includes/mentor/components/menu.pug index 9b62d0c5..a27d8ace 100644 --- a/src/includes/mentor/components/menu.pug +++ b/src/includes/mentor/components/menu.pug @@ -1,14 +1,12 @@ -sib-router(default-route="list", use-hash) +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='resource-create') + 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='resource-edit', use-id) - sib-route(name="mentor") - sib-route(name="entrepreneur") \ No newline at end of file + sib-route(id-prefix=`${endpoints.resources}`, name='mentor-resource-edit', use-id) \ No newline at end of file diff --git a/src/includes/mentor/dashboard.pug b/src/includes/mentor/dashboard.pug index 08a9e583..4f8eaa69 100644 --- a/src/includes/mentor/dashboard.pug +++ b/src/includes/mentor/dashboard.pug @@ -1,4 +1,8 @@ -// 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 @@ -9,10 +13,17 @@ header#header(role='banner') section#home h1 Mentorship program - #resource-create(hidden).no-sidebar - sib-link(class="backlink", next="list") Back to the list - include ../resource/create.pug + #mentor-resource-list(hidden).no-sidebar + include resources/list.pug - #resource-edit(hidden).no-sidebar - sib-link(class="backlink", next="list") Back to the list - include ../resource/edit.pug \ No newline at end of file + #mentor-resource-create(hidden).no-sidebar + sib-link(class="backlink", next="list") Back to the resources list + include resources/create.pug + + #mentor-resource-edit(hidden).no-sidebar + sib-link(class="backlink", next="list") Back to the resources list + include resources/edit.pug + + #mentor-resource-validate(hidden).no-sidebar + sib-link(class="backlink", next="list") Back to the resources list + include resources/validate.pug \ No newline at end of file diff --git a/src/includes/resource/validate.pug b/src/includes/mentor/requests/list.pug similarity index 100% rename from src/includes/resource/validate.pug rename to src/includes/mentor/requests/list.pug diff --git a/src/includes/resource/create.pug b/src/includes/mentor/resources/create.pug similarity index 100% rename from src/includes/resource/create.pug rename to src/includes/mentor/resources/create.pug diff --git a/src/includes/resource/edit.pug b/src/includes/mentor/resources/edit.pug similarity index 100% rename from src/includes/resource/edit.pug rename to src/includes/mentor/resources/edit.pug diff --git a/src/includes/mentor/resources/list.pug b/src/includes/mentor/resources/list.pug new file mode 100644 index 00000000..f154a400 --- /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='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 00000000..e69de29b -- GitLab