Merge branch 'front_end_review' into 'develop'

bug fixes, added modal to application.submit

See merge request !87
parents 83569662 dfd635fe
......@@ -70,12 +70,6 @@ epal.application_submit:
_controller: '\Drupal\epal\Controller\ApplicationSubmit::appSubmit'
requirements:
_user_is_logged_in: 'TRUE'
epal.demo_data:
path: '/epal/demodata'
defaults:
_controller: '\Drupal\epal\Controller\CreateDemoData::createData'
requirements:
_access: 'TRUE'
epal.allocation:
path: '/epal/distribution'
options:
......
......@@ -87,5 +87,5 @@ class MyLocalization extends NgLocalization {
})
class AppModule {}
// enableProdMode();
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
import { Component, OnInit, OnDestroy, ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
......@@ -20,6 +20,7 @@ import {
@Component({
selector: 'director-classcapacity',
template: `
<div style="min-height: 500px;">
<form [formGroup]="formGroup">
<label for="taxi">Τάξη</label><br/>
<div class="form-group">
......@@ -28,7 +29,7 @@ import {
<option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option>
</select>
</div>
</div>
<div class="form-group">
<select #tmop class="form-control" *ngIf="(selectionBClass | async)" (change)="checkbclass(tmop,txoption)" formControlName="tomeas">
......@@ -40,14 +41,14 @@ import {
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index" [value] = "SpecialSelection$.id"> {{SpecialSelection$.specialty_id}} </option>
</select>
</div>
<div *ngIf="(retrievedStudent | async) && (modify === false)">
<strong>Δυναμική σε τμήματα:</strong>
<div *ngFor="let classCapac$ of classCapacity$ | async;" >
<div><label for="capc">Τρέχουσα Δυναμική:</label> <p class="form-control" id = "capc" style="border:1px solid #eceeef;"> {{classCapac$.capacity}} </p></div>
</div>
<p style="margin-top: 20px; line-height: 2em;"> Αν θέλετε να αλλάξετε τη δυναμική σε τμήματα για τη συγκεκριμένή επιλογή συνέχεια επιλέξτε <i>Τροποποίηση</i>.</p>
<button type="button" class="btn-primary btn-sm pull-right" (click) ="modifyCapacity()">
Τροποποίηση
......@@ -55,15 +56,17 @@ import {
</div>
<div *ngIf="(modify === true)">
<input type="number" formControlName="capacity" min="1" max="10">
<button type="button" class="btn-primary btn-sm pull-right" (click) ="saveCapacity()">
Αποθήκευση
</button>
</div>
</form>
</div>
`
})
@Injectable() export default class DirectorClassCapacity implements OnInit , OnDestroy{
@Injectable() export default class DirectorClassCapacity implements OnInit, OnDestroy {
public formGroup: FormGroup;
private StudentSelected$: BehaviorSubject<any>;
......@@ -72,37 +75,35 @@ import {
private StudentSelectedSpecialSub: Subscription;
private selectionBClass: BehaviorSubject<boolean>;
private selectionCClass: BehaviorSubject<boolean>;
private SchoolId = 147 ;
private SchoolId = 147;
private currentclass: Number;
private classCapacity$: BehaviorSubject<any>;
private classCapacitySub: Subscription;
private retrievedStudent: BehaviorSubject<boolean>;
private modify = false;
constructor( private fb: FormBuilder,
private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
private router: Router )
{
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.classCapacity$ = new BehaviorSubject([{}]);
this.selectionBClass = new BehaviorSubject(false);
this.selectionCClass = new BehaviorSubject(false);
this.retrievedStudent = new BehaviorSubject(false);
this.formGroup = this.fb.group({
tomeas: ['', []],
taxi: ['', []],
specialit: ['', []],
capacity: ['', []],
});
constructor(private fb: FormBuilder,
private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
private router: Router) {
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.classCapacity$ = new BehaviorSubject([{}]);
this.selectionBClass = new BehaviorSubject(false);
this.selectionCClass = new BehaviorSubject(false);
this.retrievedStudent = new BehaviorSubject(false);
this.formGroup = this.fb.group({
tomeas: ['', []],
taxi: ['', []],
specialit: ['', []],
capacity: ['', []],
});
}
ngOnDestroy()
{
ngOnDestroy() {
if (this.StudentSelectedSub)
this.StudentSelectedSub.unsubscribe();
if (this.StudentSelectedSpecialSub)
......@@ -110,117 +111,110 @@ import {
if (this.selectionBClass)
this.selectionBClass.unsubscribe();
if (this.selectionCClass)
this.selectionCClass.unsubscribe();
this.selectionCClass.unsubscribe();
if (this.classCapacitySub)
this.classCapacitySub.unsubscribe();
if (this.retrievedStudent)
this.retrievedStudent.unsubscribe();
this.retrievedStudent.unsubscribe();
}
ngOnInit() {
this.retrievedStudent.next(false);
}
verifyclass(txop)
{
this.modify = false;
console.log(this.formGroup.value.specialit, "speciality");
if (txop.value === "1")
{
this.selectionBClass.next(false);
this.selectionCClass.next(false);
this.formGroup.patchValue({
tomeas: '',
specialit: '',
});
console.log("a class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi,0,0,this.SchoolId ).subscribe(data => {
this.classCapacity$.next(data);
this.retrievedStudent.next(true); },
error => {
this.classCapacity$.next([{}]);
console.log("Error Getting Capacity");
},
() => console.log("Getting Capacity"));
verifyclass(txop) {
this.modify = false;
console.log(this.formGroup.value.specialit, "speciality");
if (txop.value === "1") {
this.selectionBClass.next(false);
this.selectionCClass.next(false);
this.formGroup.patchValue({
tomeas: '',
specialit: '',
});
console.log("a class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, 0, 0, this.SchoolId).subscribe(data => {
this.classCapacity$.next(data);
this.retrievedStudent.next(true);
},
error => {
this.classCapacity$.next([{}]);
console.log("Error Getting Capacity");
},
() => console.log("Getting Capacity"));
}
else if (txop.value === "2") {
this.formGroup.patchValue({
specialit: '',
});
this.selectionBClass.next(true);
this.selectionCClass.next(false);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
}
else if (txop.value === "3") {
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint, "test");
if (this.formGroup.value.tomeas != '') {
var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
}
else if (txop.value === "2")
{
this.formGroup.patchValue({
specialit: '',
});
this.selectionBClass.next(true);
this.selectionCClass.next(false);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
}
else if (txop.value === "3")
{
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint,"test");
if (this.formGroup.value.tomeas != '')
{
var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
}
this.selectionBClass.next(true);
this.selectionCClass.next(true);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
}
this.selectionBClass.next(true);
this.selectionCClass.next(true);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
}
}
checkbclass(tmop,txop)
{
this.modify = false;
checkbclass(tmop, txop) {
this.modify = false;
var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint,"tomeas");
if (txop.value === "2")
{
console.log("b class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi,sectorint,0,this.SchoolId ).subscribe(data => {
this.classCapacity$.next(data);
this.retrievedStudent.next(true); },
error => {
this.classCapacity$.next([{}]);
console.log("Error Getting Capacity");
},
() => console.log("Getting Capacity"));
console.log(sectorint, "tomeas");
if (txop.value === "2") {
console.log("b class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, sectorint, 0, this.SchoolId).subscribe(data => {
this.classCapacity$.next(data);
this.retrievedStudent.next(true);
},
error => {
this.classCapacity$.next([{}]);
console.log("Error Getting Capacity");
},
() => console.log("Getting Capacity"));
}
if (txop.value === "3")
{
if (txop.value === "3") {
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
}
}
checkcclass(tmop,txop,spop)
{
this.modify = false;
var sectorint = +this.formGroup.value.tomeas;
checkcclass(tmop, txop, spop) {
this.modify = false;
var sectorint = +this.formGroup.value.tomeas;
var specialint = +this.formGroup.value.specialit;
if (txop.value === "3")
{
console.log("c class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi,sectorint,specialint,this.SchoolId ).subscribe(data => {
this.classCapacity$.next(data);
this.retrievedStudent.next(true); },
error => {
this.classCapacity$.next([{}]);
console.log("Error Getting Capacity");
},
() => console.log("Getting Capacity"));
if (txop.value === "3") {
console.log("c class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, sectorint, specialint, this.SchoolId).subscribe(data => {
this.classCapacity$.next(data);
this.retrievedStudent.next(true);
},
error => {
this.classCapacity$.next([{}]);
console.log("Error Getting Capacity");
},
() => console.log("Getting Capacity"));
}
......@@ -229,19 +223,18 @@ import {
saveCapacity()
{
saveCapacity() {
var tomeas = +this.formGroup.value.tomeas;
var specialit = +this.formGroup.value.specialit;
console.log(tomeas, specialit);
this._hds.saveCapacity(this.formGroup.value.taxi,tomeas,specialit, this.formGroup.value.capacity, this.SchoolId );
var tomeas = +this.formGroup.value.tomeas;
var specialit = +this.formGroup.value.specialit;
console.log(tomeas, specialit);
this._hds.saveCapacity(this.formGroup.value.taxi, tomeas, specialit, this.formGroup.value.capacity, this.SchoolId);
}
}
modifyCapacity(){
modifyCapacity() {
this.modify = true;
}
this.modify = true;
}
}
\ No newline at end of file
}
......@@ -20,8 +20,9 @@ import {
@Component({
selector: 'director-view',
template: `
<div style="min-height: 500px;">
<form [formGroup]="formGroup">
<label for="taxi">Τάξη</label><br/>
<div class="form-group">
......@@ -71,12 +72,12 @@ import {
<table>
<tr><td>
<div class="form-group" *ngIf="StudentDetails$.relationtostudent === 'Μαθητής' ">
<label for="guardianfirstname">Όνομα κηδεμόνα</label><p class="form-control" id="guardianfirstname" style="border:1px solid #eceeef;">{{StudentDetails$.guardianfirstname}} </p>
<label for="guardianfirstname">Όνομα κηδεμόνα</label><p class="form-control" id="guardianfirstname" style="border:1px solid #eceeef;">{{StudentDetails$.guardianfirstname}} </p>
</div>
</td>
<td>
<div class="form-group" *ngIf="StudentDetails$.relationtostudent === 'Μαθητής' ">
<label for="guardiansurname">Επώνυμο κηδεμόνα</label><p class="form-control" id="guardiansurname" style="border:1px solid #eceeef;">{{StudentDetails$.guardiansurname}} </p>
<label for="guardiansurname">Επώνυμο κηδεμόνα</label><p class="form-control" id="guardiansurname" style="border:1px solid #eceeef;">{{StudentDetails$.guardiansurname}} </p>
</div>
</td></tr>
</table>
......@@ -85,8 +86,8 @@ import {
<div><label for="fatherfirstname">Όνομα Πατέρα</label> <p class="form-control" id = "fatherfirstname" style="border:1px solid #eceeef;"> {{StudentDetails$.fatherfirstname}} </p></div>
<div><label for="fathersurname">Επώνυμο Πατέρα</label> <p class="form-control" id = "fathersurname" style="border:1px solid #eceeef;"> {{StudentDetails$.fathersurname}} </p></div>
<div><label for="motherfirstname">Όνομα Μητέρας</label> <p class="form-control" id = "motherfirstname" style="border:1px solid #eceeef;"> {{StudentDetails$.motherfirstname}} </p></div>
<div><label for="mothersurname">Επώνυμο Μητέρας</label> <p class="form-control" id = "mothersurname" style="border:1px solid #eceeef;"> {{StudentDetails$.mothersurname}} </p></div>
<div><label for="birthdate">Ημερομηνία Γέννησης</label> <p class="form-control" id = "birthdate" style="border:1px solid #eceeef;"> {{StudentDetails$.birthdate}} </p></div>
<div><label for="mothersurname">Επώνυμο Μητέρας</label> <p class="form-control" id = "mothersurname" style="border:1px solid #eceeef;"> {{StudentDetails$.mothersurname}} </p></div>
<div><label for="birthdate">Ημερομηνία Γέννησης</label> <p class="form-control" id = "birthdate" style="border:1px solid #eceeef;"> {{StudentDetails$.birthdate}} </p></div>
<table>
......@@ -108,12 +109,14 @@ import {
</td>
</tr>
</table>
<div><label for="certificatetype">Τύπος απολυτηρίου</label> <p class="form-control" id = "certificatetype" style="border:1px solid #eceeef;"> {{StudentDetails$.certificatetype}} </p></div>
<div><label for="telnum">Τηλέφωνο επικοινωνίας</label> <p class="form-control" id = "telnum" style="border:1px solid #eceeef;"> {{StudentDetails$.telnum}} </p></div>
<div><label for="relationtostudent">Η αίτηση γίνεται από</label> <p class="form-control" id = "relationtostudent" style="border:1px solid #eceeef;"> {{StudentDetails$.relationtostudent}} </p></div>
<div><label for="certificatetype">Τύπος απολυτηρίου</label> <p class="form-control" id = "certificatetype" style="border:1px solid #eceeef;"> {{StudentDetails$.certificatetype}} </p></div>
<div><label for="telnum">Τηλέφωνο επικοινωνίας</label> <p class="form-control" id = "telnum" style="border:1px solid #eceeef;"> {{StudentDetails$.telnum}} </p></div>
<div><label for="relationtostudent">Η αίτηση γίνεται από</label> <p class="form-control" id = "relationtostudent" style="border:1px solid #eceeef;"> {{StudentDetails$.relationtostudent}} </p></div>
</div>
<!-- </div> -->
</div>
</div>
</ul>
<br>
<br>
......@@ -121,11 +124,11 @@ import {
Βρίσκεστε στη σελίδα:
<div class="col-1">
<input #pageno type="text" class="form-control" placeholder=".col-1" formControlName="pageno">
</div>
απο
</div>
απο
<div class="col-1">
<input #maxpage type="text" class="form-control" placeholder=".col-1" formControlName="maxpage">
</div>
</div>
</div>
<br>
......@@ -138,10 +141,11 @@ import {
<button class="page-link" (click) ="nextpage(txoption,maxpage) ">Επόμενη</button>
</li>
</ul>
</nav>
</form>
</div>
`
})
......@@ -166,20 +170,20 @@ import {
private SchoolId = 147;
private currentclass: Number;
private saved: Array<number> = new Array();
private limitdown = 0;
private limitup= 25;
private limitdown = 0;
private limitup = 25;
private pageno = 1;
private userActive = <number>-1;
private type: Number;
@ViewChild('fileInput') fileInput:ElementRef;
@ViewChild('fileInput') fileInput: ElementRef;
constructor(private fb: FormBuilder,
private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
private router: Router,
private renderer:Renderer) {
private renderer: Renderer) {
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentInfo$ = new BehaviorSubject([{}]);
......@@ -192,8 +196,8 @@ import {
tomeas: ['', []],
taxi: ['', []],
specialit: ['', []],
maxpage:[{value: '', disabled: true}, []],
pageno:[{value: '', disabled: true}, []],
maxpage: [{ value: '', disabled: true }, []],
pageno: [{ value: '', disabled: true }, []],
});
}
......@@ -211,7 +215,7 @@ import {
this.retrievedStudent.unsubscribe();
if (this.SubmitedDetailsSub)
this.SubmitedDetailsSub.unsubscribe();
}
ngOnInit() {
......@@ -303,21 +307,20 @@ import {
this.currentclass = 3;
}
this.formGroup.get('pageno').setValue(this.pageno);
if (this.pageno == 1){
console.log(this.SchoolId, sectorint, this.currentclass,"test");
this.formGroup.get('pageno').setValue(this.pageno);
if (this.pageno == 1) {
console.log(this.SchoolId, sectorint, this.currentclass, "test");
this.StudentsSizeSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass, 0, 0).subscribe(x => {
this.StudentsSize$.next(x);
tot_pages = x.id /5;
if (x.id%5 >0)
{
tot_pages = (x.id - (x.id%5))/5 +1;
}
this.formGroup.get('maxpage').setValue(tot_pages);
});
}
tot_pages = x.id / 5;
if (x.id % 5 > 0) {
tot_pages = (x.id - (x.id % 5)) / 5 + 1;
}
this.formGroup.get('maxpage').setValue(tot_pages);
});
}
// this.StudentInfo$ = new BehaviorSubject([{}]);
// this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass).subscribe(this.StudentInfo$);
this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass, this.limitdown, this.limitup).subscribe(data => {
......@@ -336,9 +339,9 @@ import {
let i = 0;
if (cbvalue.value === '1') {
this.saved[i] = id;
this.type = 1;
this.saved[i] = id;
this.type = 1;
}
else if (cbvalue.value === '2') {
this.saved[i] = id;
......@@ -348,11 +351,11 @@ import {
// if (this.saved[j] === id) {
// this.saved.splice(j, 1);
// }
console.log("not confirmed")
console.log("not confirmed")
}
else if (cbvalue.value === '3') {
}
}
......@@ -360,9 +363,9 @@ import {
confirmStudent() {
this._hds.saveConfirmStudents(this.saved, this.type);
let event = new MouseEvent('click', {bubbles: true});
this.fileInput.nativeElement.dispatchEvent(event);
let event = new MouseEvent('click', { bubbles: true });
this.fileInput.nativeElement.dispatchEvent(event);
}
checkcclass() {
......@@ -370,43 +373,40 @@ import {
this.retrievedStudent.next(false);
}
nextpage(txop, maxpage){
console.log(maxpage.value);
if (this.pageno < maxpage.value)
{
this.pageno = this.pageno+1;
this.limitdown = (this.pageno-1) * 5 ;
this.limitup = this.pageno * 5;
this.findstudent(txop, this.pageno)
}
nextpage(txop, maxpage) {
console.log(maxpage.value);
if (this.pageno < maxpage.value) {
this.pageno = this.pageno + 1;
this.limitdown = (this.pageno - 1) * 5;
this.limitup = this.pageno * 5;
this.findstudent(txop, this.pageno)
}
}
prevpage(txop){
console.log(this.pageno,"pageno");
if (this.pageno > 1)
{
this.pageno = this.pageno-1;
this.limitdown = (this.pageno-1) * 5 ;
this.limitup = this.pageno * 5;
this.findstudent(txop, this.pageno)
}
prevpage(txop) {
console.log(this.pageno, "pageno");
if (this.pageno > 1) {
this.pageno = this.pageno - 1;
this.limitdown = (this.pageno - 1) * 5;
this.limitup = this.pageno * 5;
this.findstudent(txop, this.pageno)
}
}
setActiveUser(ind)
{
ind = +ind;
console.log(this.userActive,"RA",ind);
if (ind === this.userActive){
ind = -1;
}
ind--;
this.userActive = ind+1 ;
setActiveUser(ind) {
ind = +ind;
console.log(this.userActive, "RA", ind);
if (ind === this.userActive) {
ind = -1;
}
ind--;
this.userActive = ind + 1;
}
}
}
import {Router, ActivatedRoute, Params} from '@angular/router';
import {OnInit, Component} from '@angular/core';
import { LoginInfoActions } from '../../actions/logininfo.actions';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { NgRedux, select } from 'ng2-redux';
import { Observable } from 'rxjs/Rx';
import { IAppState } from '../../store/store';
import { HelperDataService } from '../../services/helper-data-service';
import { CookieService } from 'ngx-cookie';
import {
FormBuilder,
FormGroup,
FormControl,
FormArray
} from '@angular/forms';
import {Router} from '@angular/router';
import {OnInit, Component, Injectable} from '@angular/core';
import { API_ENDPOINT, API_ENDPOINT_PARAMS } from '../../app.settings';
@Component({
selector: 'director-buttons',
template: `
<div>
<form>
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn-primary btn-lg" (click)="navigatedirector()">
Επιλεχθέντες Μαθητές<span class="glyphicon glyphicon-menu-right"></span>
<div class="row" style="margin-top: 130px; margin-bottom: 200px;">
<div class="col-md-3 offset-md-3">
<button type="submit" class="btn-primary btn-lg btn-block isclickable" style="margin: 0px; font-size: 1em; padding: 5px;" (click)="navigatedirector()">
Αιτηθέντες<br />Μαθητές
</button>
<br>
<br>
<button type="submit" class="btn-primary btn-lg" (click)="navigatecapacity()">
Δυναμική Τμημάτων<span class="glyphicon glyphicon-menu-right"></span>
</div>
<div class="col-md-6">
<button type="submit" class="btn-primary btn-lg btn-block isclickable" style="margin: 0px; font-size: 1em; padding: 5px;" (click)="navigatecapacity()">
Δυναμική<br />Τμημάτων
</button>