Merge branch 'stylesandmenus' into 'develop'

Stylesandmenus

See merge request !93
parents 266b305d 60d95068
...@@ -43,7 +43,7 @@ public function getSectorsPerSchool(Request $request, $epalId) ...@@ -43,7 +43,7 @@ public function getSectorsPerSchool(Request $request, $epalId)
$user = reset($users); $user = reset($users);
if ($user) { if ($user) {
// $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId))); // $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId)));
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $this->testSchoolId, 'id' => intval($epalId))); $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => intval($epalId)));
$school = reset($schools); $school = reset($schools);
if (!$school) { if (!$school) {
$this->logger->warning("no access to this school=" . $user->id()); $this->logger->warning("no access to this school=" . $user->id());
...@@ -101,7 +101,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId) ...@@ -101,7 +101,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
$user = reset($users); $user = reset($users);
if ($user) { if ($user) {
// $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId))); // $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId)));
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $this->testSchoolId, 'id' => intval($epalId))); $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array( 'id' => intval($epalId)));
$school = reset($schools); $school = reset($schools);
if (!$school) { if (!$school) {
$this->logger->warning("no access to this school=" . $user->id()); $this->logger->warning("no access to this school=" . $user->id());
...@@ -164,7 +164,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas ...@@ -164,7 +164,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
$user = reset($users); $user = reset($users);
if ($user) { if ($user) {
// $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId))); // $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId)));
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $this->testSchoolId, 'id' => intval($epalId))); $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array( 'id' => intval($epalId)));
$school = reset($schools); $school = reset($schools);
if (!$school) { if (!$school) {
$this->logger->warning("no access to this school=" . $user->id()); $this->logger->warning("no access to this school=" . $user->id());
...@@ -278,17 +278,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas ...@@ -278,17 +278,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken)); $users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users); $user = reset($users);
if ($user) { if ($user) {
// $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId))); //
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $this->testSchoolId));
$school = reset($schools);
if (!$school) {
$this->logger->warning("no access to this school=" . $user->id());
$response = new Response();
$response->setContent('No access to this school');
$response->setStatusCode(Response::HTTP_FORBIDDEN);
$response->headers->set('Content-Type', 'application/json');
return $response;
}
$postData = null; $postData = null;
......
...@@ -80,7 +80,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -80,7 +80,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
</div> </div>
</ul> </ul>
<div *ngIf="currentUrl === '/submited-preview'"> <div *ngIf="currentUrl === '/application-submit'">
<div *ngFor="let studentDataField$ of studentDataFields$ | async;"> <div *ngFor="let studentDataField$ of studentDataFields$ | async;">
<ul class="list-group left-side-view" style="margin-bottom: 20px;"> <ul class="list-group left-side-view" style="margin-bottom: 20px;">
<li class="list-group-item active"> <li class="list-group-item active">
...@@ -119,7 +119,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -119,7 +119,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
<ul class="list-group left-side-view" style="margin-bottom: 20px;"> <ul class="list-group left-side-view" style="margin-bottom: 20px;">
<li class="list-group-item active"> <li class="list-group-item active">
<div *ngIf="currentUrl === '/submited-preview'"> <div *ngIf="currentUrl === '/application-submit'">
Κοινωνικά/Εισοδηματικά Κριτήρια Κοινωνικά/Εισοδηματικά Κριτήρια
</div> </div>
</li> </li>
...@@ -127,7 +127,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -127,7 +127,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
</div> </div>
</div> </div>
<div *ngIf="currentUrl === '/submited-preview'"> <div *ngIf="currentUrl === '/application-submit'">
<div *ngFor="let criteriaField$ of criteriaFields$ | async;"> <div *ngFor="let criteriaField$ of criteriaFields$ | async;">
<div *ngIf="criteriaField$.selected === true"> <div *ngIf="criteriaField$.selected === true">
{{criteriaField$.name}} {{criteriaField$.name}}
...@@ -172,6 +172,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -172,6 +172,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
ngOnInit() { ngOnInit() {
this.currentUrl = this.router.url; this.currentUrl = this.router.url;
console.log(this.currentUrl,"url");
this.sectorsSub = this._ngRedux.select(state => { this.sectorsSub = this._ngRedux.select(state => {
state.sectors.reduce((prevSector, sector) => { state.sectors.reduce((prevSector, sector) => {
sector.courses.reduce((prevCourse, course) => { sector.courses.reduce((prevCourse, course) => {
......
...@@ -56,7 +56,7 @@ import { HelperDataService } from '../../services/helper-data-service'; ...@@ -56,7 +56,7 @@ import { HelperDataService } from '../../services/helper-data-service';
</div> </div>
<application-preview-select></application-preview-select> <application-preview-select></application-preview-select>
<button type="button button-lg pull-right" *ngIf="(studentDataFields$ | async).size > 0 && (criteria$ | async).size > 0 && (regions$ | async).size > 0 && (epalclasses$ | async).size > 0 && (loginInfo$ | async).size > 0" class="btn-primary btn-lg pull-center" (click)="submitNow()">Υποβολή</button> <button type="button button-lg pull-right" *ngIf="(studentDataFields$ | async).size > 0 && (criteria$ | async).size > 0 && (regions$ | async).size > 0 && (epalclasses$ | async).size > 0 && (loginInfo$ | async).size > 0" class="btn-primary btn-lg pull-right" (click)="submitNow()">Υποβολή</button>
` `
}) })
......
...@@ -228,12 +228,13 @@ import * as html2canvas from "html2canvas" ...@@ -228,12 +228,13 @@ import * as html2canvas from "html2canvas"
} }
createPdf() createPdf1()
{ {
html2canvas(document.getElementById("target")).then(function(canvas) html2canvas(document.getElementById("target")).then(function(canvas)
{ {
var img=new Image(); var img=new Image();
img.src=canvas.toDataURL(); img.src=canvas.toDataURL();
img.onload=function(){ img.onload=function(){
...@@ -249,6 +250,7 @@ import * as html2canvas from "html2canvas" ...@@ -249,6 +250,7 @@ import * as html2canvas from "html2canvas"
}, },
function(error){ function(error){
console.log("i fail"); console.log("i fail");
...@@ -258,23 +260,27 @@ import * as html2canvas from "html2canvas" ...@@ -258,23 +260,27 @@ import * as html2canvas from "html2canvas"
createPdf1() createPdf()
{ {
html2canvas(document.getElementById("target"), <Html2Canvas.Html2CanvasOptions>{ html2canvas(document.getElementById("target"), <Html2Canvas.Html2CanvasOptions>{
onrendered: function(canvas: HTMLCanvasElement) { onrendered: function(canvas: HTMLCanvasElement) {
console.log("lalalal"); var img = canvas.toDataURL();
var img = canvas.toDataURL(); var doc = new jsPDF();
var doc = new jsPDF();
doc.addImage(img, 'PNG',0, 0, 210, 297); console.log("mphkaneo");
setTimeout(function(){
doc.save('applications.pdf');
},
function(error){
console.log("i fail"); }, 10000);
} doc.addImage(img, 'PNG',0, 0, 1000, 1000);
}); console.log("mphkaneoneo");
} doc.save('applications.pdf');
}
}); }
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ</title> <title>Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ</title>
</head> </head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<body> <body>
<main></main> <main></main>
</body> </body>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"lib": ["es2015", "dom"], "lib": ["es2015", "dom"],
"sourceMap": false, "sourceMap": false,
"inlineSourceMap": true "inlineSourceMap": true
}, },
"exclude": [ "exclude": [
"node_modules", "node_modules",
...@@ -19,3 +20,4 @@ ...@@ -19,3 +20,4 @@
"dist" "dist"
] ]
} }
...@@ -108,4 +108,6 @@ module.exports = { ...@@ -108,4 +108,6 @@ module.exports = {
contentBase: './dist', contentBase: './dist',
publicPath: '/' publicPath: '/'
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment