Commit 4dc1bc60 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

add gitlab link to project list table

parent d625f1f8
......@@ -556,7 +556,7 @@ module.exports = function (app, config, passport, i18n) {
})
})
// ======== APP ROUTES - PROJECT LIST ====================
// ======== APP ROUTES - PROJECT ====================
app.get('/project', function (req, res) {
async.waterfall([
// get all projects from projectdb
......@@ -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) {
// var allProjects = []
var activeProjects = []
var nonActiveProjects = []
/*
for (var i = 0; i < projectsOverview.length; i++) {
allProjects.push({
var project = {
id: projectsOverview[i].id,
status: projectsOverview[i].projectstatus,
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
})
}
*/
for (var i = 0; i < projectsOverview.length; i++) {
cp: projectsOverview[i].contact_email,
gitlab: projectsOverview[i].gitlab
}
if (projectsOverview[i].projectstatus == 0) {
nonActiveProjects.push({
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
})
nonActiveProjects.push(project)
}
else if (projectsOverview[i].projectstatus == 1) {
activeProjects.push({
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
})
activeProjects.push(project)
}
}
// render the page
if (req.isAuthenticated()) {
res.render(lang+'/projectList/projects', {
res.render(lang+'/project/projects', {
isUserAuthenticated: true,
//project: allProjects
nonActive: nonActiveProjects,
active: activeProjects
});
}
else {
res.render(lang+'/projectList/projects', {
res.render(lang+'/project/projects', {
isUserAuthenticated: false,
//project: allProjects
nonActive: nonActiveProjects,
active: activeProjects
});
}
}
])
})
};
};
\ No newline at end of file
......@@ -33,6 +33,7 @@ html(lang="de")
}
body
div(class="container-fluid")
// Active projects
h3(class="mb-3 font-weight-bold") Aktive Projekte
table(class="table table-striped")
thead
......@@ -57,8 +58,15 @@ html(lang="de")
td
a(class="nav-link", href="mailto:"+ item.cp) #{item.cp}
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
// Non-active projects
h3(class="mb-3 font-weight-bold") Abgeschlossene Projekte
table(class="table table-striped")
thead
......@@ -83,7 +91,13 @@ html(lang="de")
td
a(class="nav-link", href="mailto:"+ item.cp) #{item.cp}
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
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
......
Markdown is supported
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