Skip to content

Commit ad91a51

Browse files
committed
add project status=new
1 parent e068744 commit ad91a51

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

manager_dashboard/manager_dashboard/js/project-management.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ function getProjects(status) {
8585
btn.innerHTML = "Activate"
8686
} else if (data.val().status == "active") {
8787
btn.innerHTML = "Deactivate"
88+
} else if (data.val().status == "new") {
89+
btn.innerHTML = "Activate"
8890
}
8991
td.appendChild(btn)
9092
tr.appendChild(td)
@@ -131,6 +133,11 @@ function updateIsFeatured(projectId, newStatus) {
131133
}
132134

133135
function updateTableView() {
136+
var newProjects = document.getElementById("new-projects")
137+
while (newProjects.firstChild) {
138+
newProjects.removeChild(newProjects.firstChild);
139+
}
140+
134141
var inactiveProjects = document.getElementById("inactive-projects")
135142
while (inactiveProjects.firstChild) {
136143
inactiveProjects.removeChild(inactiveProjects.firstChild);
@@ -141,6 +148,7 @@ function updateTableView() {
141148
activeProjects.removeChild(activeProjects.firstChild);
142149
}
143150

151+
getProjects("new")
144152
getProjects("active")
145153
getProjects("inactive")
146154
}
@@ -157,6 +165,10 @@ function changeProjectStatus() {
157165
console.log("current status: inactive")
158166
updateStatus(this.id, "active")
159167
console.log("new status: active")
168+
} else if (this.classList.contains("status-new")) {
169+
console.log("current status: new")
170+
updateStatus(this.id, "active")
171+
console.log("new status: active")
160172
}
161173
updateTableView()
162174
}
@@ -177,5 +189,6 @@ function changeProjectIsFeatured() {
177189
}
178190

179191

192+
getProjects("new")
180193
getProjects("active")
181194
getProjects("inactive")

manager_dashboard/manager_dashboard/manage.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ <h3>Please <a href="index.html">log in</a> first.</h3>
6666
<!-- manage existing projects -->
6767
<div class="row justify-content-center" id="project-management" style="display: block">
6868
<div class="col-md-12">
69-
<h2>Active Projects</h2>
69+
<h2>New Projects</h2>
70+
<div id="new-projects">
71+
<div id="new-projects-table"></div>
72+
</div>
73+
<h2>Active Projects</h2>
7074
<div id="active-projects">
7175
<div id="active-projects-table"></div>
7276
</div>

0 commit comments

Comments
 (0)