Commit 9919dde0 authored by Open Source Developer's avatar Open Source Developer
Browse files

conflict

parents 1eea0731 5c33da95
......@@ -14,6 +14,14 @@ current_user:
_controller: '\Drupal\epal\Controller\CurrentUser::getLoginInfo'
requirements:
_user_is_logged_in: 'TRUE'
submitedapplications:
path: '/epal/subapplic'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SubmittedApplication::getSubmittedApplications'
requirements:
_user_is_logged_in: 'TRUE'
epal.application_submit:
path: '/epal/appsubmit'
options:
......@@ -22,3 +30,4 @@ epal.application_submit:
_controller: '\Drupal\epal\Controller\ApplicationSubmit::appSubmit'
requirements:
_user_is_logged_in: 'TRUE'
<?php
namespace Drupal\epal\Controller;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class SubmittedApplication extends ControllerBase
{
protected $entityTypeManager;
public function __construct(EntityTypeManagerInterface $entityTypeManager)
{
$this->entityTypeManager = $entityTypeManager;
}
public static function create(ContainerInterface $container)
{
return new static(
$container->get('entity_type.manager')
);
}
public function getSubmittedApplications(Request $request)
{
return "aaaaaaaaaaaaaaaaa" ;
}
}
......@@ -21,6 +21,9 @@
<i class="fa fa-sign-out"></i>
</button>
</div>
<div class="pull-right" class="nav-item" [ngClass]="{active: path=='submited-preview'}">
<a class="nav-link" [routerLink]="['/submited-preview']" [routerLinkActive]="['active']"><b>Υποβληθείσες αιτήσεις</b></a>
</div>
</div>
<!--
<li class="nav-item" [ngClass]="{active: path=='application-preview'}">
......
import { Component, OnInit, ElementRef, ViewChild} from "@angular/core";
let jsPDF = require('jspdf');
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {IStudentDataFields, IStudentDataField} from '../../store/studentdatafields';
import {Http, Headers, RequestOptions} from '@angular/http';
import * as html2canvas from "html2canvas"
import {Removetags} from '../../pipes/removehtmltags';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
@Component({
selector: 'submited-preview',
template: `
<div id = "target">
Έχετε ολοκληρώσει την αίτηση για εγγραφή στην επαγγελπατική εκπαίδευση των παρακάτω ατόμων:
<div *ngFor="let userdata$ of submitedusers$ | async; ">
<br>
<br>
<strong>Στοιχεία υποψηφίου μαθητή: </strong> <br>
<br>
</div>
</div>
<button type="button" (click)="createPdf()">Εξαγωγή σε PDF</button>
`
})
@Injectable() export default class SubmitedPreview implements OnInit {
public submitedapplic$: any;
public submitedusers$:any;
public html2canvas: any;
private loginInfo$: Observable<ILoginInfo>;
private user :string;
constructor(private _hds: HelperDataService,
public http: Http,
private _ngRedux: NgRedux<IAppState>,)
{
}
ngOnInit() {
}
createPdf()
{
html2canvas(document.getElementById("target")).then(function(canvas)
{
var img = canvas.toDataURL();
var doc = new jsPDF('p', 'mm');
doc.addImage(img, 'PNG', 10, 10);
doc.save('applications.pdf');
}
);
}
}
\ No newline at end of file
......@@ -17,6 +17,8 @@ import SectorCoursesSelect from '../components/student-application-form/sector.c
import ApplicationPreview from '../components/student-application-form/application.preview';
import SchoolsOrderSelect from '../components/student-application-form/schools-order-select';
import ApplicationSubmit from '../components/student-application-form/application.submit';
import SubmitedPreview from '../components/student-application-form/submited.aplication.preview';
export const MainRoutes: Routes = [
{ path: '', component: Home },
......@@ -30,7 +32,8 @@ export const MainRoutes: Routes = [
{ path: 'sectorcourses-fields-select', component: SectorCoursesSelect },
{ path: 'application-preview', component: ApplicationPreview },
{ path: 'schools-order-select', component: SchoolsOrderSelect },
{ path: 'application-submit', component: ApplicationSubmit }
{ path: 'application-submit', component: ApplicationSubmit },
{ path: 'submited-preview', component: SubmitedPreview },
];
export const MainDeclarations = [
......@@ -47,5 +50,6 @@ export const MainDeclarations = [
StudentApplicationMain,
ApplicationPreview,
SchoolsOrderSelect,
ApplicationSubmit
ApplicationSubmit,
SubmitedPreview,
];
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({name: 'removetags'})
export class Removetags implements PipeTransform {
transform(text: string) : any {
return text ? String(text).replace(/<[^>]+>/gm, '') : ''
}
}
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