From 7eff652d5d2ad9e76ef3afa436e6fbe749410683 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Mon, 3 Feb 2020 14:39:14 +0100
Subject: [PATCH 1/5] Adapted Sib App for ETUC & more flexible way to handle
 optional components

---
 README.md                          |  45 +++------
 config.sample.federated.json       |  23 +++++
 config.sample.json                 |   8 +-
 src/dependencies.pug               |  10 +-
 src/get_config.pug                 |   2 +-
 src/header.pug                     |   2 +-
 src/index.pug                      |  17 ++--
 src/menu-left.pug                  | 150 +++++++++++++++--------------
 src/page-admin-circles-create.pug  |   2 +-
 src/page-admin-circles.pug         |   2 +-
 src/page-admin-projects-create.pug |   8 +-
 src/page-admin-projects.pug        |   2 +-
 src/page-admin-users.pug           |   2 +-
 src/page-admin.pug                 |  24 +++--
 src/page-circle-edit.pug           |   4 +-
 src/page-job-offer-create.pug      |   4 +-
 src/page-job-offer-edit.pug        |   2 +-
 src/page-job-offers.pug            |   4 +-
 src/page-members-directory.pug     |   6 +-
 src/page-project-edit.pug          |   4 +-
 src/page-user-profile.pug          |   2 +-
 21 files changed, 170 insertions(+), 153 deletions(-)
 create mode 100644 config.sample.federated.json

diff --git a/README.md b/README.md
index 72a0e09c..6fc35fe4 100644
--- a/README.md
+++ b/README.md
@@ -10,20 +10,18 @@ These instructions will get you a copy of the project up and running on your loc
 
 To install SiB App, you'll need:
 
-* A SIB server with the appropriate modules
+* A SIB server (djangoldp>=0.6.32) with the appropriate modules
 * A Prosody Server (with [appropriate modules](https://git.happy-dev.fr/startinblox/prosody/custom-prosody-modules/)
 * A SMTP Server (optional)
 * NodeJS on your machine
 
 Before diving in you have to check your SIB server supports the following LDP packages:
 
-* djangoldp_account: 0.2.14
-* djangoldp_circle: 0.1.15
-* djangoldp_joboffer: 0.1.1
-* djangoldp_notification: 0.1.4
+* djangoldp_account: 0.2.24
+* djangoldp_circle: 0.1.22
+* djangoldp_notification: 0.1.7
 * djangoldp_profile: 0.1.4
-* djangoldp_project: 0.1.12
-* djangoldp_skill: 0.1.1
+* djangoldp_project: 0.1.26
 * oidc_provider: 'git+https://github.com/jblemee/django-oidc-provider.git@develop'
 
 Those packages are given with the last stable version tested.
@@ -40,16 +38,17 @@ Get the code of the SIB app on your machine:
 git clone ...
 ```
 
-Then create a `config.json` with all the the capabilities the SIB App requires. Which are:
+Then create a `config.json` based on your needs. [The documentation](https://git.happy-dev.fr/startinblox/devops/doc/wikis/build_sib_application) explains the details of this file but for convienence a `config.sample.json` exists in the source.
 
-* circles
-* groups
-* joboffers
-* projects
-* skills
-* users
+Current Sib App capabilities:
 
-[The documentation](https://git.happy-dev.fr/startinblox/devops/doc/wikis/build_sib_application) explains the details of this file but for convienence a `config.sample.json` exists in the source.
+| Component | Required server packages | Required endpoints |
+| - | - | - |
+| Base | `djangoldp_account`, `djangoldp_profile`, `djangoldp_notification`, `oidc_provider` | `users` |
+| Circles | `djangoldp_circle` | `circles` |
+| Projects | `djangoldp_project` | `projects`, `customers` |
+
+Federated Sib App needs to use `config.sample.federated.json` example.
 
 Then build your new SIB App:
 
@@ -70,19 +69,3 @@ npm run watch
 ## Built With
 
 * [Sib-Core](https://git.happy-dev.fr/startinblox/framework/sib-core/) - An awesome new framework!
-
-<!---
-## Contributing
-
-We may add a `CONTRIBUTING.md`
-
-## License
-
-We may add a `LICENSE.md`
-
-## Acknowledgments
-
-* Maybe some thanks too
-* Inspiration
-* etc
---->
diff --git a/config.sample.federated.json b/config.sample.federated.json
new file mode 100644
index 00000000..4587b87c
--- /dev/null
+++ b/config.sample.federated.json
@@ -0,0 +1,23 @@
+{
+  "xmpp": "https://jabber.happy-dev.fr/http-bind/",
+  "authority": "http://localhost:8000/",
+  "clientName": "Sib App",
+  "clientLogo": "/images/logo.png",
+  "clientLogoHeight": "32px",
+  "clientCSS": "/path/to/custom.css",
+  "authorityName": "djangoldp-server-name",
+  "endpoints": {
+    "get": {
+      "circles": "http://localhost:8000/circles/",
+      "projects": "http://localhost:8000/projects/",
+      "customers": "http://localhost:8000/customers/",
+      "users": "http://localhost:8000/users/"
+    },
+    "post": {
+      "circles": "http://localhost:8000/circles/",
+      "projects": "http://localhost:8000/projects/",
+      "customers": "http://localhost:8000/customers/",
+      "users": "http://localhost:8000/users/"
+    }
+  }
+}
diff --git a/config.sample.json b/config.sample.json
index c506d053..916b99ec 100644
--- a/config.sample.json
+++ b/config.sample.json
@@ -1,17 +1,15 @@
 {
   "xmpp": "https://jabber.happy-dev.fr/http-bind/",
   "authority": "http://localhost:8000/",
+  "clientName": "Sib App",
   "clientLogo": "/images/logo.png",
+  "clientLogoHeight": "32px",
+  "clientCSS": "/path/to/custom.css",
   "authorityName": "djangoldp-server-name",
-  "clientName": "Sib App",
   "endpoints": {
-    "businessproviders": "http://localhost:8000/businessproviders/",
     "circles": "http://localhost:8000/circles/",
-    "groups": "http://localhost:8000/groups/",
-    "joboffers": "http://localhost:8000/job-offers/",
     "projects": "http://localhost:8000/projects/",
     "customers": "http://localhost:8000/customers/",
-    "skills": "http://localhost:8000/skills/",
     "users": "http://localhost:8000/users/"
   }
 }
diff --git a/src/dependencies.pug b/src/dependencies.pug
index d2927abe..97684103 100644
--- a/src/dependencies.pug
+++ b/src/dependencies.pug
@@ -1,11 +1,6 @@
 script(type="module" src="https://unpkg.com/@startinblox/oidc@0.8")
 script(src="/scripts/index.js")
 
-//- Stylesheets
-link(rel='stylesheet', href='/styles/index.css')
-link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700&amp;subset=latin-ext')
-link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i')
-
 //- local
 //- script(type="module" src="/lib/sib-router/src/index.js")
 //- script(type="module" src="/lib/sib-chat/sib-chat.js")
@@ -23,6 +18,11 @@ script(type="module" src="https://unpkg.com/@startinblox/component-notifications
 //- script(type="module" src="https://unpkg.com/@startinblox/component-directory@0.3")
 //- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@0.3")
 
+//- Stylesheets
+link(rel='stylesheet', href='/styles/index.css')
+link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700&amp;subset=latin-ext')
+link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i')
+
 //- Context - Fix for LDFlex
 script(data-default-context, type="application/ld+json")
     | {
diff --git a/src/get_config.pug b/src/get_config.pug
index 5a04ca78..c74801f6 100644
--- a/src/get_config.pug
+++ b/src/get_config.pug
@@ -2,4 +2,4 @@
   var __env = locals[process.env.ENV]
   for(k in __env){
     eval(`var ${k} = __env[${JSON.stringify(k)}]`);
-  }
\ No newline at end of file
+  }
diff --git a/src/header.pug b/src/header.pug
index ff59b10f..a198a387 100644
--- a/src/header.pug
+++ b/src/header.pug
@@ -31,7 +31,7 @@ button.notLoggedIn.mobile-menu-icon.icon-menu#toggleMainMenu
 sib-auth
   sib-auth-provider(
     data-authority=`${authority}`
-    data-id=`${authorityName || "paris"}`
+    data-id=`${authorityName || "authority"}`
     data-client-name=`${clientName || "SIB App"}`
   )
 
diff --git a/src/index.pug b/src/index.pug
index e5f8f0f1..7fc773ca 100644
--- a/src/index.pug
+++ b/src/index.pug
@@ -8,6 +8,8 @@ html(lang="en")
     meta(http-equiv="X-UA-Compatible", content="ie=edge")
     link(rel="icon" type="image/png" href="/images/favicon.png")
     include dependencies.pug
+    if endpoints.clientCSS
+      link(rel='stylesheet', href=`${endpoints.clientCSS}`)
   body
     header#header(role='banner')
       include header.pug
@@ -29,14 +31,17 @@ html(lang="en")
         //-   sib-link(class="backlink", next="job-offers") Back
         //-   include page-job-offer-edit.pug
 
-        #project(hidden).with-sidebar
-          include page-project.pug
+        if endpoints.projects || (endpoints.get && endpoints.get.projects)
+          #project(hidden).with-sidebar
+            include page-project.pug
 
-        #circle(hidden).with-sidebar
-          include page-circle.pug
+        if endpoints.circles || (endpoints.get && endpoints.get.circles)
+          #circle(hidden).with-sidebar
+            include page-circle.pug
 
-        #messages(hidden).with-sidebar
-          include page-messages.pug
+        if endpoints.users || (endpoints.get && endpoints.get.users)
+          #messages(hidden).with-sidebar
+            include page-messages.pug
 
         #admin(hidden).with-sidebar
           include page-admin.pug
diff --git a/src/menu-left.pug b/src/menu-left.pug
index cdf6b9dc..5923acd9 100644
--- a/src/menu-left.pug
+++ b/src/menu-left.pug
@@ -19,79 +19,83 @@ nav#main__menu.jsLeftMenu
     //- sib-route(name='job-offer-create', hidden)
     //- sib-route(name='job-offer-edit', use-id, hidden)
     //- div.divider
-    //- div
-    //-   div.menu
-    //-     div.menu-chevron
-    //-       sib-link(next='admin-project-list')
-    //-         div.menu-icon.icon-arrow-right
-    //-     div.menu-label Projects
-    //-     div.menu-icon.icon-folder-alt
-    //-   sib-route(name='project', rdf-type='hd:project', use-id='', hidden)
-    //-   div.sub-menu.menu-notification
-    //-     sib-display.project-tab(
-    //-       data-src=`${endpoints.projects}`
-    //-       fields='project(customer.name, name), badge'
-    //-       class-customer.name='project-customer'
-    //-       class-name='project-name'
-    //-       empty-widget='hd-create'
-    //-       empty-value='project'
-    //-       search-fields='team'
-    //-       search-widget-team='sib-form-hidden'
-    //-       search-value-team='-'
-    //-       hd-inherit-user-id='search-value-team'
-    //-       hd-inherit-widgets
-    //-       widget-badge='hd-counter'
-    //-       action-badge='badge'
-    //-       order-by='customer.name'
-    //-       next='project'
-    //-     )
-    //- div.divider
-    div
-      div.menu
-        div.menu-chevron
-          sib-link(next='admin-circle-list')
-            div.menu-icon.icon-arrow-right
-        div.menu-label Circles
-        div.menu-icon.icon-folder-alt
-      sib-route(name='circle', rdf-type='hd:circle', use-id='', hidden)
-      div.sub-menu.menu-notification
-        sib-widget(name='menu-circle-fix-url')
-          template
-            sib-display(
-              data-src='${value}'
-              fields='name, badge'
-              value-badge='${value}'
-              widget-badge='hd-counter'
-              widget-name='sib-display-div'
-            )
-        sib-display(
-          bind-user
-          nested-field='circles'
-          fields='circle'
-          empty-widget='hd-create'
-          empty-value='circle'
-          widget-circle='menu-circle-fix-url'
-          order-by='circle.name'
-          next='circle'
-        )
-    div.divider
-    div.menu-wrapper
-      div.menu
-        div.menu-chevron
-          div.menu-icon.icon-arrow-up
-        div.menu-label Chat
-        div.menu-icon.icon-envelope-letter
-      sib-route(name='messages', rdf-type='foaf:user', use-id='', hidden)
-      div.sub-menu.menu-notification
-        sib-display.nosub(
-          data-src=`${endpoints.users}`
-          fields='username, badge'
-          widget-username='sib-display-div'
-          widget-badge='hd-counter'
-          action-badge='badge'
-          order-by='username'
-          next='messages'
-        )
+    if endpoints.projects || (endpoints.get && endpoints.get.projects)
+      div
+        div.menu
+          div.menu-chevron
+            sib-link(next='admin-project-list')
+              div.menu-icon.icon-arrow-right
+          div.menu-label Projects
+          div.menu-icon.icon-folder-alt
+        sib-route(name='project', rdf-type='hd:project', use-id='', hidden)
+        div.sub-menu.menu-notification
+          sib-display.project-tab(
+            data-src=`${endpoints.projects || (endpoints.get && endpoints.get.projects)}`
+            fields='project(customer.name, name), badge'
+            class-customer.name='project-customer'
+            class-name='project-name'
+            empty-widget='hd-create'
+            empty-value='project'
+            search-fields='team'
+            search-widget-team='sib-form-hidden'
+            search-value-team='-'
+            hd-inherit-user-id='search-value-team'
+            hd-inherit-widgets
+            widget-badge='hd-counter'
+            action-badge='badge'
+            order-by='customer.name'
+            next='project'
+          )
+      div.divider
+    if endpoints.circles || (endpoints.get && endpoints.get.circles)
+      div
+        div.menu
+          div.menu-chevron
+            sib-link(next='admin-circle-list')
+              div.menu-icon.icon-arrow-right
+          div.menu-label Circles
+          div.menu-icon.icon-folder-alt
+        sib-route(name='circle', rdf-type='hd:circle', use-id='', hidden)
+        div.sub-menu.menu-notification
+          sib-widget(name='menu-circle-fix-url')
+            template
+              sib-display(
+                data-src='${value}'
+                fields='name, badge'
+                value-badge='${value}'
+                widget-badge='hd-counter'
+                widget-name='sib-display-div'
+              )
+          sib-display(
+            bind-user
+            nested-field='circles'
+            fields='circle'
+            empty-widget='hd-create'
+            empty-value='circle'
+            widget-circle='menu-circle-fix-url'
+            order-by='circle.name'
+            next='circle'
+          )
+      div.divider
+    if endpoints.users || (endpoints.get && endpoints.get.users)
+      div.menu-wrapper
+        div.menu
+          div.menu-chevron
+            div.menu-icon.icon-arrow-up
+          div.menu-label Chat
+          div.menu-icon.icon-envelope-letter
+        sib-route(name='messages', rdf-type='foaf:user', use-id='', hidden)
+        div.sub-menu.menu-notification
+          sib-display.nosub(
+            data-src=`${endpoints.users || (endpoints.get && endpoints.get.users)}`
+            fields='username, badge'
+            widget-username='sib-display-div'
+            widget-badge='hd-counter'
+            action-badge='badge'
+            order-by='username'
+            next='messages'
+          )
+      div.divider
 
     sib-route(name='admin', hidden)
     //- div.divider
diff --git a/src/page-admin-circles-create.pug b/src/page-admin-circles-create.pug
index ef8661d3..500b7516 100644
--- a/src/page-admin-circles-create.pug
+++ b/src/page-admin-circles-create.pug
@@ -6,7 +6,7 @@ div.content-box__info
   p.center Here you can create a new circle according to your interests, what you want to share, etc.
 
   sib-form.block(
-    data-src=`${endpoints.circles}`
+    data-src=`${endpoints.circles || endpoints.post.circles}`
 
     fields='name, description'
 
diff --git a/src/page-admin-circles.pug b/src/page-admin-circles.pug
index 3d202b5f..20304b39 100644
--- a/src/page-admin-circles.pug
+++ b/src/page-admin-circles.pug
@@ -85,7 +85,7 @@
         sib-display(
           class='table-body'
 
-          data-src=`${endpoints.circles}`
+          data-src=`${endpoints.circles || endpoints.get.circles}`
           fields='name, owner, buttons'
 
           class-name='w33 cell border cell-with-name'
diff --git a/src/page-admin-projects-create.pug b/src/page-admin-projects-create.pug
index 3ea8961c..6875d118 100644
--- a/src/page-admin-projects-create.pug
+++ b/src/page-admin-projects-create.pug
@@ -10,7 +10,7 @@ div.content-box__info
       sib-form(
         data-holder
         fields='user, project'
-        range-user=`${endpoints.users}`
+        range-user=`${endpoints.users || endpoints.get.users}`
         value-project='${src}'
         widget-project='sib-form-hidden'
         naked
@@ -19,7 +19,7 @@ div.content-box__info
   h1.centered New project
 
   sib-form.block(
-    data-src=`${endpoints.projects}`
+    data-src=`${endpoints.projects || endpoints.post.projects}`
     
     fields='line-1(customer, name), line-3(project.description), fieldset-fee, line-4(businessProvider.name, businessProvider.fee), fieldset-captain, line-10(captain)'
 
@@ -33,7 +33,7 @@ div.content-box__info
 
 		label-customer='Customer'
     class-customer='member-select form-label is-light is-half-width'
-    range-customer=`${endpoints.customers}`
+    range-customer=`${endpoints.customers || endpoints.get.customers}`
     widget-customer='sib-form-auto-completion'
 
 		label-name='Project\'s name*'
@@ -49,7 +49,7 @@ div.content-box__info
 		label-businessProvider.fee='Amount of the contribution'
     class-businessProvider.fee='form-label is-light is-half-width'
 
-    range-captain=`${endpoints.users}`
+    range-captain=`${endpoints.users || endpoints.get.users}`
     class-captain='member-select form-label is-light is-half-width'
     widget-captain='sib-form-auto-completion'
 
diff --git a/src/page-admin-projects.pug b/src/page-admin-projects.pug
index f9866f8e..8e2a9153 100644
--- a/src/page-admin-projects.pug
+++ b/src/page-admin-projects.pug
@@ -70,7 +70,7 @@
         sib-display(
           class='table-body'
 
-          data-src=`${endpoints.projects}`
+          data-src=`${endpoints.projects || endpoints.get.projects}`
           fields='name, members, captain, buttons'
 
           class-name='w25 cell border cell-with-name hashtag'
diff --git a/src/page-admin-users.pug b/src/page-admin-users.pug
index 7085fe74..031c3582 100644
--- a/src/page-admin-users.pug
+++ b/src/page-admin-users.pug
@@ -9,7 +9,7 @@
   #admin-users-list(hidden)
     div.content-box__info
       sib-display.block(
-        data-src=`${endpoints.users}`
+        data-src=`${endpoints.users || endpoints.get.users}`
         fields="account.picture, name, username, email, groups"
         multiple-groups=""
       )
diff --git a/src/page-admin.pug b/src/page-admin.pug
index 049e6ca0..c396fd4d 100644
--- a/src/page-admin.pug
+++ b/src/page-admin.pug
@@ -1,8 +1,10 @@
 .views-container.sidebar-is-closed
-  #admin-circles(hidden)
-    include page-admin-circles.pug
-  #admin-projects(hidden)
-    include page-admin-projects.pug
+  if endpoints.circles || (endpoints.get && endpoints.get.circles)
+    #admin-circles(hidden)
+      include page-admin-circles.pug
+  if endpoints.projects || (endpoints.get && endpoints.get.projects)
+    #admin-projects(hidden)
+      include page-admin-projects.pug
   //- #admin-users(hidden)
     include page-admin-users.pug
 nav.jsRightMenu(role='navigation')
@@ -13,9 +15,11 @@ nav.jsRightMenu(role='navigation')
       //- sib-route(name='admin-users')
         li
           a Users
-      sib-route(name='admin-circles')
-        li
-          a Circles
-      //- sib-route(name='admin-projects')
-      //-   li
-      //-     a Projects
+      if endpoints.circles || (endpoints.get && endpoints.get.circles)
+        sib-route(name='admin-circles')
+          li
+            a Circles
+      if endpoints.projects || (endpoints.get && endpoints.get.projects)
+        sib-route(name='admin-projects')
+          li
+            a Projects
diff --git a/src/page-circle-edit.pug b/src/page-circle-edit.pug
index f4f0c6a2..266781be 100644
--- a/src/page-circle-edit.pug
+++ b/src/page-circle-edit.pug
@@ -45,7 +45,7 @@ div.content-box__info
       bind-resources
 
       fields='block-circle__info(name, owner), description'
-      range-owner=`${endpoints.users}`
+      range-owner=`${endpoints.users || endpoints.get.users}`
 
       label-owner='owner'
       label-description='circle subtitle'
@@ -69,7 +69,7 @@ div.content-box__info
       bind-resources 
       nested-field='members'
       fields='user'
-      range-user=`${endpoints.users}`
+      range-user=`${endpoints.users || endpoints.get.users}`
 
       class-user='team form-label is-dark'
       label-user=''
diff --git a/src/page-job-offer-create.pug b/src/page-job-offer-create.pug
index dcf9bec4..c0153066 100644
--- a/src/page-job-offer-create.pug
+++ b/src/page-job-offer-create.pug
@@ -11,8 +11,8 @@
       p Be specific and exhaustive to avoid answering too many questions later. Indicate what is the best way to fill the offer, the prerequisites...'
   
   sib-form.block(
-    data-src=`${endpoints.joboffers}`
-    range-skills=`${endpoints.skills}`
+    data-src=`${endpoints.joboffers || endpoints.post.joboffers}`
+    range-skills=`${endpoints.skills || endpoints.get.skills}`
 
     fields='title, title-text, description, description-text, skills, closingDate'
 
diff --git a/src/page-job-offer-edit.pug b/src/page-job-offer-edit.pug
index 619a3ddd..e13fa5c5 100644
--- a/src/page-job-offer-edit.pug
+++ b/src/page-job-offer-edit.pug
@@ -3,7 +3,7 @@
   
   sib-form.block(
     bind-resources
-    range-skills=`${endpoints.skills}`
+    range-skills=`${endpoints.skills || endpoints.get.skills}`
 
     fields='title, description, skills, closingDate'
 
diff --git a/src/page-job-offers.pug b/src/page-job-offers.pug
index b42a50ab..1772d1fb 100644
--- a/src/page-job-offers.pug
+++ b/src/page-job-offers.pug
@@ -1,7 +1,7 @@
 .job-offers__container
   sib-job-board(
-    data-src=`${endpoints.joboffers}`,
-    range-skills=`${endpoints.skills}`
+    data-src=`${endpoints.joboffers || endpoints.get.joboffers}`,
+    range-skills=`${endpoints.skills || endpoints.get.skills}`
   )
 
   div.job-offers__newoffer
diff --git a/src/page-members-directory.pug b/src/page-members-directory.pug
index 8ec3a33d..7b835cf4 100644
--- a/src/page-members-directory.pug
+++ b/src/page-members-directory.pug
@@ -1,6 +1,6 @@
 sib-directory(
-  data-src=`${endpoints.users}`,
-  range-groups=`${endpoints.groups}`,
-  range-skills=`${endpoints.skills}`
+  data-src=`${endpoints.users || endpoints.get.users}`,
+  range-groups=`${endpoints.groups || endpoints.get.groups}`,
+  range-skills=`${endpoints.skills || endpoints.get.skills}`
 )
 
diff --git a/src/page-project-edit.pug b/src/page-project-edit.pug
index 2a5be6c7..63f9938f 100644
--- a/src/page-project-edit.pug
+++ b/src/page-project-edit.pug
@@ -21,7 +21,7 @@ div.content-box__info
     class-description='form-label is-light is-full-width'
     label-fieldset-info=''
     label-customer='Customer'
-    range-customer=`${endpoints.customers}`
+    range-customer=`${endpoints.customers || endpoints.get.customers}`
     label-name='Project\'s name*'
     label-description='Project description'
     widget-fieldset-info='hd-fieldset-title'
@@ -44,7 +44,7 @@ div.content-box__info
     bind-resources 
     nested-field='members'
     fields='user'
-    range-user=`${endpoints.users}`
+    range-user=`${endpoints.users || endpoints.get.users}`
 
     class-user='team form-label is-dark'
     label-user=''
diff --git a/src/page-user-profile.pug b/src/page-user-profile.pug
index a5634046..9cc8d287 100644
--- a/src/page-user-profile.pug
+++ b/src/page-user-profile.pug
@@ -55,7 +55,7 @@ include templates/template-groups.pug
 
     sib-form(
       bind-user=''
-      range-skills=`${endpoints.skills}`
+      range-skills=`${endpoints.skills || endpoints.get.skills}`
       fields='skills'
 
       class-skills='form-label is-dark'
-- 
GitLab


From 0f43e021f29df467e56a7721fd5e4bba79e1b33a Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Mon, 3 Feb 2020 14:47:58 +0100
Subject: [PATCH 2/5] fix: no endpoint for clientCSS

---
 src/index.pug | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/index.pug b/src/index.pug
index 7fc773ca..adb0716d 100644
--- a/src/index.pug
+++ b/src/index.pug
@@ -8,8 +8,8 @@ html(lang="en")
     meta(http-equiv="X-UA-Compatible", content="ie=edge")
     link(rel="icon" type="image/png" href="/images/favicon.png")
     include dependencies.pug
-    if endpoints.clientCSS
-      link(rel='stylesheet', href=`${endpoints.clientCSS}`)
+    if clientCSS
+      link(rel='stylesheet', href=`${clientCSS}`)
   body
     header#header(role='banner')
       include header.pug
-- 
GitLab


From d5e19c469ce1e9f2531ea24a1b1b15659768a657 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Mon, 3 Feb 2020 15:43:16 +0100
Subject: [PATCH 3/5] update: add events component

---
 README.md                    | 1 +
 config.sample.federated.json | 2 ++
 config.sample.json           | 1 +
 src/dependencies.pug         | 2 ++
 src/index.pug                | 4 ++++
 src/menu-left.pug            | 5 +++++
 src/page-events.pug          | 2 ++
 7 files changed, 17 insertions(+)
 create mode 100644 src/page-events.pug

diff --git a/README.md b/README.md
index 6fc35fe4..176c48eb 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,7 @@ Current Sib App capabilities:
 | Base | `djangoldp_account`, `djangoldp_profile`, `djangoldp_notification`, `oidc_provider` | `users` |
 | Circles | `djangoldp_circle` | `circles` |
 | Projects | `djangoldp_project` | `projects`, `customers` |
+| Events | `djangoldp_event` | `events` |
 
 Federated Sib App needs to use `config.sample.federated.json` example.
 
diff --git a/config.sample.federated.json b/config.sample.federated.json
index 4587b87c..9297558a 100644
--- a/config.sample.federated.json
+++ b/config.sample.federated.json
@@ -11,12 +11,14 @@
       "circles": "http://localhost:8000/circles/",
       "projects": "http://localhost:8000/projects/",
       "customers": "http://localhost:8000/customers/",
+      "events": "http://localhost:8000/events/",
       "users": "http://localhost:8000/users/"
     },
     "post": {
       "circles": "http://localhost:8000/circles/",
       "projects": "http://localhost:8000/projects/",
       "customers": "http://localhost:8000/customers/",
+      "events": "http://localhost:8000/events/",
       "users": "http://localhost:8000/users/"
     }
   }
diff --git a/config.sample.json b/config.sample.json
index 916b99ec..76cff706 100644
--- a/config.sample.json
+++ b/config.sample.json
@@ -10,6 +10,7 @@
     "circles": "http://localhost:8000/circles/",
     "projects": "http://localhost:8000/projects/",
     "customers": "http://localhost:8000/customers/",
+    "events": "http://localhost:8000/events/",
     "users": "http://localhost:8000/users/"
   }
 }
diff --git a/src/dependencies.pug b/src/dependencies.pug
index 97684103..95d17f8e 100644
--- a/src/dependencies.pug
+++ b/src/dependencies.pug
@@ -5,6 +5,7 @@ script(src="/scripts/index.js")
 //- script(type="module" src="/lib/sib-router/src/index.js")
 //- script(type="module" src="/lib/sib-chat/sib-chat.js")
 //- script(type="module" src="/lib/sib-notifications/sib-notifications.js")
+//- script(type="module" src="/lib/sib-event/sib-event.js")
 //- script(type="module" src="/lib/sib-conversation/sib-conversation.js")
 //- script(type="module" src="/lib/sib-directory/sib-directory.js")
 //- script(type="module" src="/lib/sib-job-board/sib-job-board.js")
@@ -14,6 +15,7 @@ script(type="module" src="https://unpkg.com/@startinblox/core@0.9")
 script(type="module" src="https://unpkg.com/@startinblox/router@0.7")
 script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.4")
 script(type="module" src="https://unpkg.com/@startinblox/component-notifications@0.3")
+script(type="module" src="https://unpkg.com/@startinblox/component-event@0.1")
 //- script(type="module" src="https://unpkg.com/@startinblox/component-conversation@0.3")
 //- script(type="module" src="https://unpkg.com/@startinblox/component-directory@0.3")
 //- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@0.3")
diff --git a/src/index.pug b/src/index.pug
index adb0716d..26454a24 100644
--- a/src/index.pug
+++ b/src/index.pug
@@ -43,6 +43,10 @@ html(lang="en")
           #messages(hidden).with-sidebar
             include page-messages.pug
 
+        if endpoints.events || (endpoints.get && endpoints.get.events)
+          #events(hidden)
+            include page-events.pug
+
         #admin(hidden).with-sidebar
           include page-admin.pug
         
diff --git a/src/menu-left.pug b/src/menu-left.pug
index 5923acd9..4b1ac410 100644
--- a/src/menu-left.pug
+++ b/src/menu-left.pug
@@ -19,6 +19,11 @@ nav#main__menu.jsLeftMenu
     //- sib-route(name='job-offer-create', hidden)
     //- sib-route(name='job-offer-edit', use-id, hidden)
     //- div.divider
+    if endpoints.events || (endpoints.get && endpoints.get.events)
+      sib-route.menu(name='events')
+        div.menu-label Events
+        div.menu-icon.icon-calendar
+      div.divider
     if endpoints.projects || (endpoints.get && endpoints.get.projects)
       div
         div.menu
diff --git a/src/page-events.pug b/src/page-events.pug
new file mode 100644
index 00000000..f92f8d86
--- /dev/null
+++ b/src/page-events.pug
@@ -0,0 +1,2 @@
+.views-container
+  sib-event(data-src=`${endpoints.events || (endpoints.get && endpoints.get.events)}`)
\ No newline at end of file
-- 
GitLab


From 239645eda29d01740c359fd83736405698ffff52 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Mon, 3 Feb 2020 16:07:32 +0100
Subject: [PATCH 4/5] update: add upload-src and range-typeevents

---
 config.sample.federated.json | 8 ++++++--
 config.sample.json           | 4 +++-
 src/page-events.pug          | 6 +++++-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/config.sample.federated.json b/config.sample.federated.json
index 9297558a..a17abca7 100644
--- a/config.sample.federated.json
+++ b/config.sample.federated.json
@@ -12,14 +12,18 @@
       "projects": "http://localhost:8000/projects/",
       "customers": "http://localhost:8000/customers/",
       "events": "http://localhost:8000/events/",
-      "users": "http://localhost:8000/users/"
+      "typeevents": "http://localhost:8000/typeevents/",
+      "users": "http://localhost:8000/users/",
+      "uploads": "http://localhost:8000/upload/"
     },
     "post": {
       "circles": "http://localhost:8000/circles/",
       "projects": "http://localhost:8000/projects/",
       "customers": "http://localhost:8000/customers/",
       "events": "http://localhost:8000/events/",
-      "users": "http://localhost:8000/users/"
+      "typeevents": "http://localhost:8000/typeevents/",
+      "users": "http://localhost:8000/users/",
+      "uploads": "http://localhost:8000/upload/"
     }
   }
 }
diff --git a/config.sample.json b/config.sample.json
index 76cff706..0197c371 100644
--- a/config.sample.json
+++ b/config.sample.json
@@ -11,6 +11,8 @@
     "projects": "http://localhost:8000/projects/",
     "customers": "http://localhost:8000/customers/",
     "events": "http://localhost:8000/events/",
-    "users": "http://localhost:8000/users/"
+    "typeevents": "http://localhost:8000/typeevents/",
+    "users": "http://localhost:8000/users/",
+    "uploads": "http://localhost:8000/upload/"
   }
 }
diff --git a/src/page-events.pug b/src/page-events.pug
index f92f8d86..2d1fa39c 100644
--- a/src/page-events.pug
+++ b/src/page-events.pug
@@ -1,2 +1,6 @@
 .views-container
-  sib-event(data-src=`${endpoints.events || (endpoints.get && endpoints.get.events)}`)
\ No newline at end of file
+  sib-event(
+    data-src=`${endpoints.events || (endpoints.get && endpoints.get.events)}`
+    range-typeevents=`${endpoints.typeevents || (endpoints.get && endpoints.get.typeevents)}`
+    upload-src=`${endpoints.uploads || (endpoints.get && endpoints.get.uploads)}`
+  )
\ No newline at end of file
-- 
GitLab


From 2bf2206634a79e318e62a1896f0a3fe39961c4e9 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Mon, 3 Feb 2020 16:16:23 +0100
Subject: [PATCH 5/5] update readme for typeevent and uploads

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 176c48eb..6ea88034 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ Current Sib App capabilities:
 | Base | `djangoldp_account`, `djangoldp_profile`, `djangoldp_notification`, `oidc_provider` | `users` |
 | Circles | `djangoldp_circle` | `circles` |
 | Projects | `djangoldp_project` | `projects`, `customers` |
-| Events | `djangoldp_event` | `events` |
+| Events | `djangoldp_event` | `events`, `typeevents`, `uploads` |
 
 Federated Sib App needs to use `config.sample.federated.json` example.
 
-- 
GitLab