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
63e47e3a
Commit
63e47e3a
authored
Apr 28, 2017
by
Open Source Developer
Browse files
trans
parent
0b7b740d
Changes
4
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/epal.routing.yml
View file @
63e47e3a
...
...
@@ -148,3 +148,14 @@ epal.ministry.general_report:
_controller
:
'
\Drupal\epal\Controller\Distribution::makegGeneralReport'
requirements
:
_user_is_logged_in
:
'
TRUE'
regionview
:
path
:
'
/epal/ScoolperPerf/{perfectureId}'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
_controller
:
'
\Drupal\epal\Controller\DirectorView::getSchoolsPerPerfetcure'
requirements
:
_user_is_logged_in
:
'
TRUE'
drupal/modules/epal/src/Controller/DirectorView.php
View file @
63e47e3a
...
...
@@ -402,6 +402,51 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
public
function
getSchoolsPerPerfetcure
(
Request
$request
,
$perfectureId
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'region_edu_admin_id'
=>
$perfectureId
));
if
(
$schools
)
{
$list
=
array
();
foreach
(
$schools
as
$object
)
{
$list
[]
=
array
(
'id'
=>
$object
->
id
(),
'name'
=>
$object
->
name
->
value
,
);
$i
++
;
}
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"Perfecture not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"User not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
private
function
respondWithStatus
(
$arr
,
$s
)
{
$res
=
new
JsonResponse
(
$arr
);
$res
->
setStatusCode
(
$s
);
...
...
source/components/infoviews/perfecture-view.ts
View file @
63e47e3a
...
...
@@ -24,8 +24,8 @@ import {
<ul class="list-group main-view">
<div *ngFor="let SchoolNames$ of SchoolsPerPerf$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" (click)="setActiveRegion(SchoolNames$.id)" [class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id ">
<h5
>
{{SchoolNames$.name}}</h5>
<li class="list-group-item isclickable" (click)="setActiveRegion(SchoolNames$.id)"
[class.changecolor]="calccolor(SchoolNames$.id)"
[class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id ">
<h5
[class.changecolor]="calccolor(SchoolNames$.id)">
{{SchoolNames$.name}}</h5>
</li>
</div>
</ul>
...
...
@@ -44,6 +44,8 @@ import {
public
formGroup
:
FormGroup
;
private
SchoolsPerPerf$
:
BehaviorSubject
<
any
>
;
private
SchoolPerPerfSub
:
Subscription
;
private
StudentsSize$
:
BehaviorSubject
<
any
>
;
private
StudentsSizeSub
:
Subscription
;
public
perfecture
=
1
;
private
regionActive
=
<
number
>-
1
;
...
...
@@ -53,6 +55,7 @@ import {
private
_hds
:
HelperDataService
,
)
{
this
.
SchoolsPerPerf$
=
new
BehaviorSubject
([{}]);
this
.
StudentsSize$
=
new
BehaviorSubject
({});
this
.
formGroup
=
this
.
fb
.
group
({
});
...
...
@@ -94,4 +97,20 @@ import {
}
calccolor
(
id
)
{
this
.
StudentsSizeSub
=
this
.
_hds
.
getStudentPerSchool
(
id
,
'
5
'
,
2
,
0
,
0
).
subscribe
(
x
=>
{
this
.
StudentsSize$
.
next
(
x
);
console
.
log
(
id
,
x
,
"
test
"
);
});
if
(
id
==
147
)
return
true
;
if
(
id
==
150
)
return
true
;
}
}
source/containers/globalstyles.css
View file @
63e47e3a
...
...
@@ -176,6 +176,11 @@
background-color
:
#fd9665
;
}
.changecolor
{
background-color
:
cyan
;
}
.roundedNumber
{
width
:
2em
;
background-color
:
coral
;
...
...
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