Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
c26edde1
Commit
c26edde1
authored
4 years ago
by
Rosanny Sihombing
Browse files
Options
Download
Email Patches
Plain Diff
add path and breadcrumb
parent
3a75a617
master
MLAB-677
devel
reset-jul13
reset-merge
testing
5 merge requests
!143
updating yml config
,
!91
Prepare prod
,
!90
Testing
,
!89
Testing
,
!70
Mlab 383
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
classes/project.js
+9
-2
classes/project.js
classes/website.js
+2
-2
classes/website.js
routes/routes-account.js
+9
-5
routes/routes-account.js
views/DE/account/services.pug
+9
-1
views/DE/account/services.pug
views/DE/account/updateInformation.pug
+9
-16
views/DE/account/updateInformation.pug
with
38 additions
and
26 deletions
+38
-26
classes/project.js
+
9
-
2
View file @
c26edde1
class
Project
{
constructor
(
ownerGitlabId
,
id
,
name
,
desc
,
logo
)
{
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
...
...
@@ -23,6 +24,9 @@ class Project {
getLogo
()
{
return
this
.
logo
}
getPath
()
{
return
this
.
path
}
// setter
setOwnerGitlabId
(
newOwnerGitlabId
){
this
.
ownerGitlabId
=
newOwnerGitlabId
...
...
@@ -36,9 +40,12 @@ class Project {
setDesc
(
newDesc
)
{
this
.
desc
=
newDesc
}
setLogo
(
newLogoUrl
){
setLogo
(
newLogoUrl
)
{
this
.
logo
=
newLogoUrl
}
setPath
(
newPath
)
{
this
.
path
=
newPath
}
}
module
.
exports
=
Project
\ No newline at end of file
This diff is collapsed.
Click to expand it.
classes/website.js
+
2
-
2
View file @
c26edde1
const
Project
=
require
(
"
./project
"
);
class
Website
extends
Project
{
constructor
(
ownerGitlabId
,
id
,
name
,
desc
,
logo
,
settingUrl
,
kontaktUrl
,
isPublished
)
{
super
(
ownerGitlabId
,
id
,
name
,
desc
,
logo
)
constructor
(
ownerGitlabId
,
id
,
name
,
desc
,
logo
,
path
,
settingUrl
,
kontaktUrl
,
isPublished
)
{
super
(
ownerGitlabId
,
id
,
name
,
desc
,
logo
,
path
)
this
.
settingUrl
=
settingUrl
this
.
kontaktUrl
=
kontaktUrl
this
.
isPublished
=
isPublished
...
...
This diff is collapsed.
Click to expand it.
routes/routes-account.js
+
9
-
5
View file @
c26edde1
...
...
@@ -216,10 +216,11 @@ module.exports = function (app, config, passport, i18n) {
isWebsitePublished
=
true
}
let
page
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
gitlabData
[
i
].
id
,
gitlabData
[
i
].
name
,
gitlabData
[
i
].
description
,
gitlabData
[
i
].
avatar_url
,
null
,
null
,
isWebsitePublished
)
gitlabData
[
i
].
avatar_url
,
gitlabData
[
i
].
path
,
null
,
null
,
isWebsitePublished
)
gitlabPagesArr
.
push
(
page
)
}
else
{
let
repo
=
new
projectRepo
(
loggedInUser
.
getGitlabUserId
(),
gitlabData
[
i
].
id
,
gitlabData
[
i
].
name
,
gitlabData
[
i
].
description
,
gitlabData
[
i
].
avatar_url
)
let
repo
=
new
projectRepo
(
loggedInUser
.
getGitlabUserId
(),
gitlabData
[
i
].
id
,
gitlabData
[
i
].
name
,
gitlabData
[
i
].
description
,
gitlabData
[
i
].
avatar_url
,
gitlabData
[
i
].
path
)
gitlabReposArr
.
push
(
repo
)
}
}
...
...
@@ -498,7 +499,7 @@ module.exports = function (app, config, passport, i18n) {
}
else
{
let
projectName
=
req
.
body
.
name
.
toLowerCase
().
replace
(
/
\s
/g
,
'
-
'
)
let
projectDesc
=
req
.
body
.
description
let
newInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
null
,
projectName
,
projectDesc
,
null
,
null
,
null
,
false
)
let
newInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
null
,
projectName
,
projectDesc
,
null
,
null
,
null
,
null
,
false
)
if
(
!
req
.
files
)
{
res
.
flash
(
'
error
'
,
'
Bitte geben Sie ein Projektlogo an.
'
)
...
...
@@ -525,6 +526,7 @@ module.exports = function (app, config, passport, i18n) {
}
else
{
newInformation
.
setId
(
result
.
id
)
newInformation
.
setLogo
(
result
.
avatar_url
)
newInformation
.
setPath
(
result
.
path
)
newInformation
.
setSettingUrl
(
tpGitlabURL
+
result
.
namespace
.
path
+
'
/
'
+
result
.
name
+
'
/-/edit/master/public/settings.js
'
)
newInformation
.
setKontaktUrl
(
tpGitlabURL
+
result
.
namespace
.
path
+
'
/
'
+
result
.
name
+
'
/-/edit/master/public/kontakt.html
'
)
...
...
@@ -568,12 +570,13 @@ module.exports = function (app, config, passport, i18n) {
informationStatus
=
false
}
let
gitlabData
=
data
.
data
let
curInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
req
.
query
.
id
,
null
,
null
,
null
,
null
,
null
,
informationStatus
)
let
curInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
req
.
query
.
id
,
null
,
null
,
null
,
null
,
null
,
null
,
informationStatus
)
for
(
let
i
=
0
;
i
<
gitlabData
.
length
;
i
++
){
if
(
gitlabData
[
i
].
id
==
req
.
query
.
id
)
{
curInformation
.
setName
(
gitlabData
[
i
].
name
)
curInformation
.
setDesc
(
gitlabData
[
i
].
description
)
curInformation
.
setLogo
(
gitlabData
[
i
].
avatar_url
)
curInformation
.
setPath
(
gitlabData
[
i
].
path
)
curInformation
.
setSettingUrl
(
tpGitlabURL
+
gitlabData
[
i
].
path_with_namespace
+
'
/-/edit/master/public/settings.js
'
)
curInformation
.
setKontaktUrl
(
tpGitlabURL
+
gitlabData
[
i
].
path_with_namespace
+
'
/-/edit/master/public/kontakt.html
'
)
...
...
@@ -604,7 +607,7 @@ module.exports = function (app, config, passport, i18n) {
if
(
req
.
body
.
isPublished
==
"
false
"
)
{
isProjectPublished
=
false
}
let
updatedInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
req
.
query
.
id
,
projectName
,
projectDesc
,
null
,
null
,
null
,
isProjectPublished
)
let
updatedInformation
=
new
projectInformation
(
loggedInUser
.
getGitlabUserId
(),
req
.
query
.
id
,
projectName
,
projectDesc
,
null
,
null
,
null
,
null
,
isProjectPublished
)
let
newLogoFile
async
.
waterfall
([
...
...
@@ -630,6 +633,7 @@ module.exports = function (app, config, passport, i18n) {
}
}
else
{
updatedInformation
.
setLogo
(
result
.
avatar_url
)
updatedInformation
.
setPath
(
result
.
path
)
updatedInformation
.
setSettingUrl
(
tpGitlabURL
+
result
.
namespace
.
path
+
'
/
'
+
result
.
name
+
'
/-/edit/master/public/settings.js
'
)
updatedInformation
.
setKontaktUrl
(
tpGitlabURL
+
result
.
namespace
.
path
+
'
/
'
+
result
.
name
+
'
/-/edit/master/public/kontakt.html
'
)
res
.
flash
(
"
success
"
,
"
Your website has been updated
"
)
...
...
This diff is collapsed.
Click to expand it.
views/DE/account/services.pug
+
9
-
1
View file @
c26edde1
...
...
@@ -35,6 +35,12 @@ html(lang="de")
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 active" aria-current="page") Projekte und Dienste
div(class="container")
h3(class="pb-2") Dienste
div(class="col-sm-12")
...
...
@@ -54,13 +60,15 @@ html(lang="de")
for item in gitlabPages
- let img = item.logo
- let editNewPageLink = "/account/updateInformation?id="+item.id
- let websiteURL = "https://transfer.hft-stuttgart.de/pages/"+item.path
tr
td
img(src=img, width="45", height="45")
if item.isPublished
td
a(href=editNewPageLink+"&s=y" class="link-dark") #{item.name}
td veröffentlicht
td
a(href=websiteURL target="_blank" class="link-dark") veröffentlicht
else
td
a(href=editNewPageLink+"&s=n" class="link-dark") #{item.name}
...
...
This diff is collapsed.
Click to expand it.
views/DE/account/updateInformation.pug
+
9
-
16
View file @
c26edde1
...
...
@@ -35,6 +35,14 @@ html(lang="de")
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") ×
...
...
@@ -51,7 +59,7 @@ html(lang="de")
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)
| <p id="nameInfo" class="font-italic font-weight-light"><small>Ihre Webseite
wird unter folgender URL veröffentlicht
: <strong>https://transfer.hft-stuttgart.de/pages/
<span id="websiteName"></span>
</strong></small></p>
| <p id="nameInfo" class="font-italic font-weight-light"><small>Ihre Webseite
URL
: <strong>https://transfer.hft-stuttgart.de/pages/
#{information.path}
</strong></small></p>
div(class="form-group row")
label(for="description", class="col-sm-2") Beschreibung
div(class="col-sm-8")
...
...
@@ -106,21 +114,6 @@ html(lang="de")
// M4_LAB
script(src="/js/headfoot.js")
script.
function showWebsiteURL() {
if ($("#name").val()) {
$("#nameInfo").show();
let webName = $("#name").val().toLowerCase().replace(/\s/g, '-');
document.getElementById("websiteName").innerText = webName;
}
else {
$("#nameInfo").hide()
}
}
$('#name').on('input',function(e){
showWebsiteURL()
})
showWebsiteURL()
function sendPublishRequest() {
$.post("/sendPublishRequest", {projectName: $("#name").val()}, function(resp){
alert(resp)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets