Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
6447e044
Commit
6447e044
authored
Apr 01, 2021
by
Rosanny Sihombing
Browse files
add default logo
parent
6e6719ea
Changes
4
Show whitespace changes
Inline
Side-by-side
public/default/logo.png
0 → 100644
View file @
6447e044
84.7 KB
routes/routes-account.js
View file @
6447e044
...
@@ -12,6 +12,7 @@ const async = require('async')
...
@@ -12,6 +12,7 @@ const async = require('async')
const
crypto
=
require
(
'
crypto
'
)
const
crypto
=
require
(
'
crypto
'
)
const
mailer
=
require
(
'
./mailer
'
)
const
mailer
=
require
(
'
./mailer
'
)
const
logoDir
=
'
public/upload/
'
const
logoDir
=
'
public/upload/
'
const
defaultLogo
=
'
public/default/logo.png
'
const
tpGitlabURL
=
'
https://transfer.hft-stuttgart.de/gitlab/
'
const
tpGitlabURL
=
'
https://transfer.hft-stuttgart.de/gitlab/
'
const
tpGitlabPagesURL
=
'
https://transfer.hft-stuttgart.de/pages/
'
const
tpGitlabPagesURL
=
'
https://transfer.hft-stuttgart.de/pages/
'
...
@@ -493,18 +494,20 @@ module.exports = function (app, config, passport, i18n) {
...
@@ -493,18 +494,20 @@ module.exports = function (app, config, passport, i18n) {
let
projectDesc
=
req
.
body
.
description
let
projectDesc
=
req
.
body
.
description
let
projectTemplate
=
req
.
body
.
template
let
projectTemplate
=
req
.
body
.
template
let
newInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
null
,
projectName
,
projectDesc
,
null
,
null
)
let
newInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
null
,
projectName
,
projectDesc
,
null
,
null
)
let
newLogoFile
=
defaultLogo
if
(
req
.
files
)
{
newLogoFile
=
req
.
files
.
logo
}
if
(
!
req
.
files
)
{
res
.
flash
(
'
error
'
,
'
Bitte geben Sie ein Projektlogo an.
'
)
res
.
redirect
(
'
/account/newInformation
'
)
}
else
{
let
newLogoFile
=
req
.
files
.
logo
async
.
waterfall
([
async
.
waterfall
([
function
(
callback
){
// upload logo
function
(
callback
){
// upload logo
if
(
!
req
.
files
)
{
callback
(
null
,
newLogoFile
)
}
else
{
newLogoFile
.
mv
(
logoDir
+
newLogoFile
.
name
,
function
(
err
)
{
newLogoFile
.
mv
(
logoDir
+
newLogoFile
.
name
,
function
(
err
)
{
newLogoFile
=
logoDir
+
newLogoFile
.
name
newLogoFile
=
logoDir
+
newLogoFile
.
name
callback
(
err
,
newLogoFile
)
callback
(
err
,
newLogoFile
)
})
})
}
},
},
async
function
(
newLogoFile
){
// create a new GitLab Page
async
function
(
newLogoFile
){
// create a new GitLab Page
let
newPages
=
await
gitlab
.
createNewPages
(
newInformation
,
newLogoFile
,
projectTemplate
)
let
newPages
=
await
gitlab
.
createNewPages
(
newInformation
,
newLogoFile
,
projectTemplate
)
...
@@ -528,11 +531,12 @@ module.exports = function (app, config, passport, i18n) {
...
@@ -528,11 +531,12 @@ module.exports = function (app, config, passport, i18n) {
],
function
(
err
)
{
],
function
(
err
)
{
if
(
err
)
console
.
log
(
err
)
if
(
err
)
console
.
log
(
err
)
// remove logo
// remove logo
if
(
req
.
files
)
{
fs
.
unlink
(
newLogoFile
,
(
err
)
=>
{
fs
.
unlink
(
newLogoFile
,
(
err
)
=>
{
if
(
err
)
console
.
log
(
err
)
if
(
err
)
console
.
log
(
err
)
})
})
})
}
}
})
}
}
}
}
})
})
...
...
views/DE/account/newInformation.pug
View file @
6447e044
...
@@ -80,6 +80,7 @@ html(lang="de")
...
@@ -80,6 +80,7 @@ html(lang="de")
img(src=defaultLogo, width="100" height="100")
img(src=defaultLogo, width="100" height="100")
div(class="form-group row px-3")
div(class="form-group row px-3")
input#logo(name="logo", class="form-control-file", type="file")
input#logo(name="logo", class="form-control-file", type="file")
p <small>(Max file size is 80 KB.)</small>
input(type="submit", class="btn btn-primary", value="Senden")
input(type="submit", class="btn btn-primary", value="Senden")
hr
hr
div(class="mx-4", style="color: gray;")
div(class="mx-4", style="color: gray;")
...
...
views/DE/account/updateInformation.pug
View file @
6447e044
...
@@ -67,6 +67,7 @@ html(lang="de")
...
@@ -67,6 +67,7 @@ html(lang="de")
img(src=information.logo, width="100" height="100")
img(src=information.logo, width="100" height="100")
div(class="form-group row")
div(class="form-group row")
input#logo(name="logo", class="form-control-file", type="file")
input#logo(name="logo", class="form-control-file", type="file")
p <small>(Max file size is 80 KB.)</small>
input(type="submit", class="btn btn-primary", value="Speichern")
input(type="submit", class="btn btn-primary", value="Speichern")
hr
hr
div(class="mx-4")
div(class="mx-4")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment