"...git@transfer.hft-stuttgart.de:root/m4lab_landing_page.git" did not exist on "907628d02cb1a14f8fe8aded2c299e594b74ad71"
Commit 4dc1bc60 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

add gitlab link to project list table

parent d625f1f8
Showing with 28 additions and 38 deletions
+28 -38
...@@ -556,7 +556,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -556,7 +556,7 @@ module.exports = function (app, config, passport, i18n) {
}) })
}) })
// ======== APP ROUTES - PROJECT LIST ==================== // ======== APP ROUTES - PROJECT ====================
app.get('/project', function (req, res) { app.get('/project', function (req, res) {
async.waterfall([ async.waterfall([
// get all projects from projectdb // get all projects from projectdb
...@@ -567,71 +567,47 @@ module.exports = function (app, config, passport, i18n) { ...@@ -567,71 +567,47 @@ module.exports = function (app, config, passport, i18n) {
} }
}) })
}, },
// create JSON object of projects and user status for front-end // create JSON object for front-end
function(projectsOverview, done) { function(projectsOverview, done) {
// var allProjects = []
var activeProjects = [] var activeProjects = []
var nonActiveProjects = [] var nonActiveProjects = []
/*
for (var i = 0; i < projectsOverview.length; i++) { for (var i = 0; i < projectsOverview.length; i++) {
allProjects.push({ var project = {
id: projectsOverview[i].id, id: projectsOverview[i].id,
status: projectsOverview[i].projectstatus,
logo: projectsOverview[i].logo, logo: projectsOverview[i].logo,
akronym: projectsOverview[i].pname, akronym: projectsOverview[i].pname,
title: projectsOverview[i].title, title: projectsOverview[i].title,
summary: projectsOverview[i].onelinesummary, summary: projectsOverview[i].onelinesummary,
category: projectsOverview[i].category, category: projectsOverview[i].category,
cp: projectsOverview[i].contact_email cp: projectsOverview[i].contact_email,
}) gitlab: projectsOverview[i].gitlab
} }
*/
for (var i = 0; i < projectsOverview.length; i++) {
if (projectsOverview[i].projectstatus == 0) { if (projectsOverview[i].projectstatus == 0) {
nonActiveProjects.push({ nonActiveProjects.push(project)
id: projectsOverview[i].id,
logo: projectsOverview[i].logo,
akronym: projectsOverview[i].pname,
title: projectsOverview[i].title,
summary: projectsOverview[i].onelinesummary,
category: projectsOverview[i].category,
cp: projectsOverview[i].contact_email
})
} }
else if (projectsOverview[i].projectstatus == 1) { else if (projectsOverview[i].projectstatus == 1) {
activeProjects.push({ activeProjects.push(project)
id: projectsOverview[i].id,
logo: projectsOverview[i].logo,
akronym: projectsOverview[i].pname,
title: projectsOverview[i].title,
summary: projectsOverview[i].onelinesummary,
category: projectsOverview[i].category,
cp: projectsOverview[i].contact_email
})
} }
} }
// render the page // render the page
if (req.isAuthenticated()) { if (req.isAuthenticated()) {
res.render(lang+'/projectList/projects', { res.render(lang+'/project/projects', {
isUserAuthenticated: true, isUserAuthenticated: true,
//project: allProjects
nonActive: nonActiveProjects, nonActive: nonActiveProjects,
active: activeProjects active: activeProjects
}); });
} }
else { else {
res.render(lang+'/projectList/projects', { res.render(lang+'/project/projects', {
isUserAuthenticated: false, isUserAuthenticated: false,
//project: allProjects
nonActive: nonActiveProjects, nonActive: nonActiveProjects,
active: activeProjects active: activeProjects
}); });
} }
} }
]) ])
}) })
}; };
\ No newline at end of file
...@@ -33,6 +33,7 @@ html(lang="de") ...@@ -33,6 +33,7 @@ html(lang="de")
} }
body body
div(class="container-fluid") div(class="container-fluid")
// Active projects
h3(class="mb-3 font-weight-bold") Aktive Projekte h3(class="mb-3 font-weight-bold") Aktive Projekte
table(class="table table-striped") table(class="table table-striped")
thead thead
...@@ -57,8 +58,15 @@ html(lang="de") ...@@ -57,8 +58,15 @@ html(lang="de")
td td
a(class="nav-link", href="mailto:"+ item.cp) #{item.cp} a(class="nav-link", href="mailto:"+ item.cp) #{item.cp}
td td
a(class="nav-link", href="https://m4lab.hft-stuttgart.de/projectoverview?projectID="+ item.id) Zur Projektübersicht a(class="nav-link", href="https://m4lab.hft-stuttgart.de/projectoverview?projectID="+item.id) Zur Projektübersicht
if item.gitlab
a(class="nav-link", href="https://transfer.hft-stuttgart.de/gitlab/"+item.gitlab+"/tree/master") Projektdateien
a(class="nav-link", href="https://transfer.hft-stuttgart.de/gitlab/"+item.gitlab+"/wikis/home") Projektwiki
else
a(class="nav-link", href="#") Projektdateien
a(class="nav-link", href="#") Projektwiki
br br
// Non-active projects
h3(class="mb-3 font-weight-bold") Abgeschlossene Projekte h3(class="mb-3 font-weight-bold") Abgeschlossene Projekte
table(class="table table-striped") table(class="table table-striped")
thead thead
...@@ -83,7 +91,13 @@ html(lang="de") ...@@ -83,7 +91,13 @@ html(lang="de")
td td
a(class="nav-link", href="mailto:"+ item.cp) #{item.cp} a(class="nav-link", href="mailto:"+ item.cp) #{item.cp}
td td
a(class="nav-link", href="https://m4lab.hft-stuttgart.de/projectoverview?projectID="+ item.id) Zur Projektübersicht a(class="nav-link", href="https://m4lab.hft-stuttgart.de/projectoverview?projectID="+item.id) Zur Projektübersicht
if item.gitlab
a(class="nav-link", href="https://transfer.hft-stuttgart.de/gitlab/"+item.gitlab+"/tree/master") Projektdateien
a(class="nav-link", href="https://transfer.hft-stuttgart.de/gitlab/"+item.gitlab+"/wikis/home") Projektwiki
else
a(class="nav-link", href="#") Projektdateien
a(class="nav-link", href="#") Projektwiki
// jQuery // jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js") script(src="https://code.jquery.com/jquery-3.3.1.min.js")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment