diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index da14e90a1c1089e5272138c07b01fa310b49b669..e88baddf9bacf9dc2b6e6a154f5d30904b9d4481 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -160,8 +160,15 @@ sib-widget(name="accordion-request-resource") sib-widget(name="cs-form-file-custom") template - label(for="preview_image") - sib-form-file(upload-url=`${sdn}upload/` name="preview_image") + label(for="preview_image") + div Picture + sib-form-file(label="" upload-url=`${sdn}upload/` name="preview_image") + +sib-widget(name="cs-form-profile-picture") + template + label(for="account.picture") + div Picture + sib-form-file(label="" upload-url=`${sdn}upload/` name="account.picture") sib-widget(name="cs-display-twitter-button") template diff --git a/src/includes/entrepreneur/profile/create.pug b/src/includes/entrepreneur/profile/create.pug index cdff639ba33f22c1d372dece2d465d154172026c..4bd269346c539dbbcfb7c149761a1c14ef4943be 100644 --- a/src/includes/entrepreneur/profile/create.pug +++ b/src/includes/entrepreneur/profile/create.pug @@ -24,7 +24,7 @@ sib-form#entrepreneur_profile_creation.block_log.block_creat_count( widget-username='sib-form-hidden' upload-url-account.picture=`${sdn}upload/` - widget-account.picture='cs-form-file-custom' + widget-account.picture='cs-form-profile-picture' class-account.picture='input_photo w_25' submit-button=`${data.CompleteYourAccount}` diff --git a/src/includes/entrepreneur/profile/edit.pug b/src/includes/entrepreneur/profile/edit.pug index 922f7f099f07f4e24e056076ce0bef6af6ea37f5..9a411af874085c72a623d20b8b092de1d8efbd67 100644 --- a/src/includes/entrepreneur/profile/edit.pug +++ b/src/includes/entrepreneur/profile/edit.pug @@ -20,7 +20,7 @@ sib-form#entrepreneur_profile_edition.block_log.block_creat_count( widget-entrepreneurProfile.organisation='sib-form-auto-completion' upload-url-account.picture=`${sdn}upload/` - widget-account.picture='cs-form-file-custom' + widget-account.picture='cs-form-profile-picture' class-account.picture='input_photo w_25' submit-button=`${data.SaveModification}` diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug index 80b1be003a88c61b5def3f420292fc87acbe84ab..b0c4be0a02abb996966175d1ac9f2f13fe1f61db 100644 --- a/src/includes/entrepreneur/resources/detail.pug +++ b/src/includes/entrepreneur/resources/detail.pug @@ -111,7 +111,7 @@ bind-resources fields="" nested-field="conversations" - counter-template=`<p>${data.Comments} (${counter})</p>` + counter-template=`<p>${data.Comments} (\${counter})</p>` ) sib-conversation( diff --git a/src/includes/mentor/profile/create.pug b/src/includes/mentor/profile/create.pug index 10b390d878db5853a1b4fc5d1ffbe3e4a5b62a32..e7bc8388706fa3de36599b3944587334ef1fc84d 100644 --- a/src/includes/mentor/profile/create.pug +++ b/src/includes/mentor/profile/create.pug @@ -14,7 +14,7 @@ sib-form#mentor_profile_creation.block_log.block_creat_count( 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" + social_media(header_social_media, mentorProfile.linkedin, mentorProfile.twitter), username, account.slug" range-mentorProfile.fields=`${endpoints.fields}` range-mentorProfile.organisation=`${endpoints.organisations}` @@ -46,6 +46,8 @@ sib-form#mentor_profile_creation.block_log.block_creat_count( widget-mentorProfile.skills="sib-form-textarea" widget-mentorProfile.biography="sib-form-textarea" widget-username="sib-form-hidden" + widget-account.slug="sib-form-hidden" + value-account.slug="" class-mentorProfile.organisation='form-label is-dark' widget-mentorProfile.organisation='sib-form-auto-completion' @@ -60,7 +62,7 @@ sib-form#mentor_profile_creation.block_log.block_creat_count( widget-mentorProfile.fields='sib-form-auto-completion' upload-url-account.picture=`${sdn}upload/` - widget-account.picture='cs-form-file-custom' + widget-account.picture='cs-form-profile-picture' class-account.picture='input_photo w_25' class-headline='w_75' diff --git a/src/includes/mentor/profile/detail.pug b/src/includes/mentor/profile/detail.pug index f7b1c3006b68875b890f53e1f15dfaf3036db226..519e4356ec88e287f25edb74141d978397c58e59 100644 --- a/src/includes/mentor/profile/detail.pug +++ b/src/includes/mentor/profile/detail.pug @@ -39,7 +39,7 @@ div.block_list.flex sib-display.bold( fields="" nested-field="resources" - counter-template=`<p>${counter} ${data.resourcesUploadedHere}</p>` + counter-template=`<p>\${counter} ${data.resourcesUploadedHere}</p>` bind-user ) diff --git a/src/includes/mentor/profile/edit.pug b/src/includes/mentor/profile/edit.pug index 80fee452f6e424d6e841165cc8e95dd04d3a1845..2e8c5786caf0df995a742fe86b1df0a5f7b8b249 100644 --- a/src/includes/mentor/profile/edit.pug +++ b/src/includes/mentor/profile/edit.pug @@ -5,12 +5,13 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( fields="account_information(last_name, first_name, mentorProfile.organisation,\ mentorProfile.phone, mentorProfile.languages, mentorProfile.fields),\ about_you(header_about_you, account.picture, mentorProfile.headline, mentorProfile.city, mentorProfile.country,\ - mentorProfile.biography, mentorProfile.skills, resources),\ + 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}` label-header_about_you=`${data.AboutYou}` label-header_social_media=`${data.AboutYou}` @@ -37,7 +38,9 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( widget-mentorProfile.skills="sib-form-textarea" widget-mentorProfile.biography="sib-form-textarea" widget-username="sib-form-hidden" - widget-resources="hidden-widget" + + 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' @@ -51,7 +54,7 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( widget-mentorProfile.fields='sib-form-auto-completion' upload-url-account.picture=`${sdn}upload/` - widget-account.picture='cs-form-file-custom' + widget-account.picture='cs-form-profile-picture' class-account.picture='input_photo w_25' class-headline='w_75' diff --git a/src/index.pug b/src/index.pug index bf405d0df1300b9621d4364bb6e66802bdd7783e..6bfcd89d4a39e3899d6e5a0f55f654d776d728fc 100644 --- a/src/index.pug +++ b/src/index.pug @@ -58,7 +58,7 @@ script(type='module'). ); } user = await store.get(user); - + console.log("Current user", user); if (user && user.mentor_profile) { window.dispatchEvent( new CustomEvent('requestNavigation', { detail: { route: 'mentor-dashboard' } }) diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 5a94336363dbbd7f379c072822c896189184aba6..44906b08f7aad49a17ba3a52a32e07e9c499a67f 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -89,10 +89,13 @@ function linkDatasetToField(element, targetFormName, inputName) { * @param {String} formId - Id of the sumitted form * @param {String} listId - Id of the list to refresh */ -function refreshList(formId, listId) { +async function refreshList(formId, listId) { let form = document.getElementById(formId); - form.addEventListener("save", event => { + form.addEventListener("save", async function() { let list = document.getElementById(listId); + console.log(list, list.component); + let listProxy = await list.component.resource + listProxy.clearCache(); list.dataset.src = list.dataset.src; }); } @@ -597,13 +600,15 @@ jQuery(document).ready(function($) { //Retrieve the current user let userAccountDataSrc = document.getElementById("user-account-picture"); - //Add the current user as reviewer. - linkDatasetToField(userAccountDataSrc, "validation-form", "reviewer"); - linkDatasetToField(userAccountDataSrc, "improvement-dialog-form", "reviewer"); - linkDatasetToField(userAccountDataSrc, "refusal-dialog-form", "reviewer"); - linkDatasetToField(userAccountDataSrc, "change_status_request", "reviewer"); - // linkDatasetToField(userAccountDataSrc, "add-like", "sender"); - // linkDatasetToField(userAccountDataSrc, "add-dislike", "sender"); + if (userAccountDataSrc) { + //Add the current user as reviewer. + linkDatasetToField(userAccountDataSrc, "validation-form", "reviewer"); + linkDatasetToField(userAccountDataSrc, "improvement-dialog-form", "reviewer"); + linkDatasetToField(userAccountDataSrc, "refusal-dialog-form", "reviewer"); + linkDatasetToField(userAccountDataSrc, "change_status_request", "reviewer"); + // linkDatasetToField(userAccountDataSrc, "add-like", "sender"); + // linkDatasetToField(userAccountDataSrc, "add-dislike", "sender"); + } //On form submission, we sometime have to refresh a list. refreshList("resource-creation-form", "resources-history"); @@ -616,14 +621,14 @@ jQuery(document).ready(function($) { refreshList("mentor_profile_creation", "mentor_info"); refreshList("mentor_profile_creation", "mentor_complementary"); refreshList("mentor_profile_creation", "mentor_contact"); - refreshList("mentor_profile_creation", "mentor-account-picture"); + refreshList("mentor_profile_creation", "user-account-picture"); refreshList("entrepreneur_profile_edition", "entrepreneur_info"); refreshList("entrepreneur_profile_edition", "entrepreneur_contact"); refreshList("entrepreneur_profile_edition", "entrepreneur-account-picture"); refreshList("mentor_profile_edition", "mentor_info"); refreshList("mentor_profile_edition", "mentor_complementary"); refreshList("mentor_profile_edition", "mentor_contact"); - refreshList("mentor_profile_edition", "mentor-account-picture"); + refreshList("mentor_profile_edition", "user-account-picture"); refreshList("change_status_request", "request-list"); addProperFilterToSearchComponents("entrepreneur-resource-list"); @@ -668,40 +673,40 @@ jQuery(document).ready(function($) { var formBrokenLink = document.getElementById("report-broken-link-mentor"); fillReportBrokenLinkForm(event, userWhoSubmitReport, formBrokenLink); - // Fill the hidden like-form - document.querySelector('sib-auth').getUser().then(data=> { - let targetFormLike = document.getElementById('add-like'); - targetFormLike.addEventListener("populate", event => { - let resourceField = targetFormLike.querySelector(`input[name="sender"]`); - if (resourceField) { - resourceField.value = JSON.stringify(data); - resourceField.setAttribute( - "value", - JSON.stringify(data) - ); - } - }); - let targetFormDislike = document.getElementById('add-dislike'); - targetFormDislike.addEventListener("populate", event => { - let resourceField = targetFormDislike.querySelector(`input[name="sender"]`); - if (resourceField) { - resourceField.value = JSON.stringify(data); - resourceField.setAttribute( - "value", - JSON.stringify(data) - ); - } - }); + // // Fill the hidden like-form + // document.querySelector('sib-auth').getUser().then(data=> { + // let targetFormLike = document.getElementById('add-like'); + // targetFormLike.addEventListener("populate", event => { + // let resourceField = targetFormLike.querySelector(`input[name="sender"]`); + // if (resourceField) { + // resourceField.value = JSON.stringify(data); + // resourceField.setAttribute( + // "value", + // JSON.stringify(data) + // ); + // } + // }); + // let targetFormDislike = document.getElementById('add-dislike'); + // targetFormDislike.addEventListener("populate", event => { + // let resourceField = targetFormDislike.querySelector(`input[name="sender"]`); + // if (resourceField) { + // resourceField.value = JSON.stringify(data); + // resourceField.setAttribute( + // "value", + // JSON.stringify(data) + // ); + // } + // }); - }) + // }) }); //Init the form file behaviour - initFileUpload() + initFileUpload(); //Manage the accordion in request mentor dashboard. - manageAccordionForRequest() + manageAccordionForRequest(); //Refresh data list on delete resources const deleteButton = document.querySelectorAll("sib-delete"); diff --git a/src/styles/index.scss b/src/styles/index.scss index 0d103781ba0415bc6c54454660513b4c0cabfff6..2a87cb5416e60a2dbc5ca9565f60eec8db59a218 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -595,11 +595,11 @@ div#mentor-resource-validate cs-display-property[name="name"] p, div#entrepreneu } .input_photo label div{ - position: absolute; + // position: absolute; left: 25%; - margin-top: 3rem; + // margin-top: 3rem; } -.input_photo label>input:first-of-type{ +.input_photo input:first-of-type{ width: 10rem; height: 10rem; border-radius: 50%; @@ -608,10 +608,11 @@ div#mentor-resource-validate cs-display-property[name="name"] p, div#entrepreneu cursor: pointer; } -.input_photo label>input[type="file"]{ +.input_photo input[type="file"]{ position: absolute; left: 0; - height: 100px; + width: 10rem; + height: 10rem; opacity: 0; cursor: pointer; } diff --git a/translation/en.yml b/translation/en.yml index 474b04d2f325f124ec620839c733962cf724529f..1cf8583290e0419bcdfdd28d78f346ba01cd7501 100644 --- a/translation/en.yml +++ b/translation/en.yml @@ -76,10 +76,10 @@ ConfirmSendBrokenLink : The submitter of the resource will be advised that this YouRequestHasBeenSubmitted : Your request has been submitted WhatValidationProcess : What is a validation process ? MentorUploadResourceToDatabase: Mentor upload a resource to the database -ResourceSentToQualifiedPeersForValidation : Resource is sent to qualified peers for validation +ResourceSentToQualifiedPeersForValidation: Resource is sent to qualified peers for validation ResourceBecomesAvailableInDatabase: Resource is validated and becomes available in the database -ResourceIsNotValidated: Resource is not validated and improvement is siggested. You get a list of improvement, can edit ans re-load the resource. It goes to validation process again. -ResourceReportedInapropriate: Resource is reported inapropriate. You get a notification with a message from your peer explaning why. +ResourceIsNotValidated: Resource is not validated and improvement is suggested. You get a list of improvement, can edit and re-load the resource. It goes to validation process again. +ResourceReportedInapropriate: Resource is reported inappropriate. You get a notification with a message from your peer explaning why. DeleteResource: Delete a resource AreYouSureDelete: Are you sure you want to delete this resource ? YesSureDelete : Yes I am sure, delete @@ -109,7 +109,7 @@ Send: Send -> SuggestImprovement: Suggest improvement ExplainImprovementRequired: Explain improvement required* ThanksForReview: Thanks for your review -SubmitterWillReceiveReview.: The submitter of the resource will now receive a notification of your review. +SubmitterWillReceiveReview: The submitter of the resource will now receive a notification of your review. HeWillPatch : He will then be able to patch and send back the resource to validation ExplainReasonsRefusal: Explain reasons of refusal* IAmMentor: I am a mentor diff --git a/translation/fr.yml b/translation/fr.yml index 183c08995e3094d760176529fc457ef66072eed8..f250ae8a5fc7dc4a30444fdddb724fa37d7c44c8 100644 --- a/translation/fr.yml +++ b/translation/fr.yml @@ -103,7 +103,7 @@ Send: Envoyer -> SuggestImprovement: Suggérer des améliorations ExplainImprovementRequired: Expliquez les améliorations nécessaires*. ThanksForReview: Merci pour votre avis -SubmitterWillReceiveReview.: L'auteur de la ressource recevra maintenant un avis de votre examen. +SubmitterWillReceiveReview: L'auteur de la ressource recevra maintenant un avis de votre examen. HeWillPatch : Il pourra alors corriger et renvoyer la ressource à la validation. ExplainReasonsRefusal: Expliquez les raisons du refus*. IAmMentor: Je suis un mentor