diff --git a/src/includes/entrepreneur/create.pug b/src/includes/entrepreneur/create.pug index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8f40f7eadc344b5359fb51ed54456849fced3f6f 100644 --- a/src/includes/entrepreneur/create.pug +++ b/src/includes/entrepreneur/create.pug @@ -0,0 +1,25 @@ +h2 Create an entrepreneur account + +sib-form( + + data-src=`${endpoints.entrepreneurs}` + fields="user.username, user.last_name, user.first_name, organisation,\ + user.email, user.password, user.password_confirmation" + + range-organisation=`${endpoints.organisations}` + + label-user.first_name="Surname" + label-user.last_name="Name" + label-user.username="Username" + label-user.email="Email" + label-organisation="Organisation *" + label-user.password="Password" + label-user.password_confirmation="Password confirmation" + + class-organisation='form-label is-dark' + multiple-organisation='sib-multiple-select' + widget-organisation='sib-form-auto-completion' + + submit-button="CREATE AN ACCOUNT" +) + diff --git a/src/includes/entrepreneur/login.pug b/src/includes/entrepreneur/login.pug index 3ca1e327fbff9c50d998f1e33bd4dc39be73c2ee..70bb0b04af6f8efcc252b07fc8d48d53a4d27ce5 100644 --- a/src/includes/entrepreneur/login.pug +++ b/src/includes/entrepreneur/login.pug @@ -1,10 +1,15 @@ 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 +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/head.pug b/src/includes/head.pug index 1c19e5ae91aa4fd31abfbbbd9c32afce1bd9a3d9..63f8363375db850cde1e8f475c6dddb3f23dd210 100644 --- a/src/includes/head.pug +++ b/src/includes/head.pug @@ -2,9 +2,9 @@ head title CoopStarter meta(charset="utf-8") script(src="https://unpkg.com/@webcomponents/webcomponentsjs@1.2.7/webcomponents-loader.js") - script(type="module" src="https://unpkg.com/@startinblox/core@0.7") + script(type="module" src="https://unpkg.com/@startinblox/core@0.8") script(type="module" src="https://unpkg.com/@startinblox/router@0.7") - script(type="module" src="https://unpkg.com/@startinblox/oidc@0.6") + script(type="module" src="https://unpkg.com/@startinblox/oidc@0.7") script(src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous") script(src="/scripts/coopstarter.js") link(rel="stylesheet" href="/styles/coopstarter.css") diff --git a/src/includes/mentor/create.pug b/src/includes/mentor/create.pug index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..568c71883cbcfba77f7a6381b7ca77c8f83dfebb 100644 --- a/src/includes/mentor/create.pug +++ b/src/includes/mentor/create.pug @@ -0,0 +1,74 @@ +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. + +sib-form( + data-src=`${endpoints.mentors}` + fields="account_information(header_account, user.username, user.last_name, user.first_name, organisation,\ + user.email, phone, language,\ + user.password, user.password_confirmation, account.picture),\ + about_you(header_about_you, headline, city, country,\ + biography, skills),\ + social_media(header_social_media, linkedin, twitter)" + + + range-organisation=`${endpoints.organisations}` + range-language=`${endpoints.languages}` + + label-header_account="Create a mentor account" + label-header_about_you="About you" + label-header_social_media="Social medias" + + widget-header_social_media="cs-section_header" + widget-header_account="cs-section_header" + widget-header_about_you="cs-section_introduction" + + label-user.username="Username" + label-user.first_name="Surname" + label-user.last_name="Name" + label-user.email="Email" + label-organisation="Organisation" + label-phone="Phone number" + label-user.password="Password" + label-user.password_confirmation="Password confirmation" + label-language="Language" + label-account.picture="Photo" + label-headline="Headline or current position" + label-city="City" + label-country="Country" + label-biography="Tell us more about your activities" + label-skills="What skills can you share with our entrepreneurs ?" + label-linkedin="Linkedin" + label-twitter="Twitter" + + widget-skills="sib-form-textarea" + widget-biography="sib-form-textarea" + widget-user.password_confirmation="cs-form-password" + widget-user.password="cs-form-password" + + class-organisation='form-label is-dark' + multiple-organisation='sib-multiple-select' + widget-organisation='sib-form-auto-completion' + + class-language='form-label is-dark' + multiple-language='sib-multiple-select' + widget-language='sib-form-auto-completion' + + submit-button="CREATE AN ACCOUNT" +) diff --git a/src/includes/mentor/login.pug b/src/includes/mentor/login.pug index 005ae88470298f2269610c422f0f0b424f590e6a..c907c43536a382283a1d3b4abb3c87e05a5b0cf3 100644 --- a/src/includes/mentor/login.pug +++ b/src/includes/mentor/login.pug @@ -1,10 +1,6 @@ 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 +button(role='log in' onclick="document.querySelector('sib-auth').login();") Login as mentor + +sib-link(next='mentor-new-account') + div Create an account \ No newline at end of file diff --git a/src/includes/resource/edit.pug b/src/includes/resource/edit.pug index a38e3e943ba07803d37d83f21ee0a0b23945758b..63c30f7f8baf36fa756547512be4fd06ab6d08db 100644 --- a/src/includes/resource/edit.pug +++ b/src/includes/resource/edit.pug @@ -3,7 +3,7 @@ h2 Edit this resource sib-form.block( bind-resources - data-fields='title, description, skills, closingDate' + fields='title, description, skills, closingDate' class-title='field form-label is-light is-expanded' label-title='Title*' diff --git a/src/includes/resource/list.pug b/src/includes/resource/list.pug index dd4eca3f9208c218324344aa9f269019c1c0944f..8cfc6c603eaece50484d473ce1b31d649fc26730 100644 --- a/src/includes/resource/list.pug +++ b/src/includes/resource/list.pug @@ -14,19 +14,15 @@ div.resources__newresource #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' - + data-src=`${sdn}/resources/`, + fields='content(title, description), format, info(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, + + next='edit' ) - //- group-by='step' \ No newline at end of file diff --git a/src/includes/splash.pug b/src/includes/splash.pug index c0e742a2ab462d49274bf254b7adb78f4dcd3e9e..8c90634d8d2cb384ecf318818d762d712c089e5c 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 our international index of resources for cooperative mentors and entrepreneurs +h2 Welcome to your international index of resources for cooperative mentors and entrepreneurs sib-link(next='mentor-login') div I am a mentor @@ -14,4 +14,4 @@ sib-link(next='entrepreneur-login') include mentor/login.pug #entrepreneur-login(hidden).no-sidebar - include entrepreneur/login.pug \ No newline at end of file + include entrepreneur/login.pug diff --git a/src/includes/templates/header.pug b/src/includes/templates/header.pug index 16d06eeba07c2d27e7f0da9f0b3c668bf91ce3d8..7d250afe9ebacfaa03a26bb03d298cbe8e9a0b91 100644 --- a/src/includes/templates/header.pug +++ b/src/includes/templates/header.pug @@ -12,7 +12,7 @@ sib-widget(name='account-user-name') include menu.pug sib-display#user-controls__profile( - data-fields='first_name, account.picture', + fields='first_name, account.picture', widget-first_name='account-user-name', widget-account.picture='account-user-avatar', bind-user diff --git a/src/index.pug b/src/index.pug index c8374c44cae88e1ee4b36a885b2e0c5a1e9b3e2c..08db7c68e13f1d1f29f1205b694202d20433e3b5 100644 --- a/src/index.pug +++ b/src/index.pug @@ -1,6 +1,30 @@ doctype html html include includes/head.pug + + sib-router(default-route='splash') + sib-route(name='splash') + sib-route(name='mentor-new-account') + sib-route(name='entrepreneur-new-account') body - include includes/splash.pug + #splash(hidden).no-sidebar + include includes/splash.pug + + #mentor-new-account(hidden).no-sidebar + include includes/mentor/create.pug + + #entrepreneur-new-account(hidden).no-sidebar + include includes/entrepreneur/create.pug + + 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' + )