From 6c8e3f61472b4d08d0ef82b3a5167dd3bd444fc6 Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Tue, 29 Jun 2021 22:01:10 -0400 Subject: [PATCH] Added Some Changes to Dashboard and project pages --- dashboard/index.html | 3 --- dashboard/script.js | 2 +- project_explorer/index.html | 33 ++++++++++++++++++++++--------- project_explorer/script.js | 39 +++++++++++++++++++++++++++++++++++++ project_explorer/style.css | 9 +++++++++ 5 files changed, 73 insertions(+), 13 deletions(-) diff --git a/dashboard/index.html b/dashboard/index.html index 5923131..1086ca4 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -102,9 +102,6 @@ class="mdl-color-text--blue-grey-400 material-icons" role="presentation">rss_feedBlog Posts developer_boardSoftware - settings_input_antennaSatellite Images linkLink Explorer
" + data1['post'] + "
Edit
" + a.innerHTML = "

" + data1['title'].replace(/,/g, '.') + "

" + data1['post'] + "
" document.getElementById("blog").appendChild(a) }) diff --git a/project_explorer/index.html b/project_explorer/index.html index 65203e4..f97e916 100644 --- a/project_explorer/index.html +++ b/project_explorer/index.html @@ -71,25 +71,40 @@
Project Explorer
+
+ + + + +
+ +
diff --git a/project_explorer/script.js b/project_explorer/script.js index 07b1af6..47116c0 100644 --- a/project_explorer/script.js +++ b/project_explorer/script.js @@ -1,8 +1,30 @@ function onLoad() { startFirebase() + displayBlog() displayProjects("all") } +function blogs() { + document.getElementById("projects").style.display = "none" + document.getElementById("blogs").style.display = "block" + document.getElementById("programs").style.display = "none" + document.getElementById("project_buttons").style.display = "none" +} + +function programs() { + document.getElementById("projects").style.display = "none" + document.getElementById("blogs").style.display = "none" + document.getElementById("programs").style.display = "block" + document.getElementById("project_buttons").style.display = "none" +} + +function projects() { + document.getElementById("projects").style.display = "block" + document.getElementById("blogs").style.display = "none" + document.getElementById("programs").style.display = "none" + document.getElementById("project_buttons").style.display = "block" +} + function displayProjects(status) { document.getElementById("projects").innerHTML = "" database = firebase.database().ref("projects"); @@ -29,6 +51,23 @@ function displayProjects(status) { }); } +function displayBlog() { + document.getElementById("blogs").innerHTML = "" + database = firebase.database().ref("blogs"); + database.once('value', function (snapshot) { + snapshot.forEach(function (child) { + firebase.database().ref("blogs/" + child["key"]).on('value', function (data) { + var data1 = data.val(); + var a = document.createElement("div") + var title = data1["title"] + a.innerHTML = "

" + data1['title'].replace(/,/g, '.') + "

" + data1['post'] + "
" + //a.innerHTML = "

" + data1['title'] + "

" + document.getElementById("blogs").appendChild(a) + }) + }) + }); +} + // Starts Firebase function startFirebase() { // Initialize Firebase diff --git a/project_explorer/style.css b/project_explorer/style.css index 2b21250..5e01fb2 100644 --- a/project_explorer/style.css +++ b/project_explorer/style.css @@ -3,6 +3,15 @@ margin: 10px; } +.blog-card { + width: 98.5%; + margin: 10px;; +} + +.mdl-chip { + margin: 10px; +} + .active {color: green;} .inactive {color: orange;} .canceled {color: red;}