diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index ff31811f18caab4bc0e67a994eb7925168e58206..272832c1f04783071fe921704fd0223c9f936672 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -196,15 +196,15 @@ sib-widget(name='cs-about-field') sib-widget(name='cs-account-picture') template figure.avatar - img(src="\${value || '/images/alien.jpg'}", alt="Profile picture") + img(src="\${await value || '/images/alien.jpg'}", alt="Profile picture") sib-widget(name='cs-profile-picture') template - img(src="\${value || '/images/alien.jpg'}", alt="Profile picture") + img(src="\${await value || '/images/alien.jpg'}", alt="Profile picture") sib-widget(name='cs-preview-picture') template - img(src="\${value || '/images/alien.jpg'}", alt="Preview of the resource") + img(src="\${await value || '/images/alien.jpg'}", alt="Preview of the resource") sib-widget(name="hidden-widget") template @@ -232,6 +232,11 @@ sib-widget(name="cs-form-file-custom") label(for="preview_image") sib-form-file(upload-url=`${sdn}upload/` name="preview_image" ) +sib-widget(name="cs-ent-profile-picture") + template + label(for="picture") + sib-form-file(upload-url=`${sdn}upload/` name="picture") + sib-widget(name="cs-form-profile-picture") template label(for="account.picture") diff --git a/src/includes/entrepreneur/components/header.pug b/src/includes/entrepreneur/components/header.pug index 728a382185a860b2251353d5467eb82a01feab2f..7748c9c23177a85a6fdf207a9318a0829bf69320 100644 --- a/src/includes/entrepreneur/components/header.pug +++ b/src/includes/entrepreneur/components/header.pug @@ -19,8 +19,9 @@ .dropdownWrapper sib-display#entrepreneur_account_picture.dropdownLabel( bind-user - fields='account.picture', - widget-account.picture='cs-account-picture' + nested-field="account" + fields="foaf:depiction" + widget-foaf:depiction='cs-account-picture' ) div.dropdownPanel diff --git a/src/includes/entrepreneur/profile/edit.pug b/src/includes/entrepreneur/profile/edit.pug index 924a1794e5e409a891d42baa3e8df9b0d4581f46..c878deab310e4bc4645324580e3bc3f3311bb6ba 100644 --- a/src/includes/entrepreneur/profile/edit.pug +++ b/src/includes/entrepreneur/profile/edit.pug @@ -3,29 +3,50 @@ h2.title_create= data.EditYourAccount sib-form#entrepreneur_profile_edition.block_log.block_creat_count( partial bind-user - fields="info(last_name, first_name, username, email, entrepreneurProfile.organisation, account.picture)" - range-entrepreneurProfile.organisation=`${endpoints.organisations}` + fields="info(last_name, first_name, username, email)" label-first_name=`${data.Surname}` label-last_name=`${data.Name}` - label-entrepreneurProfile.organisation=`${data.Organisation}` label-account.picture=`${data.Photo}` widget-username="sib-form-hidden" class-last_name='form-label is-dark input_big' class-first_name='form-label is-dark input_big' class-email='form-label is-dark input_big' - class-entrepreneurProfile.phone='form-label is-dark input_big' - class-entrepreneurProfile.organisation='form-label is-dark input_big' - widget-entrepreneurProfile.organisation='sib-form-auto-completion' + submit-button=`${data.SaveModification}` + next='entrepreneur-account-edit-confirmation' +) + +sib-form#entrepreneur_profile_organisation.block_log.block_creat_count( + partial + bind-user + nested-field="entrepreneurProfile" + fields="organisation" + + range-organisation=`${endpoints.organisations}` + label-organisation=`${data.Organisation}` + class-organisation='form-label is-dark input_big' + widget-organisation='sib-form-auto-completion' + + submit-button=`${data.SaveModification}` + next='entrepreneur-account-edit-confirmation' +) + +sib-form#entrepreneur_profile_picture.block_log.block_creat_count( + partial + bind-user + nested-field="account" + fields="picture, slug, issuer" - upload-url-account.picture=`${sdn}upload/` - widget-account.picture='cs-form-profile-picture' - class-account.picture='input_photo w_25' + widget-issuer="sib-form-hidden" + widget-slug="sib-form-hidden" + upload-url-picture=`${sdn}upload/` + widget-picture='cs-ent-profile-picture' + class-picture='input_photo w_25' submit-button=`${data.SaveModification}` next='entrepreneur-account-edit-confirmation' ) -sib-link(class="backlink", next="entrepreneur-resource-list")= data.BackToDashboard \ No newline at end of file +sib-link(class="backlink", next="entrepreneur-account")= data.BackToDashboard \ No newline at end of file diff --git a/src/includes/mentor/components/header.pug b/src/includes/mentor/components/header.pug index dc33c055fcc7b23086702be2d0e689df3d852c6f..47dcf1f645d96a7d4145518a103a73c480235c48 100644 --- a/src/includes/mentor/components/header.pug +++ b/src/includes/mentor/components/header.pug @@ -16,11 +16,13 @@ label-languages='' naked ) + .dropdownWrapper sib-display#mentor_account_picture.dropdownLabel( bind-user - fields='account.picture', - widget-account.picture='cs-account-picture' + nested-field="account" + fields="foaf:depiction" + widget-foaf:depiction='cs-account-picture' ) div.dropdownPanel ul diff --git a/src/includes/mentor/profile/detail.pug b/src/includes/mentor/profile/detail.pug index 1df3c528ce43da184037149fca8ac467782bc58c..9cc61b3d4ec05d1ce31fc40a48a858b106bf652c 100644 --- a/src/includes/mentor/profile/detail.pug +++ b/src/includes/mentor/profile/detail.pug @@ -27,9 +27,10 @@ div.block_list.flex sib-display#mentor_info( bind-user - fields='account.picture, name, mentorProfile.headline, mentorProfile.city, mentorProfile.country.name, registered_on' + fields='account.picture, name, mentorProfile.organisation.name, mentorProfile.headline, mentorProfile.city, mentorProfile.country.name, registered_on' widget-account.picture='cs-profile-picture' widget-name='cs-display-property' + widget-mentorProfile.organisation.name='cs-display-property' widget-mentorProfile.headline='cs-display-property' widget-mentorProfile.city='cs-display-property' widget-mentorProfile.country.name='cs-display-property' diff --git a/src/includes/mentor/profile/edit.pug b/src/includes/mentor/profile/edit.pug index 08c42597b2cb59022c8d31d18411d960aab678fc..2e76acedf377e60e983120bedb30a65662bb8f77 100644 --- a/src/includes/mentor/profile/edit.pug +++ b/src/includes/mentor/profile/edit.pug @@ -3,14 +3,13 @@ h2.title_create= data.EditYourAccount sib-form#mentor_profile_edition.block_log.block_creat_count( bind-user partial - fields="account_information(last_name, first_name, mentorProfile.organisation,\ + fields="account_information(last_name, first_name,\ mentorProfile.phone, mentorProfile.languages, mentorProfile.fields),\ about_you(header_about_you, account.picture, mentorProfile.headline, mentorProfile.city, mentorProfile.country,\ mentorProfile.biography, mentorProfile.skills),\ social_media(header_social_media, mentorProfile.linkedin, mentorProfile.twitter), username" range-mentorProfile.fields=`${endpoints.fields}` - range-mentorProfile.organisation=`${endpoints.organisations}` range-mentorProfile.languages=`${endpoints.languages}` range-mentorProfile.country=`${endpoints.countries}` @@ -22,7 +21,6 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( label-first_name=`${data.Surname}` label-last_name=`${data.Name}` - label-mentorProfile.organisation=`${data.Organisation}` label-mentorProfile.phone=`${data.PhoneNumber}` label-mentorProfile.languages=`${data.Language}` label-mentorProfile.fields=`${data.Field}` @@ -42,9 +40,6 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( class-mentorProfile.country='form-label is-dark' widget-mentorProfile.country='sib-form-auto-completion' - class-mentorProfile.organisation='form-label is-dark' - widget-mentorProfile.organisation='sib-form-auto-completion' - class-mentorProfile.languages='form-label is-dark' multiple-mentorProfile.languages='sib-multiple-select' widget-mentorProfile.languages='sib-form-auto-completion' @@ -63,5 +58,20 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( next="mentor-account-edit-confirmation" ) +sib-form#mentor_profile_organisation.block_log.block_creat_count( + partial + bind-user + nested-field="mentorProfile" + fields="organisation" + + range-organisation=`${endpoints.organisations}` + label-organisation=`${data.Organisation}` + class-organisation='form-label is-dark input_big' + widget-organisation='sib-form-auto-completion' + + submit-button=`${data.SaveModification}` + next='mentor-account-edit-confirmation' +) + sib-link(class="backlink", next="mentor-account")= data.BackToMyAccount sib-link(class="backlink", next="mentor-dashboard")= data.BackToDashboard diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 204c8850302179dad945367254ba86d3a9409d08..c2efd63f660584d453c75e9e2641a711cd2a50f0 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -137,7 +137,9 @@ async function refreshUser(formId, listId) { profile.clearCache(); } else { profile = await listProxy['mentorProfile']; - profile.clearCache(); + if (profile) { + profile.clearCache(); + } } } }); @@ -748,10 +750,15 @@ document.addEventListener("DOMContentLoaded", event => { refreshUser("mentor_profile_creation", "mentor_account_picture"); refreshUser("entrepreneur_profile_edition", "entrepreneur_info"); refreshUser("entrepreneur_profile_edition", "entrepreneur_contact"); - refreshUser("entrepreneur_profile_edition", "entrepreneur_account_picture"); + refreshUser("entrepreneur_profile_organisation", "entrepreneur_info"); + refreshUser("entrepreneur_profile_organisation", "entrepreneur_contact"); + refreshUser("entrepreneur_profile_picture", "entrepreneur_account_picture"); refreshUser("mentor_profile_edition", "mentor_info"); refreshUser("mentor_profile_edition", "mentor_complementary"); refreshUser("mentor_profile_edition", "mentor_contact"); + refreshUser("mentor_profile_organisation", "mentor_info"); + refreshUser("mentor_profile_organisation", "mentor_complementary"); + refreshUser("mentor_profile_organisation", "mentor_contact"); refreshUser("mentor_profile_edition", "mentor_account_picture"); addProperFilterToSearchComponents("entrepreneur-resource-list");