From af86fe9dbcb0ef88d51d03ab45acf29224f0b70b Mon Sep 17 00:00:00 2001
From: Benoit Alessandroni <benoit@happy-dev.fr>
Date: Mon, 31 Aug 2020 22:55:23 +0200
Subject: [PATCH] update: Adding proper conditions

---
 src/dependencies.pug | 14 +++++++-------
 src/page-circle.pug  | 21 ++++++++++++---------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/dependencies.pug b/src/dependencies.pug
index d6be1278..e560d56f 100644
--- a/src/dependencies.pug
+++ b/src/dependencies.pug
@@ -14,15 +14,15 @@ script(type="module" src="https://unpkg.com/@startinblox/router@0.8" defer)
 script(type="module" src="https://unpkg.com/@startinblox/component-notifications@0.6.2" defer)
     //- script(type="module" src="/lib/sib-notifications/index.js" defer)
 
-if endpoints.events || (endpoints.get && endpoints.get.events)
-    script(type="module" src="https://unpkg.com/@startinblox/component-event@1.1" defer)
-    //- script(type="module" src="/lib/sib-event-component/sib-event.js" defer)
+if (endpoints.events || (endpoints.get && endpoints.get.events)) && (endpoints.typeevents || (endpoints.get && endpoints.get.typeevents))
+    //- script(type="module" src="https://unpkg.com/@startinblox/component-event@1.1" defer)
+    script(type="module" src="/lib/sib-event-component/sib-event.js" defer)
 
-if endpoints.resources || (endpoints.get && endpoints.get.resources)
-    script(type="module" src="https://unpkg.com/@startinblox/component-resource@1.0" defer)
-    //-script(type="module" src="/lib/sib-resource/sib-resource.js" defer)
+if (endpoints.resources || (endpoints.get && endpoints.get.resources)) && (endpoints.resourceskeywords || (endpoints.get && endpoints.get.resourceskeywords)) && (endpoints.resourcestypes || (endpoints.get && endpoints.get.resourcestypes))
+    //- script(type="module" src="https://unpkg.com/@startinblox/component-resource@1.0" defer)
+    script(type="module" src="/lib/sib-resource/sib-resource.js" defer)
 
-if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers)
+if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) 
     script(type="module" src="https://unpkg.com/@startinblox/component-job-board@0.5" defer)
     //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer)
 
diff --git a/src/page-circle.pug b/src/page-circle.pug
index 24dbcce2..5ca22718 100644
--- a/src/page-circle.pug
+++ b/src/page-circle.pug
@@ -34,13 +34,16 @@ nav.jsRightMenu(role='navigation')
       solid-route(name='circle-information')
         li
           a Information
-      solid-route(name='circle-resources' use-id)
-        li
-          a Resources
-      solid-route(name='circle-events' use-id)
-        li
-          a Events
-      solid-route(name='circle-polls' use-id)
-        li
-          a Polls
+      if (endpoints.resources || (endpoints.get && endpoints.get.resources)) && (endpoints.resourceskeywords || (endpoints.get && endpoints.get.resourceskeywords)) && (endpoints.resourcestypes || (endpoints.get && endpoints.get.resourcestypes))
+        solid-route(name='circle-resources' use-id)
+          li
+            a Resources
+      if (endpoints.events || (endpoints.get && endpoints.get.events)) && (endpoints.typeevents || (endpoints.get && endpoints.get.typeevents))
+        solid-route(name='circle-events' use-id)
+          li
+            a Events
+      if endpoints.polls || (endpoints.get && endpoints.get.polls)
+        solid-route(name='circle-polls' use-id)
+          li
+            a Polls
       
-- 
GitLab