@@ -28,19 +28,12 @@ class Controller
28
28
29
29
const PER_PAGE = 10 ;
30
30
31
- public static $ viewsDir ;
32
-
33
31
static $ sectionModels = [
34
- 'volunteers ' => ' App\Volunteers\Models\ Volunteer' ,
35
- 'hours ' => ' App\Volunteers\Models\ VolunteerHour' ,
36
- 'places ' => ' App\Volunteers\Models\ VolunteerPlace' ,
32
+ 'volunteers ' => Volunteer::class ,
33
+ 'hours ' => VolunteerHour::class ,
34
+ 'places ' => VolunteerPlace::class ,
37
35
];
38
36
39
- public function __construct ()
40
- {
41
- self ::$ viewsDir = __DIR__ .'/views ' ;
42
- }
43
-
44
37
/*
45
38
--- Admin: Dashboard ---
46
39
*/
@@ -74,7 +67,7 @@ public function index($req, $res)
74
67
$ periods [$ k ]['topVolunteer ' ] = (count ($ topVolunteers ) == 1 ) ? $ topVolunteers [0 ] : false ;
75
68
}
76
69
77
- return new View ('dashboard ' , [
70
+ return new View ('@admin/ dashboard ' , [
78
71
'org ' => $ org ,
79
72
'title ' => 'Pulse ' ,
80
73
'periods ' => $ periods ,
@@ -161,7 +154,7 @@ public function volunteersBrowse($req, $res)
161
154
$ this ->app ['errors ' ]->add ('As a volunteer coordinator, you cannot remove yourself. ' );
162
155
}
163
156
164
- return new View ('volunteers/browse ' , [
157
+ return new View ('@admin/ volunteers/browse ' , [
165
158
'org ' => $ org ,
166
159
'title ' => 'Volunteers ' ,
167
160
'volunteersPage ' => true ,
@@ -191,7 +184,7 @@ public function addVolunteerForm($req, $res)
191
184
return ;
192
185
}
193
186
194
- return new View ('volunteers/add ' , [
187
+ return new View ('@admin/ volunteers/add ' , [
195
188
'org ' => $ org ,
196
189
'title ' => 'Add Volunteers ' ,
197
190
'volunteersPage ' => true ,
@@ -327,7 +320,7 @@ public function addVolunteerImportForm($req, $res)
327
320
return ;
328
321
}
329
322
330
- return new View ('volunteers/import ' , [
323
+ return new View ('@admin/ volunteers/import ' , [
331
324
'org ' => $ org ,
332
325
'title ' => 'Import Volunteers ' ,
333
326
'volunteersPage ' => true ,
@@ -367,7 +360,7 @@ public function volunteersView($req, $res)
367
360
}
368
361
}
369
362
370
- return new View ('volunteers/view ' , [
363
+ return new View ('@admin/ volunteers/view ' , [
371
364
'org ' => $ org ,
372
365
'volunteer ' => $ volunteer ->toArray (),
373
366
'user ' => $ user ,
@@ -469,7 +462,7 @@ public function hoursBrowse($req, $res)
469
462
$ count = $ query ->count ();
470
463
$ numPages = ceil ($ count / $ perPage );
471
464
472
- return new View ('hours/browse ' , [
465
+ return new View ('@admin/ hours/browse ' , [
473
466
'org ' => $ org ,
474
467
'title ' => 'Volunteer Hours ' ,
475
468
'hoursPage ' => true ,
@@ -510,7 +503,7 @@ public function recordHoursStep1($req, $res)
510
503
->sort ('name ASC ' )
511
504
->all ();
512
505
513
- return new View ('hours/add1 ' , [
506
+ return new View ('@admin/ hours/add1 ' , [
514
507
'org ' => $ org ,
515
508
'title ' => 'Add Volunteer Hours ' ,
516
509
'hoursPage ' => true ,
@@ -578,7 +571,7 @@ public function recordHoursStep2($req, $res)
578
571
->limit (10 )
579
572
->column ();
580
573
581
- return new View ('hours/add2 ' , [
574
+ return new View ('@admin/ hours/add2 ' , [
582
575
'org ' => $ org ,
583
576
'title ' => 'Add Volunteer Hours ' ,
584
577
'hoursPage ' => true ,
@@ -662,7 +655,7 @@ public function recordHoursStep3($req, $res)
662
655
}
663
656
}
664
657
665
- return new View ('hours/add3 ' , [
658
+ return new View ('@admin/ hours/add3 ' , [
666
659
'org ' => $ org ,
667
660
'title ' => 'Confirm Volunteer Hours ' ,
668
661
'hoursPage ' => true ,
@@ -754,7 +747,7 @@ public function hoursView($req, $res)
754
747
755
748
list ($ org , $ hour , $ section ) = $ lookup ;
756
749
757
- return new View ('hours/view ' , [
750
+ return new View ('@admin/ hours/view ' , [
758
751
'org ' => $ org ,
759
752
'hour ' => $ hour ->toArray (),
760
753
'tags ' => $ hour ->tags (),
@@ -830,7 +823,7 @@ public function placesBrowse($req, $res)
830
823
$ count = $ query ->count ();
831
824
$ numPages = ceil ($ count / $ perPage );
832
825
833
- return new View ('places/browse ' , [
826
+ return new View ('@admin/ places/browse ' , [
834
827
'org ' => $ org ,
835
828
'title ' => 'Places ' ,
836
829
'placesPage ' => true ,
@@ -864,7 +857,7 @@ public function placesAddForm($req, $res)
864
857
'place_type ' => VolunteerPlace::INTERNAL ,
865
858
'address ' => '' , ], $ req ->request ());
866
859
867
- return new View ('places/modify ' , [
860
+ return new View ('@admin/ places/modify ' , [
868
861
'org ' => $ org ,
869
862
'title ' => 'Add Volunteer Places ' ,
870
863
'placesPage ' => true ,
@@ -909,7 +902,7 @@ public function placesView($req, $res)
909
902
->where ('place ' , $ place ->id ());
910
903
$ hours = $ query ->first (10 );
911
904
912
- return new View ('places/view ' , [
905
+ return new View ('@admin/ places/view ' , [
913
906
'org ' => $ org ,
914
907
'title ' => $ place ->name .' :: Places ' ,
915
908
'placesPage ' => true ,
@@ -929,7 +922,7 @@ public function placesEditForm($req, $res)
929
922
930
923
list ($ org , $ place , $ section ) = $ lookup ;
931
924
932
- return new View ('places/modify ' , [
925
+ return new View ('@admin/ places/modify ' , [
933
926
'org ' => $ org ,
934
927
'title ' => $ place ->name .' :: Places ' ,
935
928
'placesPage ' => true ,
@@ -1011,7 +1004,7 @@ public function reports($req, $res)
1011
1004
return ;
1012
1005
}
1013
1006
1014
- return new View ('reports ' , [
1007
+ return new View ('@admin/ reports ' , [
1015
1008
'org ' => $ org ,
1016
1009
'title ' => 'Reports ' ,
1017
1010
'reportsPage ' => true ,
0 commit comments