Skip to content
Snippets Groups Projects
Commit 660820b5 authored by Axel's avatar Axel
Browse files

fix: change-phase can just quit the current phase now.

parent f18b9737
No related branches found
No related tags found
No related merge requests found
gemeinsamforschen/src/main/webapp/libs/img/arrow.png

495 B

......@@ -9,6 +9,7 @@
<head>
<omniDependencies:omniDependencies hierarchy="1"/>
<script src="js/changePhase.js"></script>
<link href="css/changePhase.css" rel="stylesheet">
</head>
<body>
......@@ -16,23 +17,26 @@
<menu:menu hierarchy="1"/>
<div class="page-content-wrapper">
<headLine:headLine/>
<div class="alert" id="CourseCreation">
<button id="btnCourseCreation" class="btn btn-secondary">Projekterstellungsphase</button>
</div>
<div class="alert" id="GroupFormation">
<button id="btnGroupformation" class="btn btn-secondary">Gruppen erstellen</button>
</div>
<div class="alert" id="DossierFeedback">
<button id="btnDossierFeedback" class="btn btn-secondary">Feedbackphase</button>
</div>
<div class="alert" id="Execution">
<button id="btnExecution" class="btn btn-secondary">Durchführungsphase</button>
</div>
<div class="alert" id="Assessment">
<button id="btnAssessment" class="btn btn-secondary">Bewertungsphase</button>
</div>
<div class="alert" id="end">
<button id="btnProjectfinished" class="btn btn-secondary">Ende</button>
<div class="container-fluid">
<input type="image" src="../libs/img/arrow.png" class="arrow" id="changePhase"/>
<div class="alert" id="CourseCreation">
<p>Projekterstellungsphase</p>
</div>
<div class="alert" id="GroupFormation">
<p>Gruppen erstellen</p>
</div>
<div class="alert" id="DossierFeedback">
<p>Feedbackphase</p>
</div>
<div class="alert" id="Execution">
<p>Durchführungsphase</p>
</div>
<div class="alert" id="Assessment">
<p>Bewertungsphase</p>
</div>
<div class="alert" id="end">
<p>Ende</p>
</div>
</div>
</div>
<footer:footer/>
......
.arrow {
position:absolute;
margin-left:160px;
height:90px;
}
.arrowCourseCreation{
margin-top:20px;
}
.arrowGroupFormation{
margin-top:90px;
}
.arrowDossierFeedback{
margin-top:160px;
}
.arrowExecution{
margin-top:210px;
}
.arrowAssessment{
margin-top:280px;
}
.arrowDone{
visibility: hidden;
}
\ No newline at end of file
......@@ -8,6 +8,8 @@ $(document).ready(function () {
},
type: 'GET',
success: function (response) {
let arrow = $('#changePhase');
arrow.toggleClass('arrow'+response);
let phaseDiv = $('#'+response);
if (phaseDiv !== null){
phaseDiv.toggleClass('alert-info');
......@@ -19,37 +21,36 @@ $(document).ready(function () {
}
});
$('#btnAssessment').on('click', function(){
changePhase('Assessment');
});
$('#btnExecution').on('click', function(){
changePhase('Execution');
});
$('#btnGroupformation').on('click', function(){
changePhase('GroupFormation');
});
$('#btnCourseCreation').on('click', function(){
changePhase('CourseCreation');
});
$('#btnDossierFeedback').on('click', function(){
changePhase('DossierFeedback');
});
$('#btnProjectfinished').on('click', function(){
changePhase('Projectfinished');
$('#changePhase').on('click', function(){
let projectId = $('#projectId').html().trim();
$.ajax({
url: '../rest/phases/projects/'+projectId,
headers: {
"Content-Type": "application/json",
"Cache-Control": "no-cache"
},
type: 'GET',
success: function (response) {
changePhase(response);
},
error: function (a) {
}
});
});
});
function changePhase(toPhase){
function changePhase(currentPhase){
let projectId = $('#projectId').html().trim();
$.ajax({
url: '../rest/phases/'+toPhase+'/projects/'+projectId,
url: '../rest/phases/'+currentPhase+'/projects/'+projectId,
headers: {
"Content-Type": "application/json",
"Cache-Control": "no-cache"
},
type: 'POST',
success: function () {
location.href="#"
location.reload(1);
},
error: function (a) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment