Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fltrail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fides
fltrail
Commits
b8c99981
Commit
b8c99981
authored
6 years ago
by
Sven Kästle
Browse files
Options
Downloads
Patches
Plain Diff
feat: Show user created submission parts on the project page
parent
bda0ca96
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gemeinsamforschen/src/main/webapp/assets/js/project-student.js
+77
-5
77 additions, 5 deletions
...nsamforschen/src/main/webapp/assets/js/project-student.js
gemeinsamforschen/src/main/webapp/pages/project-student.jsp
+1
-8
1 addition, 8 deletions
gemeinsamforschen/src/main/webapp/pages/project-student.jsp
with
78 additions
and
13 deletions
gemeinsamforschen/src/main/webapp/assets/js/project-student.js
+
77
−
5
View file @
b8c99981
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
// fetch all submission part project representations from database
getSubmissionPartsByProjectId
(
getProjectIdFromUrl
(),
function
(
response
)
{
// iterate over response and display each element
for
(
let
i
=
0
;
i
<
response
.
length
;
i
++
)
{
displaySubmission
(
response
[
i
].
user
,
response
[
i
].
category
,
response
[
i
].
fullSubmissionId
);
}
// add click listener to feedback buttons
$
(
'
.annotationview
'
).
click
(
function
()
{
location
.
href
=
"
annotation-document.jsp?token=
"
+
getUserTokenFromUrl
();
});
},
function
()
{
// display empty view
displayEmptyView
()
});
/*
/*
var memberTable = $('#myGroupMembers');
var memberTable = $('#myGroupMembers');
memberTable.hide();
memberTable.hide();
...
@@ -13,11 +31,65 @@ $(document).ready(function(){
...
@@ -13,11 +31,65 @@ $(document).ready(function(){
location
.
href
=
"
viewfeedback.jsp?token=
"
+
getUserTokenFromUrl
();
location
.
href
=
"
viewfeedback.jsp?token=
"
+
getUserTokenFromUrl
();
});
});
$
(
'
.annotationview
'
).
click
(
function
()
{
location
.
href
=
"
annotation-document.jsp?token=
"
+
getUserTokenFromUrl
();
});
$
(
'
#btnUnstructuredUpload
'
).
click
(
function
()
{
$
(
'
#btnUnstructuredUpload
'
).
click
(
function
()
{
location
.
href
=
"
unstructured-upload.jsp?token=
"
+
getUserTokenFromUrl
()
+
"
&projectId=
"
+
getProjectIdFromUrl
();
location
.
href
=
"
unstructured-upload.jsp?token=
"
+
getUserTokenFromUrl
()
+
"
&projectId=
"
+
getProjectIdFromUrl
();
})
})
});
});
\ No newline at end of file
/**
* Display category of submission part in list
*
* @param user The user of the submission part
* @param category The category of the submission part
* @param fullSubmissionId The id of the full submission the submission part belongs to
*/
function
displaySubmission
(
user
,
category
,
fullSubmissionId
)
{
// build link
$
(
'
#submissionUpload
'
).
append
(
$
(
'
<li>
'
)
.
append
(
$
(
'
<span>
'
).
append
(
category
.
toUpperCase
()
+
"
eingereicht
"
))
.
append
(
$
(
'
<a>
'
).
attr
(
"
class
"
,
"
annotationview
"
).
attr
(
"
role
"
,
"
button
"
)
.
append
(
$
(
'
<label>
'
).
css
(
"
font-size
"
,
"
10px
"
)
.
append
(
$
(
'
<i>
'
).
attr
(
"
class
"
,
"
far fa-comments
"
).
css
(
"
font-size
"
,
"
15px
"
))
.
append
(
"
feedback
"
)
)
)
)
// add data to link
.
data
(
"
fullSubmissionId
"
,
fullSubmissionId
);
}
/**
* Display a not found message if there are no submission parts in the database (or on error)
*/
function
displayEmptyView
()
{
// build link
$
(
'
#submissionUpload
'
).
append
(
$
(
'
<li>
'
)
.
append
(
$
(
'
<span>
'
).
append
(
"
keine Daten gefunden
"
))
);
}
/**
* GET: Get all representations of a submission part for a given project id
*
* @param projectId The id of the project
* @param responseHandler The response handler
* @param errorHandler The error handler
*/
function
getSubmissionPartsByProjectId
(
projectId
,
responseHandler
,
errorHandler
)
{
var
url
=
"
../rest/submissions/project/
"
+
projectId
;
$
.
ajax
({
url
:
url
,
type
:
"
GET
"
,
dataType
:
"
json
"
,
success
:
function
(
response
)
{
// handle the response
responseHandler
(
response
);
},
error
:
function
()
{
// handle the error
errorHandler
();
}
})
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
gemeinsamforschen/src/main/webapp/pages/project-student.jsp
+
1
−
8
View file @
b8c99981
...
@@ -95,14 +95,7 @@
...
@@ -95,14 +95,7 @@
<img
src=
"../assets/img/3.jpg"
>
<img
src=
"../assets/img/3.jpg"
>
<a
href=
"#"
>
student3@uni.de
</a>
<a
href=
"#"
>
student3@uni.de
</a>
<hr>
<hr>
<ul>
<ul
id=
"submissionUpload"
>
<li>
"Viva la Floristika" - Titel hochgeladen
<a
class=
"annotationview"
role=
"button"
>
<label
style=
"font-size:10px;"
><i
class=
"far fa-comments"
style=
"font-size:15px;"
></i>
feedback
</label>
</a>
</li>
</ul>
</ul>
</td>
</td>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment