Commit 62880f10 authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

Merge branch 'MLAB-56' into 'master'

Mlab 56

See merge request !2
parents 393920ba 0ac2db14
......@@ -18,7 +18,7 @@ userConnection.connect(function(err) {
})
userConnection.query('USE '+config.database.dbUser)
// db connection test
// user db connection test
userConnection.query('SELECT 1 + 5 AS solution', function (err, rows, fields) {
if (err) throw err
console.log('Solution = ', rows[0].solution)
......@@ -51,7 +51,7 @@ var dbconn = function dbconn(query, values, next) {
// ==== PROJECT DB CONNECTION ====
var projectConnection = mysql.createConnection({
host: config.database.host,
host: config.database.host_project,
user: config.database.user,
password: config.database.password,
port: config.database.port,
......
var helpers = {
stringToArray: function (input){
if(input != null){
return input.split(',');
}else{
return null;
}
}
};
module.exports = helpers;
\ No newline at end of file
const nodemailer = require('nodemailer')
var env = process.env.NODE_ENV || 'development';
const config = require('../config/config')[env]
var smtpTransport = nodemailer.createTransport({
host: config.mailer.host,
secureConnection: config.mailer.secureConnection,
port: config.mailer.port,
auth: {
user: config.mailer.authUser,
pass: config.mailer.authPass
},
tls: {
ciphers: config.mailer.tlsCiphers
}
});
var mailOptions = {
to: "",
from: config.mailer.from,
subject: "",
text: ""
};
var mailer = {
transport: smtpTransport,
options: mailOptions
}
module.exports = mailer
\ No newline at end of file
......@@ -57,7 +57,7 @@ var methods = {
})
},
getUserByEmail: function(email, callback) {
dbconn.user.query('SELECT title, firstname, lastname, industry, organisation, speciality FROM user WHERE email = "' +email+'"', function (err, rows, fields) {
dbconn.user.query('SELECT salutation, title, firstname, lastname, industry, organisation, speciality FROM user WHERE email = "' +email+'"', function (err, rows, fields) {
if (err) {
throw err;
}
......@@ -83,19 +83,22 @@ var methods = {
callback(err, user);
});
},
checkUserToken: function(token, callback) {
getUserByToken: function(token, callback) {
var user;
dbconn.user.query('SELECT user_id FROM credential WHERE resetPasswordToken = "'+token+'" and resetPasswordExpires > '+Date.now(), function (err, rows, fields) {
if (err) {
throw err;
}
else {
if ( rows.length > 0) {
user = rows[0];
dbconn.user.query('SELECT t1.user_id, t2.email FROM userdb.credential AS t1 INNER JOIN userdb.user AS t2 ON t1.user_id = t2.id AND t1.resetPasswordToken = "'
+token+'" and resetPasswordExpires > '+Date.now(), function (err, rows, fields) {
if (err) {
throw err;
}
else {
if ( rows.length > 0) {
user = rows[0]
console.log(user)
}
}
callback(err, user);
}
callback(err, user);
});
);
},
updateUser: function(userData, callback) {
dbconn.user.query('UPDATE user SET ? WHERE email = "' +userData.email+'"', userData, function (err, rows, fields) {
......@@ -129,12 +132,44 @@ var methods = {
callback(rows, err);
});
},
addUserProjectRole: function(data, callback) {
dbconn.user.query('INSERT INTO user_project_role SET ?', data, function (err, results, fields){
if (err) throw err;
callback(err);
})
},
// ======================= project db =======================
getAllProjects: function(callback) {
dbconn.project.query('CALL getAllprojects', function (err, rows, fields){
if (err) throw err;
callback(rows[0], err);
})
},
getAllMailinglists: function(callback) {
dbconn.project.query('CALL getAllLists', function (err, rows, fields){
if (err) throw err;
callback(rows[0], err);
})
},
getProjectOverviewById: function(projectId, callback) {
dbconn.project.query('CALL GetProjectInformationByProjectID(' + projectId+ ')', function (err, rows, fields){
if (err) throw err;
callback(rows[0], err);
})
},
getProjectImagesById: function(projectId, callback) {
dbconn.project.query('CALL getImagesByProjectID(' + projectId+ ')', function (err, rows, fields){
if (err) throw err;
callback(rows[0], err);
})
},
addProjectOverview: function(data, callback) {
dbconn.project.query('INSERT INTO project_overview SET ?', data, function (err, results, fields){
if (err) {
console.error(err);
}
callback(results, err);
})
}
};
......
......@@ -3,14 +3,15 @@ const SamlStrategy = require('passport-saml').Strategy
const dbconn = require('./dbconn')
const methods = require('./methods')
// pwd encryption
const bcrypt = require('bcryptjs')
const saltRounds = 10
const bcrypt = require('bcryptjs');
const saltRounds = 10;
const salt = 64; // salt length
// forgot pwd
const async = require('async')
const crypto = require('crypto')
const nodemailer = require('nodemailer')
const mailer = require('./mailer')
module.exports = function (app, config, passport) {
module.exports = function (app, config, passport, i18n) {
// =========== PASSPORT =======
passport.serializeUser(function (user, done) {
......@@ -61,7 +62,7 @@ module.exports = function (app, config, passport) {
failureFlash: true
}),
function (req, res) {
res.redirect('/');
res.redirect('/account/');
}
);
......@@ -74,30 +75,37 @@ module.exports = function (app, config, passport) {
}
);
// ======== NODEMAILER ====================
var smtpTransport = nodemailer.createTransport({
host: config.mailer.host,
secureConnection: config.mailer.secureConnection,
port: config.mailer.port,
auth: {
user: config.mailer.authUser,
pass: config.mailer.authPass
},
tls: {
ciphers: config.mailer.tlsCiphers
}
// ================ test i18n ==================
i18n.setLocale('de');
app.get('/de', function(req, res) {
var greeting = i18n.__('Hello World')
res.send(greeting)
});
var mailOptions = {
to: "",
from: config.mailer.from,
subject: "",
text: ""
};
// ======== APP ROUTES ====================
var lang = 'DE'
// ======== APP ROUTES - ACCOUNT ====================
var updatePasswordMailSubject = "Ihr Passwort für das Transferportal wurde gespeichert."
var mailSignature = "Mit den besten Grüßen,\ndas Transferportal-Team der HFT Stuttgart\n\n"+
"Transferportal der Hochschule für Technik Stuttgart\n"+
"Schellingstr. 24\n"+
"70174 Stuttgart\n"+
"m4lab@hft-stuttgart.de\n"+
"https://transfer.hft-stuttgart.de"
var updatePasswordMailContent = "Lieber Nutzer,\n\n"+"Ihr Passwort wurde erfolgreich geändert.\n\n"+mailSignature
app.get('/', function (req, res) {
res.redirect('/profile')
if (req.isAuthenticated()) {
methods.getUserByEmail(req.user.email, function(data, err){
if (!err) {
res.render(lang+'/account/home', {
user: data
});
}
})
} else {
res.redirect('/account/login'); // localhost
}
});
app.get('/login',
......@@ -110,9 +118,9 @@ module.exports = function (app, config, passport) {
app.get('/logout', function (req, res) {
if (req.user == null) {
return res.redirect('/');
return res.redirect('/account/');
}
req.user.nameID = req.user.id;
req.user.nameIDFormat = req.user.idFormat;
return samlStrategy.logout(req, function(err, uri) {
......@@ -134,14 +142,14 @@ module.exports = function (app, config, passport) {
if (req.isAuthenticated()) {
methods.getUserByEmail(req.user.email, function(data, err){
if (!err) {
res.render('profile', {
res.render(lang+'/account/profile', {
user: data,
email: req.user.email
});
}
})
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
......@@ -183,9 +191,9 @@ module.exports = function (app, config, passport) {
for (var i = 0; i < projectsOverview.length; i++) {
// check if projectId is exist in userProjectId[]
var status = "You cannot access this service"
var status = false
if (userProjectId.indexOf(projectsOverview[i].id) > -1) {
status = "You can access this service"
status = true
}
// add data to JSON object
allProjects.push({
......@@ -198,30 +206,30 @@ module.exports = function (app, config, passport) {
}
// render the page
res.render('services', {
res.render(lang+'/account/services', {
user: req.user,
project: allProjects
});
}
])
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
app.get('/security', function (req, res) {
if (req.isAuthenticated()) {
console.log(req.user)
res.render('security', {
res.render(lang+'/account/security', {
user: req.user // useful for view engine, useless for HTML
});
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
app.post('/updateProfile', function (req, res) {
var userData = {
salutation: req.body.inputSalutation,
title: req.body.inputTitle,
firstname: req.body.inputFirstname,
lastname: req.body.inputLastname,
......@@ -239,13 +247,14 @@ module.exports = function (app, config, passport) {
req.flash('error', "Failed");
}
else {
req.flash('success', 'Profile updated!');
//req.flash('success', 'Profile updated!');
req.flash('success', 'Ihr Benutzerprofil wurde aktualisiert!');
}
res.redirect('/profile');
res.redirect('/account/profile');
})
}
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
......@@ -272,13 +281,15 @@ module.exports = function (app, config, passport) {
throw err
}
else if (!isMatch) {
req.flash('error', "Sorry, your password was incorrect. Please double-check your password.")
res.redirect('/security')
//req.flash('error', "Sorry, your password was incorrect. Please double-check your password.")
req.flash('error', "Das Passwort ist leider falsch. Bitte überprüfen Sie Ihre Eingabe.")
//res.redirect('/security')
res.redirect('/account/security')
}
else {
if ( newPwd != retypePwd ) {
req.flash('error', "Passwords do no match. Please make sure you re-type your new password correctly.")
res.redirect('/security')
res.redirect('/account/security')
}
else {
// update password
......@@ -290,14 +301,24 @@ module.exports = function (app, config, passport) {
}
methods.updateCredential(credentialData, function(err){
if (err) {
req.flash('error', "Database error: Password cannot be modified.")
//req.flash('error', "Database error: Password cannot be modified.")
req.flash('error', "Datenbankfehler: Passwort kann nicht geändert werden.")
throw err
}
else {
req.flash('success', "Pasword updated!")
console.log('pasword updated!')
//req.flash('success', "Pasword updated!")
req.flash('success', "Passwort aktualisiert!")
mailer.options.to = req.user.email
//mailOptions.subject = "Your M4_LAB Password has been updated."
mailer.options.subject = updatePasswordMailSubject
mailer.options.text = updatePasswordMailContent
mailer.transport.sendMail(mailer.options, function(err) {
if (err) {
console.log(err)
}
});
}
res.redirect('/security')
res.redirect('/account/security')
})
});
});
......@@ -309,12 +330,12 @@ module.exports = function (app, config, passport) {
})
}
else {
res.redirect('/login');
res.redirect('/account/login');
}
});
app.get('/forgotPwd', function (req, res) {
res.render('forgotPwd', {
res.render(lang+'/account/forgotPwd', {
user: req.user
});
});
......@@ -323,10 +344,10 @@ module.exports = function (app, config, passport) {
//methods.currentDate();
var emailAddress = req.body.inputEmail;
var emailContent = "Hi there,\n\n"+
/* var emailContent = "Hi there,\n\n"+
"we've received a request to reset your password. However, this email address is not on our database of registered users.\n\n"+
"Thanks,\nM4_LAB Team";
var emailSubject = "Account Access Attempted";
var emailSubject = "Account Access Attempted"; */
async.waterfall([
function(done) {
......@@ -339,13 +360,19 @@ module.exports = function (app, config, passport) {
methods.checkUserEmail(emailAddress, function(err, user){
if (user) {
console.log("email: user found");
emailSubject = "M4_LAB Password Reset";
emailContent = "Hi User,\n\n"+
//var emailSubject = "M4_LAB Password Reset";
var emailSubject = "Ihre Passwort-Anfrage an das Transferportal der HFT Stuttgart";
/* var emailContent = "Hi User,\n\n"+
"we've received a request to reset your password. If you didn't make the request, just ignore this email.\n\n"+
"Otherwise, you can reset your password using this link: http://" + req.headers.host + "/reset/" + token + "\n" +
"Otherwise, you can reset your password using this link: http://m4lab.hft-stuttgart.de/account/reset/" + token + "\n" +
"This password reset is only valid for 1 hour.\n\n"+
"Thanks,\nM4_LAB Team"
"Thanks,\nM4_LAB Team" */
var emailContent = "Lieber Nutzer,\n\n"+
"wir haben Ihre Anfrage zur Erneuerung Ihres Passwortes erhalten. Falls Sie diese Anfrage nicht gesendet haben, ignorieren Sie bitte diese E-Mail.\n\n"+
"Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://m4lab.hft-stuttgart.de/account/reset/" + token + "\n" + // test server
//"Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://localhost:9989/reset/" + token + "\n" + // localhost
"Dieser Link ist aus Sicherheitsgründen nur für 1 Stunde gültig.\n\n"+mailSignature
var credentialData = {
user_id: user.id,
resetPasswordToken: token,
......@@ -354,50 +381,56 @@ module.exports = function (app, config, passport) {
methods.updateCredential(credentialData, function(err) {
done(err, token, user);
});
// send email
mailer.options.to = emailAddress;
mailer.options.subject = emailSubject;
mailer.options.text = emailContent;
mailer.transport.sendMail(mailer.options, function(err) {
done(err, 'done');
});
}
else {
done(err, null, null);
//done(err, null, null);
done(err, 'no user found');
}
});
},
function(token, user, done) {
mailOptions.to = emailAddress;
mailOptions.subject = emailSubject;
mailOptions.text = emailContent;
smtpTransport.sendMail(mailOptions, function(err) {
done(err, 'done');
});
}
], function(err) {
if (err) {
req.flash('error', 'An error occured. Please try again.');
//req.flash('error', 'An error occured. Please try again.');
req.flash('error', 'Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.');
}
else {
req.flash('success', 'An e-mail has been sent to ' + emailAddress + ' with further instructions.');
//req.flash('success', 'If your email is registered, an e-mail has been sent to ' + emailAddress + ' with further instructions.');
req.flash('success', 'Wenn Ihre E-Mail-Adresse registriert ist, wurde eine E-Mail mit dem weiteren Vorgehen an ' + emailAddress + ' versendet.');
}
res.redirect('/forgotPwd');
//res.redirect('/forgotPwd'); // deployment
res.redirect('/account/forgotPwd'); // localhost
});
});
app.get('/reset/:token', function(req, res) {
methods.checkUserToken(req.params.token, function(err, user){
//console.log(user);
methods.getUserByToken(req.params.token, function(err, user){
if (!user) {
req.flash('error', 'Password reset token is invalid or has expired.');
res.redirect('/forgotPwd');
//req.flash('error', 'Password reset token is invalid or has expired.');
req.flash('error', 'Der Schlüssel zum zurücksetzen des Passworts ist ungültig oder abgelaufen.');
//res.redirect('/forgotPwd'); // deployment
res.redirect('/account/forgotPwd'); // localhost
}
else {
res.render('reset');
res.render(lang+'/account/reset');
}
});
});
app.post('/reset/:token', function(req, res) {
methods.checkUserToken(req.params.token, function(err, user){
var newPwd = req.body.inputNewPwd
methods.getUserByToken(req.params.token, function(err, user){
if (user) {
// encrypt password
bcrypt.genSalt(saltRounds, function(err, salt) {
bcrypt.hash(req.body.inputNewPwd, salt, function(err, hash) {
bcrypt.hash(newPwd, salt, function(err, hash) {
var credentialData = {
password: hash,
user_id: user.user_id
......@@ -405,13 +438,24 @@ module.exports = function (app, config, passport) {
// update password
methods.updateCredential(credentialData, function(err){
if (err) {
req.flash('error', "Database error: Password cannot be modified.")
//req.flash('error', "Database error: Password cannot be modified.")
req.flash('error', "Datenbankfehler: Passwort kann nicht geändert werden.")
throw err
}
else {
req.flash('success', "Your pasword has been updated.")
console.log('pasword updated!')
// todo: send confirmation email
//req.flash('success', "Your pasword has been updated.")
req.flash('success', "Passwort aktualisiert!")
// send notifiaction email
mailer.options.to = user.email
mailer.options.subject = updatePasswordMailSubject
mailer.options.text = updatePasswordMailContent
mailer.transport.sendMail(mailer.options, function(err) {
if (err) {
console.log(err)
}
});
// redirect to login page
res.redirect('/account/login')
}
})
});
......@@ -419,15 +463,15 @@ module.exports = function (app, config, passport) {
}
else {
req.flash('error', "User not found.")
res.redirect('/account/login')
}
});
res.redirect('/login')
});
// todo: user registration with captcha
app.get('/registration', function(req, res) {
res.render('registration')
res.render(lang+'/account/registration')
})
app.post('/registration', function(req, res) {
......@@ -438,6 +482,7 @@ module.exports = function (app, config, passport) {
// user data
var curDate = new Date()
var userData = {
salutation: req.body.inputSalutation,
title: req.body.inputTitle,
firstname: req.body.inputFirstname,
lastname: req.body.inputLastname,
......@@ -457,12 +502,14 @@ module.exports = function (app, config, passport) {
}
methods.registerNewUser(newAccount, function(err){
if (err) {
req.flash('error', "Failed");
//req.flash('error', "Failed")
req.flash('error', "Fehlgeschlagen")
}
else {
req.flash('success', 'Your account has been created. Please log in.');
//req.flash('success', 'Your account has been created. Please log in.')
req.flash('success', 'Ihr Benutzerkonto wurde angelegt. Bitte melden Sie sich an.')
}
res.redirect('/registration');
res.redirect('/account/registration');
})
});
});
......@@ -481,4 +528,40 @@ module.exports = function (app, config, passport) {
})
})
app.get('/contact', function (req, res) {
res.render(lang+'/account/contact', {
user: req.user
});
});
app.post('/contact', function(req, res, next) {
//methods.currentDate();
let emailAddress = req.body.inputEmail;
let supportAddress = "support-transfer@hft-stuttgart.de";
let inputName = req.body.name;
let inputContent = req.body.message;
let emailContent = "Es wurde eine Anfrage an das Transferportal gestellt: \n\n NAME: " + inputName + "\n NACHRICHT:\n "+ inputContent;
let emailSubject = "Ihre Anfrage an das Transferportal";
async.waterfall([
function(done) {
// send email
mailer.options.to = supportAddress;
mailer.options.cc = emailAddress;
mailer.options.subject = emailSubject;
mailer.options.text = emailContent;
mailer.transport.sendMail(mailer.options, function(err) {
done(err, 'done');
});
}
], function(err) {
if (err) {
req.flash('error', 'Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.');
}
else {
req.flash('success', 'Vielen Dank für Ihre Anfrage. Wir melden uns baldmöglichst bei Ihnen. Eine Kopie Ihrer Anfrage wurde an ' + emailAddress + ' versandt.');
}
//res.redirect('/forgotPwd'); // deployment
res.redirect('/account/contact'); // localhost
});
});
};
\ No newline at end of file
const methods = require('./methods')
const async = require('async')
const helpers = require('./helpers')
module.exports = function (app) {
// ======== APP ROUTES - PROJECT ====================
var lang = 'DE'
app.get('/mailinglists', function (req, res) {
async.waterfall([
function(done) {
methods.getAllMailinglists(function(mailinglistOverview, err) {
if (!err) {
done(err, mailinglistOverview)
}
})
},
// create JSON object of mailinglists for front-end
function(mailinglistOverview, done) {
var allMailingLists = [] // JSON object
for (let i = 0; i < mailinglistOverview.length; i++) {
// add data to JSON object
allMailingLists.push({
id: mailinglistOverview[i].id,
name: mailinglistOverview[i].name,
src: mailinglistOverview[i].src,
projectstatus: mailinglistOverview[i].projectstatus,
project_title: mailinglistOverview[i].project_title
});
}
res.render(lang+'/project/mailinglists', {
isUserAuthenticated: req.isAuthenticated(),
user: req.user,
mailinglists: allMailingLists
});
}
])
});
app.get('/project_', function (req, res) {
async.waterfall([
// get all projects from projectdb
function(done) {
methods.getAllProjects(function(projectsOverview, err) {
if (!err) {
done(err, projectsOverview)
}
})
},
// create JSON object for front-end
function(projectsOverview, done) {
var activeProjects = []
var nonActiveProjects = []
for (var i = 0; i < projectsOverview.length; i++) {
var 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,
gitlab: projectsOverview[i].gitlab
}
if (projectsOverview[i].projectstatus == 0) {
nonActiveProjects.push(project)
}
else if (projectsOverview[i].projectstatus == 1) {
activeProjects.push(project)
}
}
// render the page
if (req.isAuthenticated()) {
res.render(lang+'/project/projects', {
isUserAuthenticated: true,
nonActive: nonActiveProjects,
active: activeProjects
});
}
else {
res.render(lang+'/project/projects', {
isUserAuthenticated: false,
nonActive: nonActiveProjects,
active: activeProjects
});
}
}
])
})
app.get('/project', function (req, res) {
res.render(lang+'/project/project-simplified', {
isUserAuthenticated: req.isAuthenticated(),
user: req.user
});
})
app.get('/addprojectoverview', function (req, res) {
if (req.isAuthenticated()) {
res.render(lang+'/project/addProjectOverview')
}
else {
res.redirect('/account/login')
}
})
app.post('/addprojectoverview__', function (req, res) {
if (req.isAuthenticated()) {
var wiki = 0
if (req.body.wiki)
wiki = 1
var projectTerm = req.body.termForm + " - " + req.body.termTo
var projectOverviewData = {
pname: req.body.pname,
title: req.body.title,
onelinesummary: req.body.summary,
category: req.body.category,
logo: req.body.logo,
gitlab: req.body.gitlabURL,
wiki: wiki,
overview: req.body.overview,
question: req.body.question,
approach: req.body.approach,
result: req.body.result,
keywords: req.body.keywords,
announcement: req.body.announcement,
term: projectTerm,
further_details: req.body.furtherDetails,
website: req.body.website,
src: req.body.src,
caption: req.body.caption,
contact_lastname: req.body.contactName,
contact_email: req.body.contactEmail,
leader_lastname: req.body.leaderName,
leader_email: req.body.leaderEmail
}
methods.addProjectOverview(projectOverviewData, function(err){
if (err) {
//req.flash('error', "Failed")
req.flash('error', "Fehlgeschlagen")
res.redirect('/account/addProjectOverview');
}
else {
req.flash('success', 'Your project has been created.')
res.redirect('/project');
}
})
}
})
app.post('/addprojectoverview', function (req, res) {
if (req.isAuthenticated()) {
var wiki = 0
if (req.body.wiki)
wiki = 1
var projectTerm = req.body.termForm + " - " + req.body.termTo
var projectOverviewData = {
pname: req.body.pname,
title: req.body.title,
onelinesummary: req.body.summary,
category: req.body.category,
logo: req.body.logo,
gitlab: req.body.gitlabURL,
wiki: wiki,
overview: req.body.overview,
question: req.body.question,
approach: req.body.approach,
result: req.body.result,
keywords: req.body.keywords,
announcement: req.body.announcement,
term: projectTerm,
further_details: req.body.furtherDetails,
website: req.body.website,
src: req.body.src,
caption: req.body.caption,
contact_lastname: req.body.contactName,
contact_email: req.body.contactEmail,
leader_lastname: req.body.leaderName,
leader_email: req.body.leaderEmail
}
/* RS: Temporary solution while Project DB is still in early phase.
When User DB and Project DB are integrated and quite stabil, this operation should be done in 1 transaction.
*/
var userId // todo: make this global variable?
async.waterfall([
// get userId by email from userdb
function(done) {
methods.getUserIdByEmail(req.user.email, function(id, err) {
if (!err) {
userId = id
done(err)
}
})
},
// add project overview
function(done) {
methods.addProjectOverview(projectOverviewData, function(data, err){
if (err) {
res.status(500).render(lang+'/500', {
error: err
})
}
else {
done(err, data.insertId)
}
})
},
// assign the created overview to logged-in user
function(projectOverviewId, done) {
var userProjectRoleData = {
project_id: projectOverviewId,
user_id: userId,
role_id: 3 // OVERVIEW_CREATOR
}
methods.addUserProjectRole(userProjectRoleData, function(userProjects, err) {
if (err) {
//req.flash('error', "Failed")
req.flash('error', "Fehlgeschlagen")
res.redirect('/account/addProjectOverview');
}
else {
req.flash('success', 'Your project has been created.')
res.redirect('/project');
}
})
}
])
}
})
app.get('/updateprojectoverview', function (req, res) {
// only their own project
})
app.post('/updateprojectoverview', function (req, res) {
// only their own project
})
app.get('/projectoverview', function(req, res){
async.waterfall([
function(done) {
methods.getProjectOverviewById(req.query.projectID, function(projectOverview, err) {
if (!err) {
done(err, projectOverview)
}
})
},
function(projectOverview,done){
methods.getProjectImagesById(req.query.projectID, function(projectImages, err) {
if (!err) {
done(err, projectImages, projectOverview)
}
})
},
// render projectOverview page
function(projectImages, projectOverview, done) {
console.log(projectImages);
partnerWebsites = helpers.stringToArray(projectOverview[0].partner_website);
partnerNames = helpers.stringToArray(projectOverview[0].partner_name);
awardSites = helpers.stringToArray(projectOverview[0].award_website);
awardNames = helpers.stringToArray(projectOverview[0].award_name);
sponsorWebsites = helpers.stringToArray(projectOverview[0].sponsor_website);
sponsorImgs = helpers.stringToArray(projectOverview[0].sponsor_img);
sponsorNames = helpers.stringToArray(projectOverview[0].sponsor_name);
res.render(lang+'/project/projectOverview', {
isUserAuthenticated: req.isAuthenticated(),
user: req.user,
projectOV: projectOverview,
projectImgs: projectImages,
partnerWS: partnerWebsites,
partnerN: partnerNames,
awardWS: awardSites,
awardN: awardNames,
sponsorWS: sponsorWebsites,
sponsorIMG: sponsorImgs,
sponsorN: sponsorNames
});
}
])
})
app.get('/videoconferences', function(req, res){
res.render(lang+'/project/videoconferences', {
isUserAuthenticated: req.isAuthenticated(),
user: req.user,
});
})
app.get('/landingpage', function(req, res){
res.render(lang+'/project/landingpage', {
isUserAuthenticated: req.isAuthenticated(),
user: req.user,
});
})
};
\ No newline at end of file
doctype html
html(lang="de")
head
title= "404 - Page not found"
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/bootstrap.css")
style.
.container {
height: 400px;
position: relative;
}
.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
body
div(class="container")
div(class="center", align="center")
a(href="https://m4lab.hft-stuttgart.de")
img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192")
br
br
p(class="h5") 404. The requested URL was not found.
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
\ No newline at end of file
doctype html
html(lang="de")
head
title= "500 - Internal Server Error"
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/bootstrap.css")
style.
.container {
height: 400px;
position: relative;
}
.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
body
div(class="container")
div(class="center", align="center")
a(href="https://m4lab.hft-stuttgart.de")
img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192")
br
br
p(class="h5") 500. Unexpected Error :(
p #{ error }
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
\ No newline at end of file
doctype html
html(lang="de")
head
title= "Forgot Password"
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/bootstrap.css")
link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/custom/login.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-md-6 offset-md-3")
if successes
for success in successes
div.alert.alert-success.alert-dismissible #{ success }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
if errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form#forgotForm(class="form-signin", method="POST")
img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192")
div(class="form-row")
input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="E-Mail-Adresse" required)
br
input(type="submit", class="btn btn-outline-dark btn-block", value="Passwort zurücksetzen")
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB
script(src="/js/headfoot.js")
doctype html
html(lang="de")
head
title= "User Account"
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/bootstrap.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-3")
h5
span #{user.firstname} #{user.lastname}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="/account/profile" aria-selected="true") Benutzerprofil
a(class="nav-link" href="/account/security" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="/account/services" aria-selected="false") Projekte und Dienste
a(class="nav-link" href="/logout" aria-selected="false") Logout
div(class="col-sm-9")
p content goes here
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB
script(src="/js/headfootLogout.js")
\ No newline at end of file
doctype html
html(lang="de")
head
title= "User Profile"
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/bootstrap.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-3")
h5
span #{user.firstname} #{user.lastname}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="#" aria-selected="true") Benutzerprofil
a(class="nav-link" href="/account/security" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="/account/services" aria-selected="false") Projekte und Dienste
a(class="nav-link" href="/logout" aria-selected="false") Logout
div(class="col-sm-9")
if successes
for success in successes
div.alert.alert-success.alert-dismissible #{ success }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
if errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form#profileForm(method="POST", action="/account/updateProfile")
div(class="form-row")
div(class='form-group col-md-2')
label(for="title") Anrede
select#inputSalutation(name="inputSalutation", class="form-control", , value=user.salutation)
option(value="") - Anrede -
option(value="Herr") Herr
option(value="Frau") Frau
option(value="Divers") Divers
script.
var salutationOptions = document.getElementById('inputSalutation').options;
for (i=0; i < salutationOptions.length; i++) {
if (salutationOptions[i].value == '#{user.salutation}')
salutationOptions[i].selected = true;
}
div(class='form-group col-md-2')
label(for="title") Titel
select#inputTitle(name="inputTitle", class="form-control", value=user.title)
option(value="") - Titel -
option(value="Prof.") Prof.
option(value="Dr.") Dr.
option(value="Dipl.-Ing.") Dipl.-Ing.
script.
var titleOptions = document.getElementById('inputTitle').options;
for (i=0; i < titleOptions.length; i++) {
if (titleOptions[i].value == '#{user.title}')
titleOptions[i].selected = true;
}
div(class='form-group col-md-2')
label(for="firstname") Vorname
input#inputFirstname(name="inputFirstname", type="text", class="form-control", placeholder="Vorname", value=user.firstname required)
div(class='form-group col-md-2')
label(for="lastname") Nachname
input#inputLastname(name="inputLastname", type="text", class="form-control", placeholder="Nachname", value=user.lastname required)
div(class="form-row")
div(class='form-group col-md-8')
label(for="email") E-mail Adresse
input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="Email", value=email required)
div(class="form-row")
div(class='form-group col-md-8')
label(for="organisation") Unternehmen
input#inputOrganisation(name="inputOrganisation", type="text", class="form-control", placeholder="Unternehmen", value=user.organisation)
div(class="form-row")
div(class='form-group col-md-8')
label(for="industry") Branche
input#inputIndustry(name="inputIndustry", type="text", class="form-control", placeholder="Branche", value=user.industry)
div(class="form-row")
div(class='form-group col-md-8')
label(for="speciality") Fachgebiete
input#inputSpeciality(name="inputSpeciality", type="text", class="form-control", placeholder="Fachgebiete", value=user.speciality)
input(type="submit", class="btn btn-primary", value="Speichern")
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB
script(src="/js/headfootLogout.js")
\ No newline at end of file
doctype html
html(lang="de")
head
title= "Create New Account"
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/bootstrap.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
.warning {
color: red;
font-size: 11px;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-md-6 offset-md-2")
h3(class="mb-3 font-weight-bold") Neues Benutzerkonto anlegen
div(class="col-md-6 offset-md-3")
if successes
for success in successes
div.alert.alert-success.alert-dismissible #{ success }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
if errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form(method="POST")
h5(class="mb-3 font-weight-bold") Anmeldedaten
div(class='form-row')
div(class='form-group col-md-6')
input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="E-Mail-Adresse*", maxlength="45" required)
span#emailWarning(class='warning')
div(class="form-group col-md-6")
input#inputPassword(name="inputPassword", type="password", class="form-control", data-toggle="password", placeholder="Passwort*", maxlength="45" required)
span#passwordWarning(class='warning')
h5(class="mb-3 font-weight-bold") Benutzerprofil
div(class="form-row")
div(class='form-group col-md-2')
select#inputSalutation(name="inputSalutation", class="form-control")
option(value="") - Anrede -
option(value="Herr") Herr
option(value="Frau") Frau
option(value="Divers") Divers
div(class='form-group col-md-2')
select#inputTitle(name="inputTitle", class="form-control")
option(value="") - Titel -
option(value="Prof.") Prof.
option(value="Dr.") Dr.
option(value="Dipl.-Ing.") Dipl.-Ing.
div(class='form-group col-md-4')
input#inputFirstname(name="inputFirstname", type="text", class="form-control", placeholder="Vorname*", maxlength="45" required)
div(class='form-group col-md-4')
input#inputLastname(name="inputLastname", type="text", class="form-control", placeholder="Nachname*", maxlength="45" required)
div(class="form-group")
input#inputOrganisation(name="inputOrganisation", type="text", class="form-control", placeholder="Unternehmen", maxlength="45")
div(class="form-group")
input#inputIndustry(name="inputIndustry", type="text", class="form-control", placeholder="Branche", maxlength="45")
div(class="form-group")
input#inputSpeciality(name="inputSpeciality", type="text", class="form-control", placeholder="Fachgebiete", maxlength="100")
p <em><small>* Pflichtfeld</small></em>
input#submitBtn(type="submit", class="btn btn-outline-dark btn-block", value="Senden" disabled)
br
p(class="text-center") Sie haben bereits ein Benutzerkonto? <a href="/account/">Melden Sie sich hier an</a>.
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// toggle password
script(src='https://unpkg.com/bootstrap-show-password@1.2.1/dist/bootstrap-show-password.min.js')
// M4_LAB
script(src="/js/generalFunction.js")
script(src="/js/registration.js")
script(src="/js/headfoot.js")
\ No newline at end of file
doctype html
html(lang="de")
head
title= "Reset Password"
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/bootstrap.css")
link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/custom/login.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-md-6 offset-md-3")
if successes
for success in successes
div.alert.alert-success.alert-dismissible #{ success }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
if errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form#forgotForm(method="POST", class="form-signin")
img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192")
div(class="form-row")
input#inputNewPwd(name="inputNewPwd", type="password", class="form-control", placeholder="Neues Passwort" required)
span#recommendation(class='warning')
input#inputConfirm(name="inputConfirm", type="password", class="form-control", placeholder="Passwort bestätigen" required)
span#message(class='warning')
input#updateBtn(type="submit", class="btn btn-outline-dark btn-block", value="Passwort ändern" disabled)
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB
script(src="/js/security.js")
script(src="/js/generalFunction.js")
script(src="/js/headfoot.js")
doctype html
html(lang="de")
head
title= "User Profile"
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/bootstrap.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
.warning {
font-size: 11px;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-3")
h5
span #{user.firstName} #{user.lastName}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="/account/profile" aria-selected="true") Benutzerprofil
a(class="nav-link" href="#" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="/account/services" aria-selected="false") Projekte und Dienste
a(class="nav-link" href="/logout" aria-selected="false") Logout
div(class="col-sm-9")
if successes
for success in successes
div.alert.alert-success.alert-dismissible #{ success }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
if errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form(class="needs-validation", method="post", action="/account/changePwd" novalidate)
div(class="form-group row")
label(for="currPwd") Aktuelles Passwort
input(id="inputCurrPwd", name="inputCurrPwd", type="password", class="form-control" required)
div(class="invalid-feedback") Bitte füllen Sie dieses Feld aus.
div(class="form-group row")
label(for="newPwd") Neues Passwort
input#inputNewPwd(name="inputNewPwd", type="password", class="form-control" required)
span#recommendation
div(class="invalid-feedback") Bitte füllen Sie dieses Feld aus.
div(class="form-group row")
label(for="confirm") Bestätigen Sie das neue Passwort
input#inputConfirm(name="inputConfirm", type="password", class="form-control" required)
span#message
div(class="invalid-feedback") Bitte füllen Sie dieses Feld aus.
input#updateBtn(type="submit", class="btn btn-primary", value="Passwort ändern" disabled)
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB
script(src="/js/security.js")
script(src="/js/generalFunction.js")
script(src="/js/headfootLogout.js")
script.
// check input fields
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
doctype html
html(lang="de")
head
title= "User Profile"
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/bootstrap.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-3")
h5
span #{user.firstName} #{user.lastName}
div(class="nav flex-column nav-pills", id="v-pills-tab", role="tablist", aria-orientation="vertical")
a(class="nav-link" href="/account/profile" aria-selected="true") Benutzerprofil
a(class="nav-link" href="/account/security" aria-selected="false") Sicherheitseinstellungen
a(class="nav-link" href="#" aria-selected="false") Projekte und Dienste
a(class="nav-link" href="/logout" aria-selected="false") Logout
div(class="col-sm-9")
if successes
for success in successes
div.alert.alert-success.alert-dismissible #{ success }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
if errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
table
for item in project
tr
td <strong>#{item.title}</strong>
if item.userStatus
td
button(type="button", class="btn btn-secondary", onclick="unsubscribe()") Projektbeteiligung beenden
else
td
button(type="button", class="btn btn-success", onclick="subscribe()") Am Projekt beteiligen
tr
td(colspan="2") #{item.summary}
tr
td(colspan="2") <i>Ansprechpartner: #{item.cp}</i>
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB
script(src="/js/headfootLogout.js")
script.
function subscribe() {
alert("To be implemented: Ihre Anfrage wird an den zuständigen Projektleiter gesendet.")
}
function unsubscribe() {
alert("To be implemented: Ihre Projektbeteiligung wurde beendet und der zuständige Projektleiter in Kenntnis gesetzt.")
}
\ No newline at end of file
doctype html
html(lang="de")
head
title= "Add Project Overview"
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/bootstrap.css")
link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
// jQuery UI - Datepicker
link(rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css")
style.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
.warning {
color: red;
font-size: 11px;
}
body
div(class="container-fluid")
div(class="row")
div(class="col-md-6 offset-md-2")
h4(class="mb-3 font-weight-bold") Neues Projekt
div(class="col-md-6 offset-md-3")
if errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") &times;
form(method="POST")
div(class='form-row')
div(class='form-group col-md-12')
input#inputPname(name="pname" class="form-control" type="text" placeholder="Projekttitel*" required)
div(class="form-group col-md-12")
input#inputTitle(name="title" class="form-control" type="text" placeholder="Akronym*" required)
div(class="form-group col-md-12")
input#inputSummary(name="summary" class="form-control" type="text" placeholder="Kurzbeschreibung")
div(class='form-group col-md-12')
select#inputCategory(name="category", class="form-control")
option(value="") - Projektkategorie -
option(value="Experten-Gruppe") Experten-Gruppe
option(value="Student-Projekt") Student-Projekt
option(value="Lehr Projekt") Lehr Projekt
option(value="Transfer-projekt") Transfer-projekt
div(class="form-group col-md-12")
input#inputLogo(name="logo" class="form-control" type="text" placeholder="Projektlogo, to be implemented: upload picture")
div(class="form-group col-md-12")
div(class="input-group mb-3")
input#inputGitlabURL(name="gitlabURL" type="text" class="form-control" placeholder="M4_LAB GitLab Project URL, z.B. https://transfer.hft-stuttgart.de/gitlab/username/projectname")
div(class="input-group-prepend")
div(class="input-group-text")
input#inputWiki(name="wiki" type="checkbox")
| &nbsp; Wiki
h5(class="mb-3 font-weight-bold") Inhalte
div(class='form-row')
div(class='form-group col-md-12')
textarea#inputOverview(name="overview" class="form-control" type="text" rows="5" placeholder="Projektüberblick")
div(class="form-group col-md-12")
textarea#inputQuestion(name="question" class="form-control" type="text" rows="5" placeholder="Fragestellung")
div(class='form-group col-md-12')
textarea#inputApproach(name="approach" class="form-control" type="text" rows="5" placeholder="Vorgehensweise")
div(class="form-group col-md-12")
textarea#inputResult(name="result" class="form-control" type="text" rows="5" placeholder="Ergebnis und Nutzung")
div(class="form-group col-md-12")
input#inputKeywords(name="keywords" class="form-control" type="text" placeholder="keywords")
h5(class="mb-3 font-weight-bold") Projektinformationen
div(class='form-row')
div(class='form-group col-md-12')
input#inputAnnouncement(name="announcement" class="form-control" type="text" rows="5" placeholder="Ausschreibung")
div(class="form-group col-md-12")
div(class='form-row')
div(class="form-group col-md-2")
<p class="font-weight-normal">Laufzeit</p>
div(class="form-group col-md-5")
input#inputTermFrom(name="termForm" class="form-control" type="text" placeholder="von (dd.mm.yyyy)")
div(class="form-group col-md-5")
input#inputTermTo(name="termTo" class="form-control" type="text" placeholder="bis (dd.mm.yyyy)")
div(class='form-group col-md-12')
textarea#inputFurtherDetails(name="furtherDetails" class="form-control" type="text" rows="5" placeholder="Weitere Informationen (bspw. Links zu Berichten)")
div(class="form-group col-md-12")
input#inputWebsite(name="website" class="form-control" type="text" placeholder="Projekt-Website")
h5(class="mb-3 font-weight-bold") Bilder
div(class='form-row')
div(class="form-group col-md-12")
input#inputSrc(name="src" class="form-control" type="text" placeholder="To be implemented: upload picture")
div(class="form-group col-md-12")
input#inputCaption(name="caption" class="form-control" type="text" placeholder="Bildunterschrift/Bildquelle")
h5(class="mb-3 font-weight-bold") Kontakt
div(class='form-row')
div(class="form-group col-md-2")
<p class="font-weight-normal">Ansprechperson</p>
div(class="form-group col-md-5")
input#inputContactName(name="contactName" class="form-control" type="text" placeholder="Anrede, Titel, Vorname, Nachname")
div(class="form-group col-md-5")
input#inputContactEmail(name="contactEmail" class="form-control" type="email" placeholder="E-Mail-Adresse")
div(class="form-group col-md-2")
<p class="font-weight-normal">Projektleitung</p>
div(class="form-group col-md-5")
input#inputLeaderName(name="leaderName" class="form-control" type="text" placeholder="Anrede, Titel, Vorname, Nachname")
div(class="form-group col-md-5")
input#inputLeaderEmail(name="leaderEmail" class="form-control" type="email" placeholder="E-Mail-Adresse")
p <em><small>* Pflichtfeld</small></em>
input#submitBtn(type="submit", class="btn btn-outline-dark btn-block", value="Projekt Anlegen")
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// jQuery UI - Datepicker
script(src="https://code.jquery.com/ui/1.12.1/jquery-ui.js")
script(src="/js/jquery-ui/i18n/datepicker-de.js")
//script(src="i18n/datepicker-de.js")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header
script(src="/js/headfootLogout.js")
script.
$( function() {
$.datepicker.setDefaults( $.datepicker.regional["de"] );
$("#inputTermFrom").datepicker();
$("#inputTermTo").datepicker();
});
\ No newline at end of file
<!-- content -->
<div class="flex-container" style="align-items:flex-start">
<div id="Textblock-startseite" class="text" style="flex-basis:600px">
<div style="flex-grow: 1">
<p>
<h1>Als innovative Hochschule wollen wir den Wandel in der Gesellschaft zukunftsfähig und verantwortungsvoll mitgestalten.</h1>
<br/>
<h2>Unser Ziel ist die Beantwortung gesellschaftlich relevanter Zukunftsfragen.</h2>
Diese bearbeiten wir durch Forschungs-, Innovations- und Transferprojekte und entwickeln dabei anwendungsbezogene Lösungen.
Als Impulsgeber ermöglichen wir den Transfer innovativer Ideen, indem wir Kooperationen fördern und Räume für kreativen Austausch schaffen.
<br/>
Dabei verknüpfen wir unsere Expertise mit Partnern innerhalb und außerhalb der Region Stuttgart. Wir informieren und involvieren Interessierte und Beteiligte durch die unterschiedlichsten Events und Formate.
<br/>
<h2>Willst du dabei sein?</h2>
Dann findest du unter <span onclick="event.stopPropagation();hint_navbar('0')" ><i class="fas fa-chevron-right"></i> Informationen</span> mehr über unsere Expertise, Projekte, Publikationen und Lösungen.
<br/>
Erfahre mehr über unsere <span onclick="event.stopPropagation();hint_navbar('2')" ><i class="fas fa-chevron-right"></i> Events</span> und über die Möglichkeiten zur <span onclick="event.stopPropagation();hint_navbar('1')" ><i class="fas fa-chevron-right"></i> Zusammenarbeit</span>.
</p>
</div>
</div>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" style="flex-basis: 50%" style="flex-grow: 1">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<i class="fas fa-chevron-left"></i>
<!-- <span class="carousel-control-prev-icon" aria-hidden="true"></span>-->
<span class="sr-only">Previous</span>
</a>
<div class="carousel-inner" role="listbox">
<div class="carousel-item">
<img class="d-block w-100" src="/images/3DModell_Wermelskirchen_Startseite.jpg" alt="First slide">
<div id="Bildunterschrift-slide1" class="Bildunterschrift">
<br>
<p><a href="/projectoverview?projectID=3" ><i class="fas fa-chevron-right"></i> AG Qualität zur Definition von 3D-Stadtmodellen</a></p>&emsp;
</div>
</div>
<div class="carousel-item active">
<img class="d-block w-100" src="/images/M4_LAB_Vision.gif" alt="Second slide">
<div id="Bildunterschrift-slide2" class="Bildunterschrift">
<br>
<p><a href="/projectoverview?projectID=1" ><i class="fas fa-chevron-right"></i> Innovationslabor M4_LAB</a></p>&emsp;
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="/images/SmartPollen_Projekt/SmartPollenM2GIF.gif" alt="Third slide">
<div id="Bildunterschrift-slide3" class="Bildunterschrift">
<br>
<p><a href="/projectoverview?projectID=2" ><i class="fas fa-chevron-right"></i> Studierendenprojekt Smart-Pollen</a></p>&emsp;
</div>
</div>
</div>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<i class="fas fa-chevron-right"></i>
<!-- <span class="carousel-control-next-icon" aria-hidden="true"></span>-->
<span class="sr-only">Next</span>
</a>
</div>
</div>
\ No newline at end of file
doctype html
html(lang="de")
head
title= "Project List"
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/bootstrap.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
.warning {
color: red;
font-size: 11px;
}
body
include landingpage.html
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header
if isUserAuthenticated
script(src="/js/headfootLogout.js")
else
script(src="/js/headfoot.js")
\ No newline at end of file
html(lang="de")
head
title= "Mailinglisten"
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/bootstrap.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.
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
-webkit-transition-duration: .35s;
-o-transition-duration: .35s;
transition-duration: .35s;
-webkit-transition-property: height,visibility;
-o-transition-property: height,visibility;
transition-property: height,visibility;
}
body
<hr />
div()
h5(align="left") Aktive Mailinglisten
div(class="flex-container" style="align-items:flex-start")
div(class="table")
table(border="0" id="listtable" class="table table-striped")
thead
tr
th Name
th Link
th zugeh. Projekt
tbody
for item in mailinglists
if item.projectstatus == '1'
tr
td #{item.name}
td <a href="#{item.src}">#{item.src}</a>
td <a href='projectoverview?projectID=#{item.id}'>#{item.project_title}</a>
<hr />
div()
h5(align="left") Eintragung in Mailingliste
p() Wenn Sie sich in eine Mailingliste eintragen wollen, folgen Sie folgender Anleitung:
// jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
// Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header
if isUserAuthenticated
script(src="/js/headfootLogout.js")
else
script(src="/js/headfoot.js")
\ No newline at end of file
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