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
f88e6c8a
Commit
f88e6c8a
authored
5 years ago
by
Rosanny Sihombing
Browse files
Options
Download
Email Patches
Plain Diff
add project overview: insert data to db
parent
2786292c
master
MLAB-677
devel
devel_wolfgang
patch-1
reset-jul13
reset-merge
test_logoutbutton
testing
2 merge requests
!2
Mlab 56
,
!1
Devel
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
routes/methods.js
+6
-0
routes/methods.js
routes/routes.js
+46
-4
routes/routes.js
views/DE/project/addProjectOverview.pug
+12
-10
views/DE/project/addProjectOverview.pug
views/DE/project/projects.pug
+4
-0
views/DE/project/projects.pug
with
68 additions
and
14 deletions
+68
-14
routes/methods.js
+
6
-
0
View file @
f88e6c8a
...
@@ -138,6 +138,12 @@ var methods = {
...
@@ -138,6 +138,12 @@ var methods = {
if
(
err
)
throw
err
;
if
(
err
)
throw
err
;
callback
(
rows
[
0
],
err
);
callback
(
rows
[
0
],
err
);
})
})
},
addProjectOverview
:
function
(
data
,
callback
)
{
dbconn
.
project
.
query
(
'
INSERT INTO project_overview SET ?
'
,
data
,
function
(
err
,
rows
,
fields
){
if
(
err
)
throw
err
;
callback
(
err
);
})
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
routes/routes.js
+
46
-
4
View file @
f88e6c8a
...
@@ -611,17 +611,59 @@ module.exports = function (app, config, passport, i18n) {
...
@@ -611,17 +611,59 @@ module.exports = function (app, config, passport, i18n) {
})
})
app
.
get
(
'
/addprojectoverview
'
,
function
(
req
,
res
)
{
app
.
get
(
'
/addprojectoverview
'
,
function
(
req
,
res
)
{
//res.render(lang+'/project/addProjectOverview')
if
(
req
.
isAuthenticated
())
{
if
(
req
.
isAuthenticated
())
{
res
.
render
(
lang
+
'
/project/addProjectOverview
'
)
res
.
render
(
lang
+
'
/project/addProjectOverview
'
)
}
}
else
{
else
{
res
.
redirect
(
'
/login
'
)
res
.
redirect
(
'
/login
'
)
}
}
})
})
app
.
post
(
'
/addprojectoverview
'
,
function
(
req
,
res
)
{
app
.
post
(
'
/addprojectoverview
'
,
function
(
req
,
res
)
{
console
.
log
(
req
.
body
)
if
(
req
.
isAuthenticated
())
{
var
wiki
=
0
if
(
req
.
body
.
wiki
)
wiki
=
1
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
:
req
.
body
.
term
,
further_details
:
req
.
body
.
furtherDetails
,
website
:
req
.
body
.
website
,
src
:
req
.
body
.
src
,
caption
:
req
.
body
.
caption
,
contact_firstname
:
req
.
body
.
contactFirstname
,
contact_lastname
:
req
.
body
.
contactLastname
,
contact_email
:
req
.
body
.
contactEmail
,
leader_firstname
:
req
.
body
.
leaderFirstname
,
leader_lastname
:
req
.
body
.
leaderLastname
,
leader_email
:
req
.
body
.
leaderEmail
}
methods
.
addProjectOverview
(
projectOverviewData
,
function
(
err
){
if
(
err
)
{
//req.flash('error', "Failed")
req
.
flash
(
'
error
'
,
"
Fehlgeschlagen
"
)
res
.
redirect
(
'
/addProjectOverview
'
);
}
else
{
req
.
flash
(
'
success
'
,
'
Your project has been created.
'
)
res
.
redirect
(
'
/project
'
);
}
})
}
})
})
};
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
views/DE/project/addProjectOverview.pug
+
12
-
10
View file @
f88e6c8a
...
@@ -37,10 +37,6 @@ html(lang="de")
...
@@ -37,10 +37,6 @@ html(lang="de")
div(class="col-md-6 offset-md-2")
div(class="col-md-6 offset-md-2")
h4(class="mb-3 font-weight-bold") Neues Projekt
h4(class="mb-3 font-weight-bold") Neues Projekt
div(class="col-md-6 offset-md-3")
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
if errors
for error, i in errors
for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
div.alert.alert-danger.alert-dismissible.fade.show #{ error }
...
@@ -52,13 +48,19 @@ html(lang="de")
...
@@ -52,13 +48,19 @@ html(lang="de")
div(class="form-group col-md-12")
div(class="form-group col-md-12")
input#inputTitle(name="title" class="form-control" type="text" placeholder="official title of the project*" required)
input#inputTitle(name="title" class="form-control" type="text" placeholder="official title of the project*" required)
div(class="form-group col-md-12")
div(class="form-group col-md-12")
input#inputSummary(name="summary" class="form-control" type="text" placeholder="one line summ
e
ry of the project")
input#inputSummary(name="summary" class="form-control" type="text" placeholder="one line summ
a
ry of the project")
div(class="form-group col-md-12")
div(class="form-group col-md-12")
input#inputCategory(name="category" class="form-control" type="text" placeholder="category of the project")
input#inputCategory(name="category" class="form-control" type="text" placeholder="category of the project")
//
div(class="form-group col-md-12")
div(class="form-group col-md-12")
input#inputLogo(name="logo" class="form-control" type="text" placeholder="official logo of the project")
input#inputLogo(name="logo" class="form-control" type="text" placeholder="official logo of the project")
//div(class="form-group col-md-12")
div(class="form-group col-md-12")
input#inputWiki(name="wiki" class="form-control" type="text")
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")
| Wiki
h5(class="mb-3 font-weight-bold") Content
h5(class="mb-3 font-weight-bold") Content
div(class='form-row')
div(class='form-row')
div(class='form-group col-md-12')
div(class='form-group col-md-12')
...
@@ -94,13 +96,13 @@ html(lang="de")
...
@@ -94,13 +96,13 @@ html(lang="de")
div(class="form-group col-md-4")
div(class="form-group col-md-4")
input#inputContactLastname(name="contactLastname" class="form-control" type="text" placeholder="contact lastname")
input#inputContactLastname(name="contactLastname" class="form-control" type="text" placeholder="contact lastname")
div(class="form-group col-md-4")
div(class="form-group col-md-4")
input#inputContactEmail(name="contactEmail" class="form-control" type="
text
" placeholder="contact email")
input#inputContactEmail(name="contactEmail" class="form-control" type="
email
" placeholder="contact email")
div(class="form-group col-md-4")
div(class="form-group col-md-4")
input#inputLeaderFirstname(name="leaderFirstname" class="form-control" type="text" placeholder="leader firstname")
input#inputLeaderFirstname(name="leaderFirstname" class="form-control" type="text" placeholder="leader firstname")
div(class="form-group col-md-4")
div(class="form-group col-md-4")
input#inputLeaderLastname(name="leaderLastname" class="form-control" type="text" placeholder="leader lastname")
input#inputLeaderLastname(name="leaderLastname" class="form-control" type="text" placeholder="leader lastname")
div(class="form-group col-md-4")
div(class="form-group col-md-4")
input#inputLeaderEmail(name="leaderEmail" class="form-control" type="
text
" placeholder="leader email")
input#inputLeaderEmail(name="leaderEmail" class="form-control" type="
email
" placeholder="leader email")
p <em><small>* Pflichtfeld</small></em>
p <em><small>* Pflichtfeld</small></em>
input#submitBtn(type="submit", class="btn btn-outline-dark btn-block", value="Projekt Anlegen")
input#submitBtn(type="submit", class="btn btn-outline-dark btn-block", value="Projekt Anlegen")
...
...
This diff is collapsed.
Click to expand it.
views/DE/project/projects.pug
+
4
-
0
View file @
f88e6c8a
...
@@ -39,6 +39,10 @@ html(lang="de")
...
@@ -39,6 +39,10 @@ html(lang="de")
else
else
p Auf dieser Seite sehen Sie die Liste der über dieses Portal veröffentlichten Projekte.
p Auf dieser Seite sehen Sie die Liste der über dieses Portal veröffentlichten Projekte.
p Möchten Sie ein neues Projekt anlegen, dann klicken Sie bitte auf #[a(href="/addprojectoverview") Anmelden und Projekt anlegen]
p Möchten Sie ein neues Projekt anlegen, dann klicken Sie bitte auf #[a(href="/addprojectoverview") Anmelden und Projekt anlegen]
if successes
for success in successes
div.alert.alert-success.alert-dismissible #{ success }
a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
// Active projects
// Active projects
h3(class="mb-3 font-weight-bold") Aktive Projekte
h3(class="mb-3 font-weight-bold") Aktive Projekte
table(class="table table-striped")
table(class="table table-striped")
...
...
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