From d58173b93fed439300a12a306f4e55f12291d0d8 Mon Sep 17 00:00:00 2001
From: JOE XMG <thunyathep.s@outlook.com>
Date: Mon, 6 Jun 2022 23:48:07 +0200
Subject: [PATCH] update

---
 public/content/content_internal_example.json | 26 ++++++++++++++++++++
 public/js/add_content.js                     |  8 ++++++
 2 files changed, 34 insertions(+)
 create mode 100644 public/content/content_internal_example.json

diff --git a/public/content/content_internal_example.json b/public/content/content_internal_example.json
new file mode 100644
index 0000000..0b26f15
--- /dev/null
+++ b/public/content/content_internal_example.json
@@ -0,0 +1,26 @@
+{
+    "item": {
+      "title": "Test",
+      "project": "",
+      "author": {
+        "firstName": "...",
+        "lastName": "...",
+        "hftURL": "..."
+      },
+      "project_year_start": "2021",
+      "project_year_end": "2022",
+      "project_is_on_going": true,
+      "imageLink": "imgs/hft.jpg",
+      "keywords": ["..."],
+      "description_en": "...",
+      "description_de": "...",
+      "internal":true
+    },
+    "links": {
+      "demo": "...",
+      "publication": "...",
+      "youtube": "...",
+      "project": "..."
+    },
+    "refIndex": 15
+  }
\ No newline at end of file
diff --git a/public/js/add_content.js b/public/js/add_content.js
index 1f76814..a25d3a1 100644
--- a/public/js/add_content.js
+++ b/public/js/add_content.js
@@ -59,6 +59,14 @@ function addcontent(item) {
       repoHTML = `<a class="btn btn-sm btn-outline-info mt-1" href="${repoLink}" target="_blank"> <i class="fa fa-gitlab"></i> Git/Repository </a>`
     }
 
+    if ('internal' in item.item) {
+      if (item.item.internal) {
+        var internal_tag = `<span class="badge bg-secondary" style="color: white;">Internal Access Only</span> <br>`
+        description = internal_tag + description
+      }
+      
+    }
+
     new_row.innerHTML = new_row.innerHTML + '<div class="col-lg-4">' +
       '<div class="card mb-4 shadow-sm extension overflow-auto">' +
       '<h5>' + item.item.title + ' <span class="content-subtitle text-muted"> ' + item.item.project + '</span></h5>' +
-- 
GitLab