From ce0384563b03445a4217734beda7551d2dc3ca61 Mon Sep 17 00:00:00 2001
From: gaelle morin <gmorin.dev@gmail.com>
Date: Thu, 8 Apr 2021 16:08:42 +0200
Subject: [PATCH] patch: community-edit

---
 package-lock.json                             |   6 +-
 package.json                                  |   2 +-
 src/locales/en.json                           |  21 ++++
 src/locales/es.json                           |  21 ++++
 src/locales/fr.json                           |  21 ++++
 .../communities/page-community-edit.pug       | 115 +++++++++++++++++-
 .../communities/page-community-profile.pug    |   3 +-
 src/views/partials/widgets.pug                |   2 +
 .../widgets/hubl-communities-edit-email.pug   |   5 +
 .../widgets/hubl-communities-edit-website.pug |   5 +
 10 files changed, 195 insertions(+), 6 deletions(-)
 create mode 100644 src/views/partials/widgets/hubl-communities-edit-email.pug
 create mode 100644 src/views/partials/widgets/hubl-communities-edit-website.pug

diff --git a/package-lock.json b/package-lock.json
index 7b2b879a..25ba5b4b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1159,9 +1159,9 @@
       }
     },
     "@startinblox/hubl-styling-framework": {
-      "version": "1.8.18",
-      "resolved": "https://registry.npmjs.org/@startinblox/hubl-styling-framework/-/hubl-styling-framework-1.8.18.tgz",
-      "integrity": "sha512-GdtuX2AjYwPQfMqU7oCuFfjTS4B9UKdnllYDi9Eg/F6XCcUIdUGSG05TP5yNPkuyI1OZ0Rj/arzhchzLOWqHhA=="
+      "version": "1.8.21",
+      "resolved": "https://registry.npmjs.org/@startinblox/hubl-styling-framework/-/hubl-styling-framework-1.8.21.tgz",
+      "integrity": "sha512-4T0sqL7rqqe8uFmH4f8geigxZ4pIxI1ze3sycM762CQFtM5fXadAI9tl7wwAOQbY15y6xfZfDcPoK0YEjv0v9g=="
     },
     "@types/q": {
       "version": "1.5.4",
diff --git a/package.json b/package.json
index 7046887f..6f67c453 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
     ]
   },
   "dependencies": {
-    "@startinblox/hubl-styling-framework": "^1.8.18",
+    "@startinblox/hubl-styling-framework": "^1.8.21",
     "cross-env": "^7.0.3",
     "fs-extra": "^9.0.1",
     "normalize.css": "^8.0.1",
diff --git a/src/locales/en.json b/src/locales/en.json
index 778dc965..01bdf36b 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -139,6 +139,7 @@
     }
   },
   "communities": {
+    "back": "Back",
     "title": "Administration",
     "menuMobile": "MENU",
     "linkInvite": "Invite a new user",
@@ -168,6 +169,26 @@
       "back": "Back",
       "members": "members",
       "edit": "Edit the page"
+    },
+    "edit": {
+      "labelShortDescription": "Community headline",
+      "labelDescription": "community description",
+      "labelPhone": "Phone",
+      "labelEmail": "Email",
+      "labelWebsite": "Website",
+      "labelTwitter": "Twitter",
+      "labelFacebook": "Facebook",
+      "labelLinkedin": "Linkedin",
+      "labelInstagram": "Instagram",
+      "labelPicture1": "Picture 1",
+      "labelPicture2": "Picture 2",
+      "labelPicture3": "Picture 3",
+      "labelAddressLine1": "Address Line 1",
+      "labelAddressLine2": "Address Line 2",
+      "labelLogo": "Community Logo",
+      "subTitle": "Pictures",
+      "subTitle1": "Address",
+      "buttonSubmit": "Save"
     }
   },
   "project": {
diff --git a/src/locales/es.json b/src/locales/es.json
index 43bd5d28..b3b4939b 100644
--- a/src/locales/es.json
+++ b/src/locales/es.json
@@ -139,6 +139,7 @@
     }
   },
   "communities": {
+    "back": "",
     "title": "Administración",
     "menuMobile": "MENÚ",
     "linkInvite": "Invita a un/a nuevx usuarix",
@@ -168,6 +169,26 @@
       "back": "",
       "members": "",
       "edit": ""
+    },
+    "edit": {
+      "labelShortDescription": "",
+      "labelDescription": "",
+      "labelPhone": "",
+      "labelEmail": "",
+      "labelWebsite": "",
+      "labelTwitter": "Twitter",
+      "labelFacebook": "Facebook",
+      "labelLinkedin": "Linkedin",
+      "labelInstagram": "Instagram",
+      "labelPicture1": "",
+      "labelPicture2": "",
+      "labelPicture3": "",
+      "labelAddressLine1": "",
+      "labelAddressLine2": "",
+      "labelLogo": "",
+      "subTitle": "",
+      "subTitle1": "",
+      "buttonSubmit": "Guardar"
     }
   },
   "project": {
diff --git a/src/locales/fr.json b/src/locales/fr.json
index 75f732ce..64b21a80 100644
--- a/src/locales/fr.json
+++ b/src/locales/fr.json
@@ -139,6 +139,7 @@
     }
   },
   "communities": {
+    "back": "Retour",
     "title": "Administration",
     "menuMobile": "MENU",
     "linkInvite": "Inviter un nouvel utilisateur",
@@ -168,6 +169,26 @@
       "back": "Retour",
       "members": "membres",
       "edit": "Editer la page"
+    },
+    "edit": {
+      "labelShortDescription": "Sous-titre de la communauté",
+      "labelDescription": "Description de la communauté",
+      "labelPhone": "Téléphone",
+      "labelEmail": "Email",
+      "labelWebsite": "Site web",
+      "labelTwitter": "Twitter",
+      "labelFacebook": "Facebook",
+      "labelLinkedin": "Linkedin",
+      "labelInstagram": "Instagram",
+      "labelPicture1": "Photo 1",
+      "labelPicture2": "Photo 2",
+      "labelPicture3": "Photo 3",
+      "labelAddressLine1": "Adresse ligne 1",
+      "labelAddressLine2": "Adresse ligne 2",
+      "labelLogo": "Logo de la communauté",
+      "subTitle": "Photos",
+      "subTitle1": "Adresse",
+      "buttonSubmit": "Enregistrer"
     }
   },
   "project": {
diff --git a/src/views/partials/communities/page-community-edit.pug b/src/views/partials/communities/page-community-edit.pug
index dae03c87..2aee3076 100644
--- a/src/views/partials/communities/page-community-edit.pug
+++ b/src/views/partials/communities/page-community-edit.pug
@@ -1 +1,114 @@
-h1 COMMUEDIT
\ No newline at end of file
+div.bg-color-white
+  solid-ac-checker(permission='acl:Read', bind-resources)
+    div.segment.full.padding-large.border-bottom.border-color-grey
+      div.segment.half.sm-full
+        solid-display.text-color-heading.text-bold.text-xxlarge.text-letter-spacing-large(
+          bind-resources
+          fields='name'         
+        )
+      div.segment.half.sm-hidden.text-right
+        solid-link(class="backlink", bind-resources, next=`${component.route}-profile` data-trans="communities.back")
+
+  div.segment.full.padding-large.whitespace-normal
+
+    solid-ac-checker(permission='acl:Write', bind-resources)
+      div.loader.loader-top(id=`loader-${component.route}-edit`)
+        div
+        div
+        div
+        div
+      
+      solid-form.form(
+        bind-resources
+
+        fields='profile.shortDescription, profile.description, segment(logo), profile.website, profile.email, profile.phone, profile.tweeter, profile.facebook, profile.linkedin, segment1(profile.instagram)'
+
+        label-profile.shortDescription=''
+        label-profile.description=''
+        label-logo=''
+        label-profile.website=''
+        label-profile.email=''
+        label-profile.phone=''
+        label-profile.tweeter=''
+        label-profile.facebook=''
+        label-profile.linkedin=''
+        label-profile.instagram=''
+
+        class-profile.shortDescription='segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-profile.description='segment margin-bottom-medium full text-small text-semibold text-uppercase text-color-heading'
+
+        class-segment='segment full'
+        class-logo='segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-profile.website='segment margin-bottom-medium third sm-full padding-right-small sm-padding-none'
+        class-profile.email='segment margin-bottom-medium third sm-full padding-right-small padding-left-small sm-padding-none'
+        class-profile.phone='segment margin-bottom-medium third sm-full padding-left-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+
+        class-profile.tweeter='segment margin-bottom-medium third sm-full padding-right-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-profile.facebook='segment margin-bottom-medium third sm-full padding-right-small padding-left-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-profile.linkedin='segment margin-bottom-medium third sm-full padding-left-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-segment1='segment full'
+        class-profile.instagram='segment margin-bottom-medium third sm-full padding-right-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        
+        widget-profile.description='solid-form-richtext-label'
+        widget-profile.email='hubl-communities-edit-email'
+        widget-profile.website='hubl-communities-edit-website'
+        upload-url-logo
+
+        submit-button=''
+        submit-widget="button"
+        next=`${component.route}-profile`
+
+        data-trans='label-logo=communities.edit.labelLogo;label-profile.shortDescription=communities.edit.labelShortDescription;label-profile.description=communities.edit.labelDescription;label-profile.phone=communities.edit.labelPhone;label-profile.tweeter=communities.edit.labelTwitter;label-profile.facebook=communities.edit.labelFacebook;label-profile.linkedin=communities.edit.labelLinkedin;label-profile.instagram=communities.edit.labelInstagram;submit-button=communities.edit.buttonSubmit'
+      )
+
+      h3.segment.full.padding-bottom-small.border-bottom.border-color-grey.text-color-heading.text-bold.text-letter-spacing-large(data-trans='communities.edit.subTitle')
+
+      solid-form.form(
+        bind-resources
+
+        fields='profile.picture1, profile.picture2, profile.picture3'
+
+        upload-url-profile.picture1
+        upload-url-profile.picture2
+        upload-url-profile.picture3
+
+        label-profile.picture1=''
+        label-profile.picture2=''
+        label-profile.picture3=''
+
+        class-profile.picture1='segment margin-bottom-medium third sm-full padding-right-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-profile.picture2='segment margin-bottom-medium third sm-full padding-right-small padding-left-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-profile.picture3='segment margin-bottom-medium third sm-full padding-left-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+
+        submit-button=''
+        submit-widget="button"
+        next=`${component.route}-profile`
+
+        data-trans='label-profile.picture1=communities.edit.labelPicture1;label-profile.picture2=communities.edit.labelPicture2;label-profile.picture3=communities.edit.labelPicture3;submit-button=communities.edit.buttonSubmit'
+      )
+
+      h3.segment.full.padding-bottom-small.border-bottom.border-color-grey.text-color-heading.text-bold.text-letter-spacing-large(data-trans='communities.edit.subTitle1')
+
+      solid-table.form(
+        bind-resources
+        nested-fields='addresses'
+        fields='address_line1, address_line2'
+
+        editable-address_line1
+        editable-address_line2
+
+        label-address_line1=''
+        label-address_line2=''
+
+        widget-address_line1='solid-form-label-text'
+        widget-address_line2='solid-form-label-text'
+
+        class-address_line1='segment margin-bottom-medium half sm-full padding-right-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+        class-address_line2='segment margin-bottom-medium half sm-full padding-right-small padding-left-small sm-padding-none text-small text-semibold text-uppercase text-color-heading'
+
+        submit-button=''
+        submit-widget="button"
+        next=`${component.route}-profile`
+
+        data-trans='label-addresses.address_line1=communities.edit.labelAddressLine1;label-addresses.address_line2=communities.edit.labelAddressLine2'     
+      )
diff --git a/src/views/partials/communities/page-community-profile.pug b/src/views/partials/communities/page-community-profile.pug
index 9e49a468..62cc4bc1 100644
--- a/src/views/partials/communities/page-community-profile.pug
+++ b/src/views/partials/communities/page-community-profile.pug
@@ -1,6 +1,6 @@
 div.community-profile.padding-medium.sm-padding-none
   div.segment.full.sm-hidden.text-right
-    solid-link.backlink.text-xlarge.line-xlarge.margin-right-xxsmall(next=`${component.route}-directory` data-trans="communities.profile.back")
+    solid-link.backlink.text-xlarge.line-xlarge.margin-right-xxsmall(next=`${component.route}-directory` data-trans="communities.back")
 
   div.segment.block.shadow.bg-color-white.margin-right-xxsmall.margin-top-large.margin-left-xxsmall.sm-margin-none
 
@@ -46,6 +46,7 @@ div.community-profile.padding-medium.sm-padding-none
       class-profile.picture3="communities-profile-picture segment third"
 
       widget-logo="hubl-communities-profile-logo"
+      widget-profile.description="solid-display-richtext-label"
       widget-profile.tweeter="hubl-communities-profile-twitter"
       widget-profile.facebook="hubl-communities-profile-facebook"
       widget-profile.linkedin="hubl-communities-profile-linkedin"
diff --git a/src/views/partials/widgets.pug b/src/views/partials/widgets.pug
index a95c9f63..9ae42b06 100644
--- a/src/views/partials/widgets.pug
+++ b/src/views/partials/widgets.pug
@@ -21,6 +21,8 @@ include widgets/hubl-circle-owner.pug
 include widgets/hubl-circle-team-contact.pug
 include widgets/hubl-circle-user-admin.pug
 include widgets/hubl-communities-counter-alternate.pug
+include widgets/hubl-communities-edit-email.pug
+include widgets/hubl-communities-edit-website.pug
 include widgets/hubl-communities-logo.pug
 include widgets/hubl-communities-profile-address.pug
 include widgets/hubl-communities-profile-email.pug
diff --git a/src/views/partials/widgets/hubl-communities-edit-email.pug b/src/views/partials/widgets/hubl-communities-edit-email.pug
new file mode 100644
index 00000000..529157a3
--- /dev/null
+++ b/src/views/partials/widgets/hubl-communities-edit-email.pug
@@ -0,0 +1,5 @@
+if componentSet.has('communities')
+  solid-widget(name='hubl-communities-edit-email')
+    template
+      label(class="text-small text-semibold text-uppercase text-color-heading" data-trans="communities.edit.labelEmail")
+      input(type="email" label="communities.edit.labelEmail" name="profile.email" required value="\${value}" data-holder)
diff --git a/src/views/partials/widgets/hubl-communities-edit-website.pug b/src/views/partials/widgets/hubl-communities-edit-website.pug
new file mode 100644
index 00000000..f7edbc1b
--- /dev/null
+++ b/src/views/partials/widgets/hubl-communities-edit-website.pug
@@ -0,0 +1,5 @@
+if componentSet.has('communities')
+  solid-widget(name='hubl-communities-edit-website')
+    template
+      label(class="text-small text-semibold text-uppercase text-color-heading" data-trans='communities.edit.labelWebsite')
+      input(type="url" label="communities.edit.labelWebsite" name="profile.website" value="\${value}" data-holder)
-- 
GitLab