Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
4726b0d8
Commit
4726b0d8
authored
Mar 22, 2017
by
Open Source Developer
Browse files
transfer
parent
14ab6d1e
Changes
4
Hide whitespace changes
Inline
Side-by-side
source/components/navbar/navbar.component.html
View file @
4726b0d8
...
...
@@ -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'}">
...
...
source/components/student-application-form/submited.aplication.preview.ts
0 → 100644
View file @
4726b0d8
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
source/containers/main.routes.ts
View file @
4726b0d8
...
...
@@ -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
,
];
source/pipes/removehtmltags.ts
0 → 100644
View file @
4726b0d8
import
{
Pipe
,
PipeTransform
}
from
'
@angular/core
'
;
@
Pipe
({
name
:
'
removetags
'
})
export
class
Removetags
implements
PipeTransform
{
transform
(
text
:
string
)
:
any
{
return
text
?
String
(
text
).
replace
(
/<
[^
>
]
+>/gm
,
''
)
:
''
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment