diff --git a/README.md b/README.md
index 0de3d9460f1eaa4c504408716c08d3b039b63e04..1ca41b18c0974529f197555999bceb6f79d86794 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
User Account Management
-Re-implementation of https://transfer.hft-stuttgart.de/gitlab/sihombing/portal/tree/master/app-useracc using NodeJS and ExpressJS
\ No newline at end of file
+This is the repository of the User Account of the TransferPortal.
\ No newline at end of file
diff --git a/__tests__/gitlab.unit.test.js b/__tests__/gitlab.unit.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..057f020d31d6acb893da43f021e16f4833125005
--- /dev/null
+++ b/__tests__/gitlab.unit.test.js
@@ -0,0 +1,32 @@
+const gitlab = require('../functions/gitlab')
+//const axios = require('axios')
+//jest.mock('axios')
+
+describe('GitLab API', () => {
+ test('returns an existing gitlab user by an email address', async () => {
+ let user = await gitlab.getUserByEmail('litehon958@whipjoy.com')
+ expect(user).not.toBeNull()
+ })
+ test('returns an undefined user', async () => {
+ let user = await gitlab.getUserByEmail('johndoe@nowhere.com')
+ expect(user).toBeUndefined()
+ })
+
+ test('returns users project', async () => {
+ let userProjects = await gitlab.getUserProjects(136)
+ expect(userProjects).toBeDefined()
+ })
+ test('returns undefined projects, due to non-existing gitlab user ID', async () => {
+ let userProjects = await gitlab.getUserProjects(0)
+ expect(userProjects).toBeUndefined()
+ })
+
+ test('returns a project by ID', async () => {
+ let project = await gitlab.getProjectById(13) // m4lab_landing_page
+ expect(project).toBeDefined()
+ })
+ test('returns undefined, due to invalid project ID', async () => {
+ let project = await gitlab.getProjectById(0)
+ expect(project).toBeUndefined()
+ })
+})
\ No newline at end of file
diff --git a/__tests__/method.unit.test.js b/__tests__/method.unit.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..1673830dbb0fdeeceaf33a9769c76db0bdbc6c5a
--- /dev/null
+++ b/__tests__/method.unit.test.js
@@ -0,0 +1,52 @@
+const methods = require('../functions/methods')
+
+describe("DB methohds test", () => {
+
+ it("returns a user from DB by email", async() => {
+ const user = await methods.getUserByEmail('litehon958@whipjoy.com')
+ expect(user).not.toBeNull()
+ })
+ it("returns a null user", async() => {
+ const user = await methods.getUserByEmail('jondoe@nowhere.com') // a non-exist user
+ expect(user).toBeNull()
+ })
+
+ it("returns a user's email", async() => {
+ const email = await methods.getUserEmailById(1)
+ expect(email).not.toBeNull()
+ })
+ it("returns null instead of a user's email", async() => {
+ const email = await methods.getUserEmailById(1005) // no user has this ID
+ expect(email).toBeNull()
+ })
+
+ it("returns null from DB by token", async() => {
+ const user = await methods.getUserByToken('12345678') // unvalid token
+ expect(user).toBeNull() // for valid token = expect(user).not.toBeNull()
+ })
+
+ it("returns a user's verification token, if any", async() => {
+ const token = await methods.getVerificationTokenByUserId(1)
+ expect(token).toBeNull()
+ })
+
+ it("returns a user's ID, if any", async() => {
+ const token = await methods.getUserIdByVerificationToken('12345678') // unvalid token
+ expect(token).toBeNull() // for valid token = expect(user).not.toBeNull()
+ })
+
+ it("returns a user's GitLab_ID, if any", async() => {
+ const id = await methods.getGitlabId(1)
+ expect(id).not.toBeNull()
+ })
+
+ it("checks user email", async() => {
+ const user = await methods.checkUserEmail('litehon958@whipjoy.com')
+ expect(user).not.toBeNull()
+ })
+ it("checks user email and return null", async() => {
+ const user = await methods.checkUserEmail('jondoe@nowhere.com') // a non-exist user
+ expect(user).toBeNull()
+ })
+
+})
diff --git a/app.js b/app.js
index daa834687668783442c512e9e1ad7e1e466e4c79..b5aac0bc6362999b0cb402096628af41d12a362c 100644
--- a/app.js
+++ b/app.js
@@ -7,19 +7,15 @@ const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const session = require('express-session');
const errorhandler = require('errorhandler');
-const flash = require('express-flash');
+const flash = require('express-flash-2');
const fileUpload = require('express-fileupload');
const helmet = require('helmet');
const compression = require('compression');
-
-const i18n = require('i18n'); // internationalization
-i18n.configure({
- locales:['de', 'en'],
- directory: './locales'
-});
+const methodOverride = require('method-override');
var env = process.env.NODE_ENV || 'testing';
const config = require('./config/config')[env];
+const lang = 'DE';
var app = express();
@@ -35,6 +31,7 @@ app.use(fileUpload({
}
}));
+app.use(methodOverride('_method'));
app.use(helmet());
app.use(compression());
app.use(morgan('combined'));
@@ -42,9 +39,7 @@ app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(express.static(path.join(__dirname, 'public')));
-app.use(i18n.init);
app.use((req, res, next) => {
- res.setLocale('de');
next();
});
@@ -52,16 +47,10 @@ app.use(session(
{
resave: true,
saveUninitialized: true,
- secret: 'thisisasecret'
+ secret: config.app.sessionSecret
}
));
app.use(flash());
-app.use((req, res, next) => {
- res.locals.errors = req.flash("error");
- res.locals.successes = req.flash("success");
- next();
-});
-
app.use(passport.initialize());
app.use(passport.session());
@@ -72,19 +61,18 @@ app.use(function(req, res, next) {
next();
});
-require('./routes/routes-account')(app, config, passport, i18n);
-require('./routes/api')(app, config, passport);
+require('./routes/account')(app, config, passport, lang);
+require('./routes/public')(app, config, lang);
// Handle 404
-app.use(function (req, res, next) {
- //res.status(404).send('404: Page not Found', 404)
- res.status(404).render('./DE/404')
+app.use(function (req, res) {
+ res.status(404).render(lang+'/404')
})
// Handle 500 - any server error
app.use(function (err, req, res, next) {
console.error(err.stack)
- res.status(500).render('./DE/500', {
+ res.status(500).render(lang+'/500', {
error: err
})
})
diff --git a/classes/project.js b/classes/project.js
new file mode 100644
index 0000000000000000000000000000000000000000..85dafab3830e16ea3db1c50802a4a3a38e2988ed
--- /dev/null
+++ b/classes/project.js
@@ -0,0 +1,51 @@
+class Project {
+ constructor(ownerGitlabId, id, name, desc, logo, path) {
+ this.ownerGitlabId = ownerGitlabId
+ this.id = id
+ this.name = name
+ this.desc = desc
+ this.logo = logo
+ this.path = path
+ }
+
+ // getter
+ getOwnerGitlabId() {
+ return this.ownerGitlabId
+ }
+ getId() {
+ return this.id
+ }
+ getName() {
+ return this.name
+ }
+ getDesc() {
+ return this.desc
+ }
+ getLogo() {
+ return this.logo
+ }
+ getPath() {
+ return this.path
+ }
+ // setter
+ setOwnerGitlabId(newOwnerGitlabId){
+ this.ownerGitlabId = newOwnerGitlabId
+ }
+ setId(newId) {
+ this.id = newId
+ }
+ setName(newName) {
+ this.name = newName
+ }
+ setDesc(newDesc) {
+ this.desc = newDesc
+ }
+ setLogo(newLogoUrl) {
+ this.logo = newLogoUrl
+ }
+ setPath(newPath) {
+ this.path = newPath
+ }
+}
+
+module.exports = Project
\ No newline at end of file
diff --git a/classes/repo.js b/classes/repo.js
new file mode 100644
index 0000000000000000000000000000000000000000..c99ac66f6e4ada393426c40df94c2a25335d96d1
--- /dev/null
+++ b/classes/repo.js
@@ -0,0 +1,9 @@
+const Project = require("./project");
+
+class Repo extends Project {
+ constructor(ownerGitlabId, id, name, desc, logo, path) {
+ super(ownerGitlabId, id, name, desc, logo, path)
+ }
+}
+
+module.exports = Repo
\ No newline at end of file
diff --git a/classes/user.js b/classes/user.js
new file mode 100644
index 0000000000000000000000000000000000000000..94f07edd3f8c382b22504f0e356f84506011d662
--- /dev/null
+++ b/classes/user.js
@@ -0,0 +1,83 @@
+class User {
+ constructor(id, email, salutation, title, firstName, lastName, industry, organisation, speciality, is_m4lab_idp, gitlabUserId, verificationStatus) {
+ this.id = id
+ this.email = email
+ this.salutation = salutation
+ this.title = title
+ this.firstName = firstName
+ this.lastName = lastName
+ this.industry = industry
+ this.organisation = organisation
+ this.speciality = speciality
+ this.is_m4lab_idp = is_m4lab_idp // 1 or 0
+ this.gitlabUserId = gitlabUserId
+ this.verificationStatus = verificationStatus
+ }
+
+ // getter
+ getId() {
+ return this.id
+ }
+ getEmail() {
+ return this.email
+ }
+ getFullName() {
+ return this.firstName+' '+this.lastName
+ }
+ getIdpStatus() {
+ return this.is_m4lab_idp
+ }
+ getGitlabUserId() {
+ return this.gitlabUserId
+ }
+ getVerificationStatus() {
+ return this.verificationStatus
+ }
+ // setter
+ setEmail(email) {
+ this.email = email
+ }
+ setSalutation(salutation) {
+ this.salutation = salutation
+ }
+ setTitle(title) {
+ this.title = title
+ }
+ setFirstName(firstName) {
+ this.firstName = firstName
+ }
+ setLastName(lastName) {
+ this.lastName = lastName
+ }
+ setIndustry(industry) {
+ this.industry = industry
+ }
+ setOrganisation(organisation) {
+ this.organisation = organisation
+ }
+ setSpeciality(speciality) {
+ this.speciality = speciality
+ }
+ setM4lab_idp(m4lab_idp) {
+ this.m4lab_idp = m4lab_idp
+ }
+ setGitlabUserId(newGitlabUserId) {
+ this.gitlabUserId = newGitlabUserId
+ }
+ setVerificationStatus(verificationStatus) {
+ this.verificationStatus = verificationStatus
+ }
+
+ updateProfile(newSalutation, newTitle, newFirstname, newLastname, newEmail, newOrganisation, newIndustry, newSpeciality) {
+ this.salutation = newSalutation
+ this.title = newTitle
+ this.firstName = newFirstname
+ this.lastName = newLastname
+ this.email = newEmail
+ this.organisation = newOrganisation
+ this.industry = newIndustry
+ this.speciality = newSpeciality
+ }
+}
+
+module.exports = User
\ No newline at end of file
diff --git a/classes/website.js b/classes/website.js
new file mode 100644
index 0000000000000000000000000000000000000000..1d05c40059221e15d8fa04fc43abee51d7e2190f
--- /dev/null
+++ b/classes/website.js
@@ -0,0 +1,9 @@
+const Project = require("./project");
+
+class Website extends Project {
+ constructor(ownerGitlabId, id, name, desc, logo, path) {
+ super(ownerGitlabId, id, name, desc, logo, path)
+ }
+}
+
+module.exports = Website
\ No newline at end of file
diff --git a/config/config.js b/config/config.js
index eaab87640d0e7c3eb28fc8c090654f238cafb4c2..3da503db74366867bbf006c3aa83d2bae8ddc0ea 100644
--- a/config/config.js
+++ b/config/config.js
@@ -3,7 +3,8 @@ module.exports = {
app: {
name: 'User Account Management',
port: process.env.PORT || 9989,
- host: 'http://localhost:9989'
+ host: 'http://localhost:9989',
+ sessionSecret: 'thisisasecret'
},
passport: {
strategy: 'saml',
@@ -31,13 +32,17 @@ module.exports = {
authPass: 'mailpass',
tlsCiphers: 'SSLv3',
from: 'mailfrom',
+ },
+ gitlab: {
+ token_readWriteProjects: 'token-goes-here'
}
},
testing: {
app: {
name: 'User Account Management',
port: process.env.PORT || 9989,
- host: 'https://m4lab.hft-stuttgart.de/account'
+ host: 'https://m4lab.hft-stuttgart.de/account',
+ sessionSecret: 'thisisasecret'
},
passport: {
strategy: 'saml',
@@ -65,6 +70,9 @@ module.exports = {
authPass: 'mailpass',
tlsCiphers: 'SSLv3',
from: 'mailfrom',
+ },
+ gitlab: {
+ token_readWriteProjects: 'token-goes-here'
}
}
}
\ No newline at end of file
diff --git a/config/const.js b/config/const.js
new file mode 100644
index 0000000000000000000000000000000000000000..dcbb821a4bf191c8a5ddd0dd10e9e0abab0a1c56
--- /dev/null
+++ b/config/const.js
@@ -0,0 +1,19 @@
+module.exports = {
+
+ mailSignature: 'Mit den besten Grüßen,
das Transferportal-Team der HFT Stuttgart
' +
+ 'Transferportal der Hochschule für Technik Stuttgart
' +
+ 'Schellingstr. 24 70174 Stuttgart
' +
+ 'm4lab@hft-stuttgart.de
' +
+ 'https://transfer.hft-stuttgart.de
' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ '' +
+ '' +
+ '
',
+ updatePasswordMailSubject: "Ihr Passwort für das Transferportal wurde gespeichert.",
+ updatePasswordMailContent: '
Lieber Nutzer,
' +
+ '
herzlich willkommen beim Transferportal der HFT Stuttgart!
' +
+ 'Sie können nun alle Dienste des Portals nutzen.
' + constants.mailSignature;
+ mailer.options.to = userEmail
+ mailer.options.subject = emailSubject
+ mailer.options.html = emailContent
+ mailer.transport.sendMail(mailer.options, function(err) {
+ if (err) {
+ console.log('cannot send email')
+ throw err
+ }
+ })
+
+ res.render(lang+'/account/verification', {
+ status: true
+ })
+ }
+ }
+ })
+ }
+ })
+
+ // ==================== FORGOT PASSWORD ===========================
+
+ app.get('/forgotPwd', function (req, res) {
+ res.render(lang+'/account/forgotPwd', {
+ user: req.user
+ })
+ })
+ app.post('/forgotPwd', function(req, res) {
+ let emailAddress = req.body.inputEmail
+ async.waterfall([
+ function(done) {
+ crypto.randomBytes(20, function(err, buf) {
+ var token = buf.toString('hex')
+ done(err, token)
+ })
+ },
+ async function(token) {
+ let user = await methods.checkUserEmail(emailAddress)
+ if (!user) {
+ console.log('no user found')
+ } else {
+ var emailSubject = "Ihre Passwort-Anfrage an das Transferportal der HFT Stuttgart";
+ var emailContent = '
Lieber Nutzer,
' +
+ '
wir haben Ihre Anfrage zur Erneuerung Ihres Passwortes erhalten. Falls Sie diese Anfrage nicht gesendet haben, ignorieren Sie bitte diese E-Mail.
' +
+ 'Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: '+config.app.host+'/reset/' + token + '
' +
+ 'Dieser Link ist aus Sicherheitsgründen nur für 1 Stunde gültig.
' + constants.mailSignature + '
'
+
+ var credentialData = {
+ user_id: user.id,
+ resetPasswordToken: token,
+ resetPasswordExpires: Date.now() + 3600000 // 1 hour
+ }
+ methods.updateCredential(credentialData, function(err) {
+ if (err) { console.error(err) }
+ })
+
+ // send email
+ mailer.options.to = emailAddress
+ mailer.options.subject = emailSubject
+ mailer.options.html = emailContent
+ mailer.transport.sendMail(mailer.options, function(err) {
+ if (err) { console.error(err) }
+ })
+ }
+ }
+ ], function(err) {
+ if (err) {
+ res.flash('error', 'Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.')
+ }
+ else {
+ res.flash('success', 'Wenn Ihre E-Mail-Adresse registriert ist, wurde eine E-Mail mit dem weiteren Vorgehen an ' + emailAddress + ' versendet.')
+ }
+ res.redirect('/account/forgotPwd')
+ })
+ })
+
+ // reset
+ app.get('/reset/:token', async function(req, res) {
+ let user = await methods.getUserByToken(req.params.token)
+ if (!user) {
+ res.flash('error', 'Der Schlüssel zum zurücksetzen des Passworts ist ungültig oder abgelaufen.')
+ res.redirect('/account/forgotPwd')
+ } else {
+ res.render(lang+'/account/reset')
+ }
+ })
+ app.post('/reset/:token', async function(req, res) {
+ var newPwd = req.body.inputNewPwd
+
+ let user = await methods.getUserByToken(req.params.token)
+ if (!user) {
+ res.flash('error', "User not found.")
+ res.redirect('/login')
+ } else {
+ // encrypt password
+ bcrypt.genSalt(saltRounds, function(err, salt) {
+ bcrypt.hash(newPwd, salt, function(err, hash) {
+ var credentialData = {
+ password: hash,
+ user_id: user.user_id
+ }
+ // update password
+ methods.updateCredential(credentialData, function(err){
+ if (err) {
+ res.flash('error', "Datenbankfehler: Passwort kann nicht geändert werden.")
+ throw err
+ } else {
+ res.flash('success', "Passwort aktualisiert!")
+
+ // send notifiaction email
+ mailer.options.to = user.email
+ mailer.options.subject = constants.updatePasswordMailSubject
+ mailer.options.html = constants.updatePasswordMailContent+'
'+constants.mailSignature+'
'
+ mailer.transport.sendMail(mailer.options, function(err) {
+ if (err) { console.log(err) }
+ })
+
+ res.redirect('/login')
+ }
+ })
+ });
+ });
+ }
+
+ })
+
+ // ======================= CONTACT FORM ===========================
+
+ 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) {
+ console.error(err)
+ res.flash('error', 'Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.');
+ }
+ else {
+ res.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('/account/contact')
+ })
+ })
+
+}
\ No newline at end of file
diff --git a/routes/routes-account.js b/routes/routes-account.js
deleted file mode 100644
index 5e6292c184384c7be83f5a244d5972b665fe23ce..0000000000000000000000000000000000000000
--- a/routes/routes-account.js
+++ /dev/null
@@ -1,773 +0,0 @@
-const fs = require('fs')
-const SamlStrategy = require('passport-saml').Strategy
-const dbconn = require('./dbconn')
-const methods = require('./methods')
-// pwd encryption
-const bcrypt = require('bcryptjs');
-const saltRounds = 10;
-const salt = 64; // salt length
-// forgot pwd
-const async = require('async')
-const crypto = require('crypto')
-const mailer = require('./mailer')
-
-module.exports = function (app, config, passport, i18n) {
-
- // =========== PASSPORT =======
- passport.serializeUser(function (user, done) {
- done(null, user);
- });
-
- passport.deserializeUser(function (user, done) {
- done(null, user);
- });
-
- const mailSignature = 'Mit den besten Grüßen,
das Transferportal-Team der HFT Stuttgart
' +
- 'Transferportal der Hochschule für Technik Stuttgart
' +
- 'Schellingstr. 24 70174 Stuttgart
' +
- 'm4lab@hft-stuttgart.de
' +
- '
https://transfer.hft-stuttgart.de' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '' +
- '
'
-
- var samlStrategy = new SamlStrategy({
- // URL that goes from the Identity Provider -> Service Provider
- callbackUrl: config.passport.saml.path,
- // Base address to call logout requests
- logoutUrl: config.passport.saml.logoutUrl,
-
- entryPoint: config.passport.saml.entryPoint,
- issuer: config.passport.saml.issuer,
- identifierFormat: null,
-
- // Service Provider private key
- decryptionPvk: fs.readFileSync(__dirname + '/cert/key.pem', 'utf8'),
- // Service Provider Certificate
- privateCert: fs.readFileSync(__dirname + '/cert/key.pem', 'utf8'),
- // Identity Provider's public key
- cert: fs.readFileSync(__dirname + '/cert/cert_idp.pem', 'utf8'),
-
- validateInResponseTo: false,
- disableRequestedAuthnContext: true
- },
- function (profile, done) {
- return done(null, {
- id: profile.nameID,
- idFormat: profile.nameIDFormat,
- email: profile.email,
- firstName: profile.givenName,
- lastName: profile.sn
- });
- });
-
- passport.use(samlStrategy);
-
- // ============= SAML ==============
- app.post(config.passport.saml.path,
- passport.authenticate(config.passport.strategy,
- {
- failureRedirect: '/account/',
- failureFlash: true
- }),
- function (req, res) {
- res.redirect('/account/');
- }
- );
-
- // to generate Service Provider's XML metadata
- app.get('/saml/metadata',
- function(req, res) {
- res.type('application/xml');
- var spMetadata = samlStrategy.generateServiceProviderMetadata(fs.readFileSync(__dirname + '/cert/cert.pem', 'utf8'));
- res.status(200).send(spMetadata);
- }
- );
-
- // ================ test i18n ==================
- i18n.setLocale('de');
- app.get('/de', function(req, res) {
- var greeting = i18n.__('Hello World')
- res.send(greeting)
- });
-
- 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,
Ihr Passwort wurde erfolgreich geändert.
' + mailSignature + '
';
-
- app.get('/', function (req, res) {
- if (req.isAuthenticated()) {
- methods.getUserByEmail(req.user.email, function(data, err){
- if (!err) {
- res.render(lang+'/account/home', {
- user: data
- });
- }
- })
- } else {
- res.redirect('/login'); // localhost
- }
- });
-
- app.get('/login',
- passport.authenticate(config.passport.strategy,
- {
- successRedirect: '/',
- failureRedirect: '/login'
- })
- );
-
- app.get('/logout', function (req, res) {
- if (req.user == null) {
- return res.redirect('/');
- }
-
- req.user.nameID = req.user.id;
- req.user.nameIDFormat = req.user.idFormat;
- return samlStrategy.logout(req, function(err, uri) {
- req.logout();
-
- if ( req.session ) {
- req.session.destroy((err) => {
- if(err) {
- return console.log(err);
- }
- });
- }
-
- return res.redirect(uri);
- });
- });
-
- app.get('/profile', function (req, res) {
- if (req.isAuthenticated()) {
- methods.getUserByEmail(req.user.email, function(data, err){
- if (!err) {
- if (data.verificationStatus == 1) {
- console.log(data)
- res.render(lang+'/account/profile', {
- user: data,
- email: req.user.email
- })
- }
- else {
- res.render(lang+'/account/home', {
- user: data
- });
- }
- }
- })
- } else {
- res.redirect('/login');
- }
- });
-
- app.get('/services', function (req, res) {
- if (req.isAuthenticated()) {
- methods.getUserByEmail(req.user.email, function(data, err){
- if (!err) {
- if (data.verificationStatus == 1) {
- res.render(lang+'/account/services', {
- user: data
- });
- /* !!! DO NOT DELETE. TEMPORARILY DISABLED FOR FUTURE USE. !!!
- async.waterfall([
- // get userId by email from userdb
- function(done) {
- methods.getUserIdByEmail(req.user.email, function(userId, err) {
- if (!err) {
- done(err, userId)
- }
- })
- },
- // get user-project-role from userdb
- function(userId, done) {
- methods.getUserProjectRole(userId, function(userProjects, err) {
- if (!err) {
- done(err, userProjects)
- }
- })
- },
- // get all projects from projectdb
- function(userProjects, done) {
- methods.getAllProjects(function(projectsOverview, err) {
- if (!err) {
- done(err, userProjects, projectsOverview)
- }
- })
- },
- // create JSON object of projects and user status for front-end
- function(userProjects, projectsOverview, done) {
- var allProjects = [] // JSON object
-
- var userProjectId = [] // array of user's project_id
- for (var i = 0; i < userProjects.length; i++) {
- userProjectId.push(userProjects[i].project_id)
- }
-
- for (var i = 0; i < projectsOverview.length; i++) {
- // check if projectId is exist in userProjectId[]
- var status = false
- if (userProjectId.indexOf(projectsOverview[i].id) > -1) {
- status = true
- }
- // add data to JSON object
- allProjects.push({
- id: projectsOverview[i].id,
- title: projectsOverview[i].title,
- summary: projectsOverview[i].onelinesummary,
- cp: projectsOverview[i].contact_email,
- userStatus: status
- });
- }
-
- // render the page
- res.render(lang+'/account/services', {
- user: data,
- project: allProjects
- });
- }
- ])
- */
- }
- else {
- res.render(lang+'/account/home', {
- user: data
- });
- }
- }
- })
- } else {
- res.redirect('/login');
- }
- });
-
- app.get('/security', function (req, res) {
- if (req.isAuthenticated()) {
- methods.getUserByEmail(req.user.email, function(data, err){
- if (!err) {
- if (data.verificationStatus == 1 && data.m4lab_idp == 1) {
- res.render(lang+'/account/security', {
- user: data
- })
- }
- else {
- res.render(lang+'/account/home', {
- user: data
- });
- }
- }
- })
- } else {
- res.redirect('/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,
- email: req.body.inputEmail,
- organisation: req.body.inputOrganisation,
- industry: req.body.inputIndustry,
- speciality: req.body.inputSpeciality,
- }
-
- if (req.isAuthenticated()) {
- if (userData.email) {
- dbconn.user.query('UPDATE user SET ? WHERE email = "' +userData.email+'"', userData, function (err, rows, fields) {
- //if (err) throw err;
- if (err) {
- req.flash('error', "Failed");
- }
- else {
- //req.flash('success', 'Profile updated!');
- req.flash('success', 'Ihr Benutzerprofil wurde aktualisiert!');
- }
- res.redirect('/account/profile');
- })
- }
- } else {
- res.redirect('/login');
- }
- });
-
- app.post('/changePwd', function (req, res) {
- if (req.isAuthenticated()) {
- var currPwd = req.body.inputCurrPwd
- var newPwd = req.body.inputNewPwd
- var retypePwd = req.body.inputConfirm
-
- methods.getUserIdByEmail(req.user.email, function(userId, err) {
- if (!err) {
- // Load hashed passwd from DB
- dbconn.user.query('SELECT password FROM credential WHERE user_id='+userId, function (err, rows, fields) {
- if (err) {
- console.error(err)
- res.status(500).render(lang+'/500', {
- error: err
- })
- }
- var userPwd = rows[0].password
-
- // check if the password is correct
- bcrypt.compare(currPwd, userPwd, function(err, isMatch) {
- if (err) {
- console.error(err)
- res.status(500).render(lang+'/500', {
- error: err
- })
- }
- else if (!isMatch) {
- //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.")
- req.flash('error', 'Passwörter stimmen nicht überein. Bitte stellen Sie sicher, dass Sie das Passwort beide Male genau gleich eingeben.')
- res.redirect('/account/security')
- }
- else {
- // update password
- bcrypt.genSalt(saltRounds, function(err, salt) {
- bcrypt.hash(newPwd, salt, function(err, hash) {
- var credentialData = {
- password: hash,
- user_id: userId
- }
- methods.updateCredential(credentialData, function(err){
- if (err) {
- //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!")
- 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.html = updatePasswordMailContent
- mailer.transport.sendMail(mailer.options, function(err) {
- if (err) {
- console.log(err)
- }
- });
- }
- res.redirect('/account/security')
- })
- });
- });
- }
- }
- })
- })
- }
- })
- }
- else {
- res.redirect('/login');
- }
- });
-
- app.get('/forgotPwd', function (req, res) {
- res.render(lang+'/account/forgotPwd', {
- user: req.user
- });
- });
-
- app.post('/forgotPwd', function(req, res, next) {
- //methods.currentDate();
-
- var emailAddress = req.body.inputEmail;
- /* 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"; */
-
- async.waterfall([
- function(done) {
- crypto.randomBytes(20, function(err, buf) {
- var token = buf.toString('hex');
- done(err, token);
- });
- },
- function(token, done) {
- methods.checkUserEmail(emailAddress, function(err, user){
- if (user) {
- console.log("email: user found");
- //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://m4lab.hft-stuttgart.de/account/reset/" + token + "\n" +
- "This password reset is only valid for 1 hour.\n\n"+
- "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 emailContent = '
Lieber Nutzer, Varun
' +
- '
wir haben Ihre Anfrage zur Erneuerung Ihres Passwortes erhalten. Falls Sie diese Anfrage nicht gesendet haben, ignorieren Sie bitte diese E-Mail.
' +
- 'Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://m4lab.hft-stuttgart.de/account/reset/' + token + '
' + // test server
- 'Dieser Link ist aus Sicherheitsgründen nur für 1 Stunde gültig.
' + mailSignature + '
';
-
- var credentialData = {
- user_id: user.id,
- resetPasswordToken: token,
- resetPasswordExpires: Date.now() + 3600000 // 1 hour
- }
- methods.updateCredential(credentialData, function(err) {
- done(err, token, user);
- });
-
- // send email
- mailer.options.to = emailAddress;
- mailer.options.subject = emailSubject;
- mailer.options.html = emailContent;
- mailer.transport.sendMail(mailer.options, function(err) {
- done(err, 'done');
- });
- }
- else {
- //done(err, null, null);
- done(err, 'no user found');
- }
- });
- }
- ], function(err) {
- if (err) {
- //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', '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'); // deployment
- res.redirect('/account/forgotPwd'); // localhost
- });
- });
-
- app.get('/reset/:token', function(req, res) {
- methods.getUserByToken(req.params.token, function(err, user){
- if (!user) {
- //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'); // deployment
- }
- else {
- res.render(lang+'/account/reset');
- }
- });
- });
-
- app.post('/reset/:token', function(req, res) {
- 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(newPwd, salt, function(err, hash) {
- var credentialData = {
- password: hash,
- user_id: user.user_id
- }
- // update password
- methods.updateCredential(credentialData, function(err){
- if (err) {
- //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.")
- req.flash('success', "Passwort aktualisiert!")
- // send notifiaction email
- mailer.options.to = user.email
- mailer.options.subject = updatePasswordMailSubject
- mailer.options.html = updatePasswordMailContent
- mailer.transport.sendMail(mailer.options, function(err) {
- if (err) {
- console.log(err)
- }
- });
- // redirect to login page
- res.redirect('/login')
- }
- })
- });
- });
- }
- else {
- req.flash('error', "User not found.")
- res.redirect('/login')
- }
- });
-
- });
-
- // ============= NEW USERS REGISTRATION ===========================
- app.get('/registration', function(req, res) {
- res.render(lang+'/account/registration')
- })
- app.post('/registration', function(req, res) {
- // user data
- var curDate = new Date()
- var userData = {
- salutation: req.body.inputSalutation,
- title: req.body.inputTitle,
- firstname: req.body.inputFirstname,
- lastname: req.body.inputLastname,
- email: req.body.inputEmail,
- organisation: req.body.inputOrganisation,
- industry: req.body.inputIndustry,
- speciality: req.body.inputSpeciality,
- createdDate: curDate.toISOString().slice(0,10)
- }
-
- var userEmail = userData.email
- var pos = userEmail.indexOf('@')
- var emailLength = userEmail.length
- var emailDomain = userEmail.slice(pos, emailLength);
-
- if ( emailDomain.toLowerCase() == "@hft-stuttgart.de") {
- req.flash('error', "Fehlgeschlagen: HFT-Account")
- res.redirect('/account/registration');
- }
- else {
- let token
- async.waterfall([
- function(done) {
- crypto.randomBytes(20, function(err, buf) {
- token = buf.toString('hex');
- done(err, token);
- });
- },
- // encrypt password
- function(token, done) {
- bcrypt.genSalt(saltRounds, function(err, salt) {
- bcrypt.hash(req.body.inputPassword, salt, function(err, hash) {
- var newAccount = {
- profile: userData,
- password: hash,
- verificationToken: token
- }
- done(err, newAccount)
- });
- });
- },
- // save data
- function(newAccount, err) {
- methods.registerNewUser(newAccount, function(err){
- if (err) {
- req.flash('error', "Fehlgeschlagen")
- }
- else {
- // send email
- var emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto"
- // var emailContent = "Lieber Nutzer,\n\n"+
- // "vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart.\n"+
- // "Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: "+config.app.host+"/verifyAccount?token="+token+"\n"+
- // "Ohne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.\n\n"+
- // "Sollten Sie sich selbst nicht mit Ihren Daten am Transferportal registriert haben, ignorieren Sie diese E-Mail bitte.\n\n"+mailSignature
- var emailContent = '
Lieber Nutzer,
' +
- '
vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart.
' +
- 'Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: ' + config.app.host + '/verifyAccount?token=' + token +
- '
' +
- 'Ohne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.
' + mailSignature +
- '
';
- mailer.options.to = req.body.inputEmail;
- mailer.options.subject = emailSubject;
- mailer.options.html = emailContent;
- mailer.transport.sendMail(mailer.options, function(err) {
- if (err) {
- console.log('cannot send email')
- throw err
- }
- })
- // user feedback
- req.flash('success', 'Vielen Dank für Ihre Registrierung!'+'\r\n\r\n'+
- 'Wir haben Ihnen eine E-Mail an Ihre verwendete Adresse gesendet. Diese enthält einen Link zur Bestätigung Ihres Accounts.'+'\r\n'+
- 'Wenn Sie die Mail nicht in ihrem Postfach vorfinden, prüfen Sie bitte auch Ihren Spam-Ordner.')
- }
- res.redirect('/account/registration')
- })
- }
- ])
- }
- })
-
- // ============= USER VERIFICATION ================================
- app.get("/verifyAccount", function(req, res){
- console.log(req.query)
- methods.getUserIdByVerificationToken(req.query.token, function(userId, err){
- if (userId) {
- let userData = {
- id: userId,
- verificationStatus: 1
- }
- methods.verifyUserAccount(userData, function(err){
- if (err) {
- console.log("Error: "+err)
- res.render(lang+'/account/verification', {
- status: false
- });
- }
- else {
- // send welcome email after successful account verification
- methods.getUserById(userId, function(data, err){
- if (err) {
- console.log("Error: "+err)
- }
- else {
- // send email
- var emailSubject = "Herzlich willkommen"
- // var emailContent = "Lieber Nutzer,\n\n"+
- // "herzlich willkommen beim Transferportal der HFT Stuttgart!\n"+
- // "Sie können nun alle Dienste des Portals nutzen.\n\n"+mailSignature
- var emailContent = '
Lieber Nutzer,
' +
- '
herzlich willkommen beim Transferportal der HFT Stuttgart!
' +
- 'Sie können nun alle Dienste des Portals nutzen.
' + mailSignature;
- mailer.options.to = data.email;
- mailer.options.subject = emailSubject;
- mailer.options.html = emailContent;
- mailer.transport.sendMail(mailer.options, function(err) {
- if (err) {
- console.log('cannot send email')
- throw err
- }
- })
- }
- })
-
- res.render(lang+'/account/verification', {
- status: true
- });
- }
- })
- }
- else {
- res.render(lang+'/account/verification', {
- status: null
- });
- }
- })
- })
- app.get("/resendVerificationEmail", function(req, res){
- if (req.isAuthenticated()) {
- var emailAddress = req.user.email
-
- methods.getUserIdByEmail(req.user.email, function(userId, err) {
- if (!err) {
- // get token
- methods.getVerificationTokenByUserId(userId, function(token, err){
- if (!err) {
- if (token) {
- // send email
- var emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto"
- // var emailContent = "Lieber Nutzer,\n\n"+
- // "vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart. "+
- // "\nUm Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: "+config.app.host+"/verifyAccount?token="+token+
- // "\n\nOhne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.\n\n"+mailSignature
- var emailContent = '
Lieber Nutzer,
' +
- '
vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart.
' +
- 'Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: ' + config.app.host + '/verifyAccount?token=' + token +
- '
' +
- 'Ohne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.
' + mailSignature +
- '
';
- mailer.options.to = emailAddress;
- mailer.options.subject = emailSubject;
- mailer.options.html = emailContent;
- mailer.transport.sendMail(mailer.options, function(err) {
- if (err) {
- console.log('cannot send email')
- throw err
- }
- })
- res.send(true)
- }
- else {
- res.send(false)
- }
- }
- else {
- console.log(err)
- }
- })
- }
- })
- }
- })
-
- app.get('/email/:email', function(req, res) {
- methods.checkUserEmail(req.params.email, function(err, user){
- if (!err) {
- if (user) {
- res.send(false)
- }
- else {
- res.send(true)
- }
- }
- })
- })
-
- 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
diff --git a/views/DE/account/contact.pug b/views/DE/account/contact.pug
index 67107cf97428ed9e4eff11d8b5de2f7802b11d9f..99c37ce949e6a54d2e8c31b406d8a674edc73058 100644
--- a/views/DE/account/contact.pug
+++ b/views/DE/account/contact.pug
@@ -6,25 +6,20 @@ html(lang="de")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no")
link(rel="stylesheet", type="text/css", href="/css/bootstrap.min.css")
link(rel="stylesheet", type="text/css", href="/css/m4lab.css")
- link(rel="stylesheet", type="text/css", href="/fonts/ionicons.min.css")
link(rel="stylesheet", type="text/css", href="/css/Contact-Form-Clean.css")
- link(rel="stylesheet", type="text/css", href="/css/Testimonials.css")
- link(rel="stylesheet", type="text/css", href="/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")
body
div(class="container")
div(class="row")
- div(class="col-md-12" style="margin-bottom: 40px;")
+ div(class="col-md-12 margin_bottom_40")
img(class="mx-auto" src="/img/Kontakt.jpg" width="100%")
- div(class="contact-clean" style="background-color: rgb(234,234,234);")
- if successes
- for success in successes
- div.alert.alert-success.alert-dismissible #{ success }
- a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
- 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") ×
+ div(class="contact-clean background_eaeaea")
+ if flash.success
+ div.alert.alert-success.alert-dismissible #{flash.success}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ if flash.error
+ div.alert.alert-danger.alert-dismissible.fade.show #{flash.error}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
form(method="POST")
h2(class="text_center") Kontaktieren Sie uns
div(class="form-group")
@@ -34,18 +29,18 @@ html(lang="de")
div(class="form-group")
textarea#message(class="form-control" name="message" placeholder="Nachricht" rows="14")
div(class="form-group")
- input#submitBtn(class="btn btn-primary" type="submit" style="background-color: #8a348b;" value="SENDEN")
- div(class="contact-clean" style="background-color: rgb(234,234,234);padding: 80px;padding-top: 0px;")
- form(method="POST")
- p(style="margin-top: 25px;")
Hochschule für Technik StuttgartInstitut für Angewandte Forschung
Innovative Hochschule - Projekt M4_LAB
Schellingstr. 24
70174 Stuttgart
Deutschland
support-transfer@hft-stuttgart.dewww.hft-stuttgart.de /
www.hft-stuttgart.de/M4LAB
- div(style="background-color: rgba(138,52,139,0.45);")
+ input#submitBtn(class="btn btn-primary" type="submit" value="SENDEN")
+ div(class="contact-clean contact_footer")
+ form
+ p(class="m_top_25")
Hochschule für Technik StuttgartInstitut für Angewandte Forschung
Innovative Hochschule - Projekt M4_LAB
Schellingstr. 24
70174 Stuttgart
Deutschland
support-transfer@hft-stuttgart.dewww.hft-stuttgart.de /
www.hft-stuttgart.de/M4LAB
+ div(class="background_8a348b")
div(class="container")
div(class="row")
div(class="col-md-4 col-lg-2")
div(class="col-md-4 col-lg-8")
- div(style="background-color: #feffff;margin: 0px;padding: 60px;padding-top: 20px;padding-bottom: 20px;")
- img(class="d-flex d-lg-flex justify-content-center justify-content-lg-center align-items-lg-start mx-auto" src="/img/Logo_TV1.png" width="100px" style="padding-bottom: 35px;")
- h2(class="text-center" style="color: #8a348b;")
Transferportal
+ div(class="contact_foot_message")
+ img(class="d-flex d-lg-flex justify-content-center justify-content-lg-center align-items-lg-start mx-auto p_bottom_35" src="/img/Logo_TV1.png" width="100px")
+ h2(class="text-center color_8a348b")
Transferportal
p(class="text-center") Das Transferportal entsteht in einem Teilprojekt der Innovativen
Hochschule für Technik Stuttgart. Im
Innovationslabor M4_LAB wird das Transferportal als eine Webpräsenz entwickelt, welches Wissen, Lösungen und Dienste für HFT-Mitglieder, externe Partner und die allgemeine Öffentlichkeit bereitstellt.
Es ergänzt die Informationen der allgemeinen HFT-Webseite durch konkrete Ergebnisse aus Forschung und Entwicklung, verfügbar in verschiedenster Form wie beispielsweise Daten, Dokumentationen und Software-Code.
Zudem stellt es Kollaborationsmittel für Projektpartner und später auch Partizipationsmöglichkeiten für die breite Öffentlichkeit bereit.
div(class="col-md-4 col-lg-2")
diff --git a/views/DE/account/forgotPwd.pug b/views/DE/account/forgotPwd.pug
index 75390a804545e10751dac8bf6b08502b3ce29caa..07e90a89d288d63cf08e45a50e0b940c6d0f45fd 100644
--- a/views/DE/account/forgotPwd.pug
+++ b/views/DE/account/forgotPwd.pug
@@ -12,14 +12,12 @@ html(lang="de")
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") ×
- 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") ×
+ if flash.success
+ div.alert.alert-success.alert-dismissible #{flash.success}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ if flash.error
+ div.alert.alert-danger.alert-dismissible.fade.show #{flash.error}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
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")
diff --git a/views/DE/account/home.pug b/views/DE/account/home.pug
index 95898ac4b014a7b59bf0e53fe78c2633f663b340..1fc325c9c961c6d445cb1714d16a46bd2827feb0 100644
--- a/views/DE/account/home.pug
+++ b/views/DE/account/home.pug
@@ -16,7 +16,7 @@ html(lang="de")
| Wir haben Ihnen eine E-Mail an Ihre verwendete Adresse gesendet. Diese enthält einen Link zur Bestätigung Ihres Accounts.
| Wenn Sie die Mail nicht in ihrem Postfach vorfinden, prüfen Sie bitte auch Ihren Spam-Ordner.
|
Falls Sie keine E-Mail von uns erhalten haben, können Sie
diese hier erneut anfordern.
- div(class="spinner-border text-secondary", role="status", style="display: none")
+ div(class="spinner-border text-secondary display_none", role="status")
else
div(class="row min-vh-100 flex-column flex-md-row")
aside(class="col-12 col-md-3 p-0 flex-shrink-1")
@@ -25,12 +25,12 @@ html(lang="de")
ul(class="flex-md-column flex-row navbar-nav w-100 justify-content-between")
li(class="nav-item")
a(class="nav-link pl-0 text-nowrap" href="#")
- span(class="font-weight-bold" style="color:black;") #{user.firstname} #{user.lastname}
+ span(class="font-weight-bold color_black") #{user.firstName} #{user.lastName}
li(class="nav-item")
a(class="nav-link pl-0" href="/account/profile")
i(class="fa fa-user fa-fw")
span(class="d-none d-md-inline") Benutzerprofil
- if user.m4lab_idp == 1
+ if user.is_m4lab_idp
li(class="nav-item")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
@@ -40,7 +40,7 @@ html(lang="de")
i(class="fa fa-tasks fa-fw")
span(class="d-none d-md-inline") Projekte und Dienste
li(class="nav-item")
- a(class="nav-link pl-0" href="/logout" style="color:red;")
+ a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
span(class="d-none d-md-inline") Logout
main(class="col bg-faded py-3 flex-grow-1")
@@ -60,13 +60,8 @@ html(lang="de")
function verify() {
$(".spinner-border").show()
$.get( "/resendVerificationEmail", function( data ) {
- console.log(data)
- if (data) {
- alert( "Email sent!" )
- }
- else {
- alert("Please contact support-transfer@hft-stuttgart.de to verify your account.")
- }
+ if (data) { alert( "Email sent!" ) }
+ else { alert("Please contact support-transfer@hft-stuttgart.de to verify your account.") }
})
.fail(function() {
alert( "Something went wrong. Please try again." ) // todo: to DE
diff --git a/views/DE/account/newInformation.pug b/views/DE/account/newInformation.pug
new file mode 100644
index 0000000000000000000000000000000000000000..543d456d3f078664bc8e843d1823cfc5bef33d53
--- /dev/null
+++ b/views/DE/account/newInformation.pug
@@ -0,0 +1,121 @@
+doctype html
+html(lang="de")
+ head
+ title= "Setup a new website"
+ 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="/css/bootstrap.min.css")
+ link(rel="stylesheet", type="text/css", href="/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")
+ body
+ div(class="container")
+ div(class="row min-vh-100 flex-column flex-md-row")
+ aside(class="col-12 col-md-3 p-0 flex-shrink-1")
+ nav(class="navbar navbar-expand flex-md-column flex-row align-items-start py-2")
+ div(class="collapse navbar-collapse")
+ ul(class="flex-md-column flex-row navbar-nav w-100 justify-content-between")
+ li(class="nav-item")
+ a(class="nav-link pl-0 text-nowrap" href="/account/")
+ span(class="font-weight-bold" style="color:black;") #{user.firstName} #{user.lastName}
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/account/profile")
+ i(class="fa fa-user fa-fw")
+ span(class="d-none d-md-inline") Benutzerprofil
+ if user.is_m4lab_idp
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/account/security")
+ i(class="fa fa-lock fa-fw")
+ span(class="d-none d-md-inline") Sicherheitseinstellungen
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/account/services")
+ i(class="fa fa-tasks fa-fw" style="color:black;")
+ span(class="d-none d-md-inline" style="color:black;") Projekte und Dienste
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/logout" style="color:red;")
+ i(class="fa fa-sign-out-alt fa-fw")
+ span(class="d-none d-md-inline") Logout
+ main(class="col bg-faded py-3 flex-grow-1")
+ nav(aria-label="breadcrumb")
+ ol(class="breadcrumb")
+ li(class="breadcrumb-item")
+ a(href="/account/") Konto
+ li(class="breadcrumb-item")
+ a(href="/account/services") Projekte und Dienste
+ li(class="breadcrumb-item active" aria-current="page") Neue Projektinformation
+
+ if flash.success
+ div.alert.alert-success.alert-dismissible #{flash.success}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ if flash.error
+ div.alert.alert-danger.alert-dismissible.fade.show #{flash.error}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+
+ h3(class="pb-2") Neue Projektinformation
+ div(class="mx-4")
+ h4(class="pb-1") Schritt 1: Setup
+ p Bitte füllen Sie alle Felder aus
+ form(method="POST", encType="multipart/form-data")
+ div(class='form-group row')
+ label(for="template", class="col-sm-2") Template
+ div(class="col-sm-8")
+ select#templateSelector(name="template", class="form-control")
+ option(value="generic") generic
+ option(value="simple_raw") simple_raw
+ option(value="simple_thesis") simple_thesis
+ |
See the demo: generic, simple_raw, simple_thesis
+ div(class='form-group row')
+ label(for="name", class="col-sm-2") Name
+ div(class="col-sm-8")
+ input#name(name="name", type="text", class="form-control", placeholder="Name", maxlength="75" required)
+ p(id="nameInfo" class="font-italic font-weight-light")
Ihre Webseite wird unter folgender URL veröffentlicht: https://transfer.hft-stuttgart.de/pages/#{gitlabUsername}/
+ div(class="form-group row")
+ label(for="description", class="col-sm-2") Beschreibung
+ div(class="col-sm-8")
+ textarea#description(name="description", type="text", class="form-control", placeholder="Beschreibung", maxlength="500" required)
+ div(class="form-group row")
+ label(for="logo", class="col-sm-2") Projektlogo
+ div(class="col-sm-8")
+ div(class="form-group row px-4")
+ - let defaultLogo = "https://m4lab.hft-stuttgart.de/img/footer/M4_LAB_LOGO_Graustufen.png"
+ img(src=defaultLogo, width="100" height="100")
+ div(class="form-group row px-3")
+ input#logo(name="logo", class="form-control-file", type="file")
+ p
(Max file size is 80 KB.)
+ input(type="submit", class="btn btn-primary", value="Senden")
+ hr
+ div(class="mx-4", style="color: gray;")
+ h4(class="pb-1") Schritt 2: Dateneingabe
+ p Bitte stellen Sie sicher in GitLab, dass sie Folgendes abgeschlossen haben, bevor Sie Ihre Webseite veröffentlichen:
+ ol
+ li Bearbeiten Sie ihre
index.html
+ li Anpassen der Einstellungen in
settings.js
+
+ // 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-loading-overlay
+ script(src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js")
+ // 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")
+ script.
+ // website URL
+ function showWebsiteURL() {
+ if ($("#name").val()) {
+ $("#nameInfo").show()
+ let webName = $("#name").val().toLowerCase().replace(/\s/g, '-')
+ document.getElementById("websiteName").innerText = webName+"/home/"
+ }
+ else {
+ $("#nameInfo").hide()
+ }
+ }
+ $('#name').on('input',function(e){
+ showWebsiteURL()
+ })
+ showWebsiteURL()
+
+ $("form").submit(function(){
+ $.LoadingOverlay("show")
+ });
\ No newline at end of file
diff --git a/views/DE/account/profile.pug b/views/DE/account/profile.pug
index d21fd9230de121fbdc5f1234956644cbb2a7769c..8ab9bf550e30e249616c9cea366057c9286dbd7b 100644
--- a/views/DE/account/profile.pug
+++ b/views/DE/account/profile.pug
@@ -1,7 +1,7 @@
doctype html
html(lang="de")
head
- title= "User Profile"
+ title= "Benutzerprofil"
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="/css/bootstrap.min.css")
@@ -16,12 +16,12 @@ html(lang="de")
ul(class="flex-md-column flex-row navbar-nav w-100 justify-content-between")
li(class="nav-item")
a(class="nav-link pl-0 text-nowrap" href="/account/")
- span(class="font-weight-bold" style="color:black;") #{user.firstname} #{user.lastname}
+ span(class="font-weight-bold color_black") #{user.firstName} #{user.lastName}
li(class="nav-item")
a(class="nav-link pl-0" href="/account/profile")
- i(class="fa fa-user fa-fw" style="color:black;")
- span(class="d-none d-md-inline" style="color:black;") Benutzerprofil
- if user.m4lab_idp == 1
+ i(class="fa fa-user fa-fw color_black")
+ span(class="d-none d-md-inline color_black") Benutzerprofil
+ if user.is_m4lab_idp
li(class="nav-item")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
@@ -31,18 +31,24 @@ html(lang="de")
i(class="fa fa-tasks fa-fw")
span(class="d-none d-md-inline") Projekte und Dienste
li(class="nav-item")
- a(class="nav-link pl-0" href="/logout" style="color:red;")
+ a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
span(class="d-none d-md-inline") Logout
main(class="col bg-faded py-3 flex-grow-1")
- if successes
- for success in successes
- div.alert.alert-success.alert-dismissible #{ success }
- a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
- 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") ×
+ nav(aria-label="breadcrumb")
+ ol(class="breadcrumb")
+ li(class="breadcrumb-item")
+ a(href="/account/") Konto
+ li(class="breadcrumb-item active" aria-current="page") Benutzerprofil
+
+ if flash.success
+ div.alert.alert-success.alert-dismissible #{flash.success}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ if flash.error
+ div.alert.alert-danger.alert-dismissible.fade.show #{flash.error}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+
+ h3(class="pb-2") Mein Profil
form#profileForm(method="POST", action="/updateProfile")
div(class="form-row")
div(class='form-group col-md-2')
@@ -73,14 +79,14 @@ html(lang="de")
}
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, maxlength="45" required)
+ input#inputFirstname(name="inputFirstname", type="text", class="form-control", placeholder="Vorname", value=user.firstName, maxlength="45" 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, maxlength="45" required)
+ input#inputLastname(name="inputLastname", type="text", class="form-control", placeholder="Nachname", value=user.lastName, maxlength="45" 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, maxlength="45" required)
+ input#inputEmail(name="inputEmail", type="email", class="form-control", placeholder="Email", value=user.email, maxlength="45" required)
div(class="form-row")
div(class='form-group col-md-8')
label(for="organisation") Unternehmen
@@ -101,4 +107,4 @@ html(lang="de")
// 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")
\ No newline at end of file
+ script(src="/js/headfoot.js")
diff --git a/views/DE/account/registration.pug b/views/DE/account/registration.pug
index 401af467e5ade342b66c70b0ca36a159d9f2a2ea..3d90f3f999f7788af343d60c16ebd97aed4576bb 100644
--- a/views/DE/account/registration.pug
+++ b/views/DE/account/registration.pug
@@ -21,14 +21,12 @@ html(lang="de")
div(class="alert alert-info" role="alert")
| Auf dieser Seite können sich Benutzer, die keinen Account an der HFT haben, registrieren.
| Um sich mit ihrem HFT-Account anzumelden, klicken Sie
hier.
- if successes
- for success in successes
- div.alert.alert-success.alert-dismissible #{ success }
- a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
- 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") ×
+ if flash.success
+ div.alert.alert-success.alert-dismissible #{flash.success}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ if flash.error
+ div.alert.alert-danger.alert-dismissible.fade.show #{flash.error}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
form(method="POST")
h5(class="pt-2 mb-3 font-weight-bold") Anmeldedaten
div(class='form-row')
diff --git a/views/DE/account/security.pug b/views/DE/account/security.pug
index 712a5661fcbc64603032ff96608192b52083f1bd..897086e660881f7ddbd4ec9121e4b300536f1ec1 100644
--- a/views/DE/account/security.pug
+++ b/views/DE/account/security.pug
@@ -20,32 +20,30 @@ html(lang="de")
ul(class="flex-md-column flex-row navbar-nav w-100 justify-content-between")
li(class="nav-item")
a(class="nav-link pl-0 text-nowrap" href="/account/")
- span(class="font-weight-bold" style="color:black;") #{user.firstname} #{user.lastname}
+ span(class="font-weight-bold color_black") #{user.firstName} #{user.lastName}
li(class="nav-item")
a(class="nav-link pl-0" href="/account/profile")
i(class="fa fa-user fa-fw")
span(class="d-none d-md-inline") Benutzerprofil
li(class="nav-item")
a(class="nav-link pl-0" href="/account/security")
- i(class="fa fa-lock fa-fw" style="color:black;")
- span(class="d-none d-md-inline" style="color:black;") Sicherheitseinstellungen
+ i(class="fa fa-lock fa-fw color_black")
+ span(class="d-none d-md-inline color_black") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw")
span(class="d-none d-md-inline") Projekte und Dienste
li(class="nav-item")
- a(class="nav-link pl-0" href="/logout" style="color:red;")
+ a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
span(class="d-none d-md-inline") Logout
main(class="col bg-faded py-3 flex-grow-1")
- if successes
- for success in successes
- div.alert.alert-success.alert-dismissible #{ success }
- a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
- 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") ×
+ if flash.success
+ div.alert.alert-success.alert-dismissible #{flash.success}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ if flash.error
+ div.alert.alert-danger.alert-dismissible.fade.show #{flash.error}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
form(class="needs-validation", method="post", action="/account/changePwd" novalidate)
div(class="form-row")
div(class='form-group col-md-8')
diff --git a/views/DE/account/services.pug b/views/DE/account/services.pug
index 8ef010bdc5de6b4f31eef74f460d08ac8def6d5d..4702916d9d3e2bfd6f15432b8747559a50b59932 100644
--- a/views/DE/account/services.pug
+++ b/views/DE/account/services.pug
@@ -16,27 +16,77 @@ html(lang="de")
ul(class="flex-md-column flex-row navbar-nav w-100 justify-content-between")
li(class="nav-item")
a(class="nav-link pl-0 text-nowrap" href="/")
- span(class="font-weight-bold" style="color:black;") #{user.firstname} #{user.lastname}
+ span(class="font-weight-bold color_black") #{user.firstName} #{user.lastName}
li(class="nav-item")
a(class="nav-link pl-0" href="/account/profile")
i(class="fa fa-user fa-fw")
span(class="d-none d-md-inline") Benutzerprofil
- if user.m4lab_idp == 1
+ if user.is_m4lab_idp
li(class="nav-item")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="/account/services")
- i(class="fa fa-tasks fa-fw" style="color:black;")
- span(class="d-none d-md-inline" style="color:black;") Projekte und Dienste
+ i(class="fa fa-tasks fa-fw color_black")
+ span(class="d-none d-md-inline color_black") Projekte und Dienste
li(class="nav-item")
- a(class="nav-link pl-0" href="/logout" style="color:red;")
+ a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
span(class="d-none d-md-inline") Logout
main(class="col bg-faded py-3 flex-grow-1")
- p Auf dieser Seite werden in Zukunft Funktionen bereitgestellt, um Ihre Beteiligung an Projekten und Aktivierung von Diensten zu organisieren. Diese Funktionen stehen zurzeit aber noch nicht zur Verfügung.
-
+ nav(aria-label="breadcrumb")
+ ol(class="breadcrumb")
+ li(class="breadcrumb-item")
+ a(href="/account/") Konto
+ li(class="breadcrumb-item active" aria-current="page") Projekte und Dienste
+
+ div(class="container")
+ h3(class="pb-2") Dienste
+ div(class="col-sm-12")
+ //p Auf dieser Seite werden in Zukunft Funktionen bereitgestellt, um Ihre Beteiligung an Projekten und Aktivierung von Diensten zu organisieren. Diese Funktionen stehen zurzeit aber noch nicht zur Verfügung.
+ p Auf dieser Seite werden in Zukunft Funktionen bereitgestellt, um Ihre Aktivierung von Diensten zu organisieren. Diese Funktionen stehen zurzeit aber noch nicht zur Verfügung.
+ hr
+ div(class="container")
+ h3(class="pb-2") Projekte
+ div(class="col-sm-12")
+ if user.gitlabUserId
+ div(class="container")
+ div(class="row py-2 bg-light")
+ div(class="col font-weight-bold") Projektinformationen
+ div(class="col text-right")
+ a(href="/account/newInformation" class="btn btn-sm btn-success" role="button") Neue Projektinformation
+ table(class="table")
+ if gitlabPages.length == 0
+ tr
+ td Currently you have no project information
+ else
+ for item in gitlabPages
+ - let editNewPageLink = "/account/updateInformation?id="+item.projectInformation.id
+ - let websiteURL = "https://transfer.hft-stuttgart.de/pages/"+item.projectInformation.path+"/home/"
+ tr
+ td
+ img(src=item.projectInformation.logo, width="45", height="45")
+ td
+ a(href=editNewPageLink class="link-dark") #{item.projectInformation.name}
+ td
+ a(href=websiteURL class="link-dark" target="_blank") visit website
+ div(class="container")
+ div(class="row py-2 bg-light")
+ div(class="col font-weight-bold") Projektcode und -daten
+ div(class="col text-right")
+ button(type="button", class="btn btn-sm btn-success" disabled) Neuer Projektdatensatz
+ table(class="table")
+ for item in gitlabRepos
+ - let img = item.logo
+ tr
+ td
+ img(src=img, width="45", height="45")
+ td #{item.name}
+ else
+ p
+ | Bitte
melden Sie sich an der Gitlab-Instanz an, um Ihren Zugang zu aktivieren, und aktualisieren Sie diese Seite.
+
// 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")
diff --git a/views/DE/account/updateInformation.pug b/views/DE/account/updateInformation.pug
new file mode 100644
index 0000000000000000000000000000000000000000..f8318ee0076fb6e6b76d9cc3ff92e221583e9b3b
--- /dev/null
+++ b/views/DE/account/updateInformation.pug
@@ -0,0 +1,156 @@
+doctype html
+html(lang="de")
+ head
+ title= "Update a website"
+ 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="/css/bootstrap.min.css")
+ link(rel="stylesheet", type="text/css", href="/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")
+ body
+ div(class="container")
+ div(class="row min-vh-100 flex-column flex-md-row")
+ aside(class="col-12 col-md-3 p-0 flex-shrink-1")
+ nav(class="navbar navbar-expand flex-md-column flex-row align-items-start py-2")
+ div(class="collapse navbar-collapse")
+ ul(class="flex-md-column flex-row navbar-nav w-100 justify-content-between")
+ li(class="nav-item")
+ a(class="nav-link pl-0 text-nowrap" href="/account/")
+ span(class="font-weight-bold" style="color:black;") #{user.firstName} #{user.lastName}
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/account/profile")
+ i(class="fa fa-user fa-fw")
+ span(class="d-none d-md-inline") Benutzerprofil
+ if user.is_m4lab_idp
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/account/security")
+ i(class="fa fa-lock fa-fw")
+ span(class="d-none d-md-inline") Sicherheitseinstellungen
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/account/services")
+ i(class="fa fa-tasks fa-fw" style="color:black;")
+ span(class="d-none d-md-inline" style="color:black;") Projekte und Dienste
+ li(class="nav-item")
+ a(class="nav-link pl-0" href="/logout" style="color:red;")
+ i(class="fa fa-sign-out-alt fa-fw")
+ span(class="d-none d-md-inline") Logout
+ main(class="col bg-faded py-3 flex-grow-1")
+ nav(aria-label="breadcrumb")
+ ol(class="breadcrumb")
+ li(class="breadcrumb-item")
+ a(href="/account/") Konto
+ li(class="breadcrumb-item")
+ a(href="/account/services") Projekte und Dienste
+ li(class="breadcrumb-item active" aria-current="page") Information aktualisieren
+
+ if flash.success
+ div.alert.alert-success.alert-dismissible #{flash.success}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ if flash.error
+ div.alert.alert-danger.alert-dismissible.fade.show #{flash.error}
+ a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
+ h3(class="pb-2") Information aktualisieren
+ div(class="mx-4")
+ form(method="POST", encType="multipart/form-data")
+ div(class='form-group row')
+ label(for="name", class="col-sm-2") Name
+ div(class="col-sm-8")
+ input#name(name="name", type="text", class="form-control", value=information.name, placeholder="Name", maxlength="75" required)
+ div(class="form-group row")
+ label(for="description", class="col-sm-2") Beschreibung
+ div(class="col-sm-8")
+ textarea#description(name="description", type="text", class="form-control", placeholder="Beschreibung", maxlength="500" required) #{information.desc}
+ div(class="form-group row")
+ label(for="logo", class="col-sm-2") Projektlogo
+ div(class="col-sm-8")
+ div(class="form-group row")
+ img(src=information.logo, width="100" height="100")
+ div(class="form-group row")
+ input#logo(name="logo", class="form-control-file", type="file")
+ p
(Max file size is 80 KB.)
+ input(type="submit", class="btn btn-primary", value="Speichern")
+ hr
+ div(class="mx-4")
+ p
[ANMERKUNG] Bitte stellen Sie sicher in GitLab, dass sie Folgendes abgeschlossen haben, bevor Sie Ihre Webseite veröffentlichen:
+ div(class="help")
+ div(class="card")
+ - let indexLink = "https://transfer.hft-stuttgart.de/gitlab/"+information.path+"/-/edit/master/public/home/index.html"
+ - let settingLink = "https://transfer.hft-stuttgart.de/gitlab/"+information.path+"/-/edit/master/public/settings.js"
+ div(class="card-header")
+ div(class="card-title")
+ |
+ | 1. Bearbeiten Sie ihre index.html
+ div(id="collapse-index" class="card-body collapse")
+ ol
+ li Klicken Sie
hier, um Ihre
index.html in GitLab zu öffnen.
+ li Bearbeiten Sie ihre Datei.
+ li Um die Änderungen zu speichern und auf ihrer Seite sofort zu übernehmen, klicken Sie auf
Commit changes
+ img(src="https://transfer.hft-stuttgart.de/img/help/save_file.png", class="img-fluid", style="border: 1px solid gray;", alt="index.html")
+ li Sobald Sie Änderungen an Ihrer
index.html vornehmen, wird Ihre Website veröffentlicht.
+ div(class="card-header")
+ div(class="card-title")
+ |
2. Anpassen der Einstellungen in settings.js
+ div(id="collapse-setting" class="card-body collapse")
+ ol
+ li Klicken Sie
settings.js, um Ihre
settings.js in GitLab zu öffnen.
+ li Bearbeiten Sie ihre Datei.
+ li Hier sehen Sie die Standardwerde für Soziale Netzwerke und persönliche Webseiten eines Teilnehmers sowie den Standardavatar. Es wird empfohlen, diese Werte nicht zu ändern, aber Sie können weitere Soziale Netzwerke hinzufügen.
+ img(src="https://transfer.hft-stuttgart.de/img/help/default_settings.png", class="img-fluid", style="border: 1px solid gray;")
+ li Diese Schalter kontrollieren, welche Teile der gitlab-Seite angezeigt werden sollen. Wenn Sie also beispielsweise nur eine einzige Seite haben, benötigen Sie kein Menü und können den Wert für 'menu' auf OFF stellen.
+ img(src="https://transfer.hft-stuttgart.de/img/help/switches.png", class="img-fluid", style="border: 1px solid gray;")
+ li Hier ändern Sie das Projektlogo. Das Logo wird am oberen Rand der Seite mittig angezeigt. Wenn der Schalter für 'project logo' auf OFF steht, wird es nicht angezeigt.
+ img(src="https://transfer.hft-stuttgart.de/img/help/pr_logo.png", class="img-fluid", style="border: 1px solid gray;")
+ li Hier ändern Sie das Menü Ihrer gitlab-Seite. Ein Menü kann entweder auf einen Unterordner/ template verweisen oder aber auf einen externen Link, z.B. eine Demo. Sie können Menüeinträge hinzufügen oder entfernen. Das Menü wird mit dem Schalter 'OFF' verborgen. Vergessen Sie nicht den Schrägstrich am Ende eines Menülinks, wenn dieser auf einen Ordner zeigt.
+ img(src="https://transfer.hft-stuttgart.de/img/help/menu.png", class="img-fluid", style="border: 1px solid gray;")
+ li Hier ändern Sie die Teilnehmenden. Sie können die Standardwerte für Soziale Netzwerke (diese beinhalten die HFT-Kanäle) oder Ihr eigenen Profile verwenden. Sie können auf Ihre persönliche Webseite verlinken. Sie können soziale Netzwerke hinzufügen oder entfernen. Sie können auch einen persönlichen Avatar oder den Standard-Avatar (DEFAULT.avatar) verwenden.
+ img(src="https://transfer.hft-stuttgart.de/img/help/partic.png", class="img-fluid", style="border: 1px solid gray;")
+ li Hier ist ein Beispiel mit zwei Teilnehmenden:
+ img(src="https://transfer.hft-stuttgart.de/img/help/partic2.png", class="img-fluid", style="border: 1px solid gray;")
+ li Hier ändern Sie die Fußzeilenlogos z.B. zu denen von Projektpartnern. Wenn Sie das Logo nicht mit einer externen Webseite verlinken wollen, verwenden Sie EMPTY_LINK als Wert für href. Der Titel title wird bei Mouse-Hover über dem Logo erscheinen.
+ img(src="https://transfer.hft-stuttgart.de/img/help/f_logos.png", class="img-fluid", style="border: 1px solid gray;")
+ li Klicken Sie anschließend auf
Commit changes, um die Änderungen zu speichern.
+ img(src="https://transfer.hft-stuttgart.de/img/help/edit_settings_generic.png", class="img-fluid", style="border: 1px solid gray;")
+
+ hr
+ div(class="mx-4")
+ div(class="alert alert-danger" role="alert")
Webseite löschen
+ p Dies wird
#{information.name} sofort endgültig löschen, inklusive ihrer Repositorien und aller zugehöriger Ressourcen.
+ p Sind Sie WIRKLICH SICHER, dass Sie diese Webseite löschen wollen?
+ button(type="button" class="btn btn-danger" data-toggle="modal" data-target="#deleteWebsiteConfirmation") Löschen
+
+ // Modal
+ div(class="modal" id="deleteWebsiteConfirmation" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true")
+ div(class="modal-dialog" role="document")
+ div(class="modal-content")
+ div(class="modal-header")
+ h5(class="modal-title" id="modalLabel") Sind Sie WIRKLICH SICHER?
+ button(type="button" class="close" data-dismiss="modal" aria-label="Close")
+ span(aria-hidden="true") ×
+ div(class="modal-body")
+ |
Sie sind dabei, diese Webseite, ihr Repositorium und alle zugehörigen Ressourcen, inklusive aller Inhalte, Bilder etc. endgültig zu löschen.
+ |
Sobald eine Webseite endgültig gelöscht ist, kann sie nicht wiederhergestellt werden. Diese Aktion kann nicht rückgängig gemacht werden.
+ div(class="modal-footer")
+ form(method="POST", action="/deleteProject?_method=DELETE", encType="multipart/form-data")
+ input(name="id", value=information.id, type="hidden")
+ button(type="button" class="btn btn-primary mx-2" data-dismiss="modal") Abbrechen, Webseite behalten
+ button(type="submit" class="btn btn-danger") Ja, Webseite löschen
+
+ // 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-loading-overlay
+ script(src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js")
+ // 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")
+ script.
+ function sendPublishRequest() {
+ $.post("/sendPublishRequest", {projectName: $("#name").val()}, function(resp){
+ alert(resp)
+ })
+ }
+
+ $("form").submit(function(){
+ $.LoadingOverlay("show")
+ });
\ No newline at end of file
diff --git a/views/DE/account/verification.pug b/views/DE/account/verification.pug
index 10cdea0812ca6fe472167f50d21809057929ad3c..805cceb5c959649966d9d1d23956f6ee941b36dd 100644
--- a/views/DE/account/verification.pug
+++ b/views/DE/account/verification.pug
@@ -22,15 +22,15 @@ html(lang="de")
body
div(class="container")
div(class="center", align="center")
- a(href="https://m4lab.hft-stuttgart.de")
+ a(href="https://transfer.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
if status == true
- p(class="h5") Ihr Benutzerkonto wurde bestätigt. Bitte
melden Sie sich an.
+ p(class="h5") Ihr Benutzerkonto wurde bestätigt. Bitte
melden Sie sich an.
else if status == false
p(class="h5") Ihr Benutzerkonto konnte nicht bestätigt werden, bitte versuchen Sie es erneut.
else
- p(class="h5") Ihr Benutzerkonto wude nicht gefunden.
+ p(class="h5") Ihr Benutzerkonto wurde nicht gefunden.
// 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