diff --git a/package-lock.json b/package-lock.json index 074ca7c861b1611759fb12896d3bd41f3e5480b5..0cb0d6a7d541e0a65e05223231f1637734a22601 100644 --- a/package-lock.json +++ b/package-lock.json @@ -821,9 +821,9 @@ "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==" }, "node-forge": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz", - "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, "object-assign": { "version": "4.1.1", @@ -1307,12 +1307,12 @@ } }, "xml-encryption": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/xml-encryption/-/xml-encryption-1.2.0.tgz", - "integrity": "sha512-J3NjGMY8jf6bTo15jURTYBLtsisbnyCeM+MuxtfiAkZEZBnSZpNKjUUORhiOScKvSi6tMOAaZ3r7bZOXOni+Ew==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/xml-encryption/-/xml-encryption-1.2.1.tgz", + "integrity": "sha512-hn5w3l5p2+nGjlmM0CAhMChDzVGhW+M37jH35Z+GJIipXbn9PUlAIRZ6I5Wm7ynlqZjFrMAr83d/CIp9VZJMTA==", "requires": { "escape-html": "^1.0.3", - "node-forge": "^0.7.0", + "node-forge": "^0.10.0", "xmldom": "~0.1.15", "xpath": "0.0.27" } diff --git a/routes/routes-project.js b/routes/routes-project.js index dc219159fa6a96b38c2af91c95e8125074940ca3..65d942a2c2f2597b19c572f0e7e9ee9fbe0cb597 100644 --- a/routes/routes-project.js +++ b/routes/routes-project.js @@ -362,9 +362,9 @@ module.exports = function (app) { perPage+'&order_by=id&sort=asc&id_after='+idAfter) } - app.get('/projectlist', async function(req, res){ + // Projektdaten + app.get('/projektdaten', async function(req, res){ let projectArr = [] - let pagesArr = [] let isProject = true let firstId = 0 @@ -381,16 +381,66 @@ module.exports = function (app) { if (projectData[i].name == "template_gitlab_page") { continue } - // M4_LAB logo for all projects that do not have logo - if (projectData[i].avatar_url == null) { - projectData[i].avatar_url = "https://m4lab.hft-stuttgart.de/img/footer/M4_LAB_LOGO_Graustufen.png" + // only repo + if (!projectData[i].tag_list.includes('website')) { + // M4_LAB logo for all projects that do not have logo + if (projectData[i].avatar_url == null) { + projectData[i].avatar_url = "https://m4lab.hft-stuttgart.de/img/footer/M4_LAB_LOGO_Graustufen.png" + } + // for all projects that have no description + if (projectData[i].description == "") { + projectData[i].description = "- no description -" + } + + let project = { + logo: projectData[i].avatar_url, + name: projectData[i].name, + weburl: projectData[i].web_url, + desc: projectData[i].description, + keywords: projectData[i].tag_list + } + projectArr.push(project) } - // for all projects that have no description - if (projectData[i].description == "") { - projectData[i].description = "- no description -" + } + + firstId = projectData[projectData.length-1].id + } + } + + res.render(lang+'/project/projectList', { + project: projectArr + }) + }) + + // Projektinformationen + app.get('/projektinformationen', async function(req, res){ + let pagesArr = [] + let isProject = true + let firstId = 0 + + while (isProject == true) { + let projects = await getProjectsFromGitlab(10, firstId) + let projectData = projects.data + + if (projectData.length == 0) { + isProject = false + } + else { + for(let i = 0; i < projectData.length; i++){ + // skip template project + if (projectData[i].name == "template_gitlab_page") { + continue } // websites if (projectData[i].tag_list.includes('website')) { + // M4_LAB logo for all projects that do not have logo + if (projectData[i].avatar_url == null) { + projectData[i].avatar_url = "https://m4lab.hft-stuttgart.de/img/footer/M4_LAB_LOGO_Graustufen.png" + } + // for all projects that have no description + if (projectData[i].description == "") { + projectData[i].description = "- no description -" + } // customize website name if (projectData[i].name == "Visualization") { projectData[i].web_url = "https://transfer.hft-stuttgart.de/pages/visualization" @@ -421,27 +471,15 @@ module.exports = function (app) { pagesArr.push(pages) } - else { - let project = { - logo: projectData[i].avatar_url, - name: projectData[i].name, - weburl: projectData[i].web_url, - desc: projectData[i].description, - keywords: projectData[i].tag_list - } - projectArr.push(project) - } } firstId = projectData[projectData.length-1].id } } - res.render(lang+'/project/projectList', { - project: projectArr, + res.render(lang+'/project/pagesList', { pages: pagesArr }) }) - }; \ No newline at end of file diff --git a/views/DE/project/pagesList.pug b/views/DE/project/pagesList.pug new file mode 100644 index 0000000000000000000000000000000000000000..d3c8a4b262a750cd53414045cd967fa16c32a7d9 --- /dev/null +++ b/views/DE/project/pagesList.pug @@ -0,0 +1,98 @@ +doctype html +html(lang="de") + head + title= "Projektinformationen" + meta(charset="UTF-8") + meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") + link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/bootstrap.min.css") + link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/m4lab.css") + link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous") + style. + .title-container { + position: relative; + color: white; + } + .card-title-bottom-left { + position: absolute; + bottom: 0px; + width: 100%; + color: black; + font-weight: bold; + background: rgb(255, 255, 255, 0.5); + text-align: left; + padding: 5px + } + .card-img-top { + height: 15vw; + object-fit: cover; + } + body + div(class="container") + div(class="pt-4 pb-4 form-row") + div(class="form-group col-md-10") + input(id="searchInput", class="form-control", type="text", placeholder="Suchen Sie hier nach Themen und Projekten", onkeyup="searchFunction()") + div(class="form-group col-md-2") + select(class="form-control") + option uncategorized + h3(class="mb-3 font-weight-bold") Projektinformationen + p(class="font-italic") Hier finden Sie Informationen zu den bei uns gehosteten Projekten, wie z.B. Projektbeschreibungen, Projektwebseiten, Visualisierungen, Demonstrationen. + + div(class="container") + p#pagesCounter #{pages.length} Projektinformationen werden angezeigt + |