@@ -75,16 +75,11 @@ public function indexAction(): Response
7575 ->groupBy ('p.probid ' )
7676 ->getQuery ()->getResult ();
7777
78- $ badgeTitle = '' ;
79- $ currentContest = $ this ->dj ->getCurrentContest ();
80- if ($ currentContest !== null ) {
81- $ badgeTitle = 'in ' . $ currentContest ->getShortname ();
82- }
8378 $ table_fields = [
8479 'probid ' => ['title ' => 'ID ' , 'sort ' => true , 'default_sort ' => true ],
8580 'externalid ' => ['title ' => 'external ID ' , 'sort ' => true ],
8681 'name ' => ['title ' => 'name ' , 'sort ' => true ],
87- 'badges ' => ['title ' => $ badgeTitle , 'sort ' => false ],
82+ 'badges ' => ['title ' => '' , 'sort ' => false ],
8883 'num_contests ' => ['title ' => '# contests ' , 'sort ' => true ],
8984 'timelimit ' => ['title ' => 'time limit ' , 'sort ' => true ],
9085 'memlimit ' => ['title ' => 'memory limit ' , 'sort ' => true ],
@@ -107,7 +102,8 @@ public function indexAction(): Response
107102 }
108103
109104 $ propertyAccessor = PropertyAccess::createPropertyAccessor ();
110- $ problems_table = [];
105+ $ problems_table_current = [];
106+ $ problems_table_other = [];
111107 foreach ($ problems as $ row ) {
112108 /** @var Problem $p */
113109 $ p = $ row [0 ];
@@ -221,15 +217,20 @@ public function indexAction(): Response
221217 'type ' => ['value ' => $ type ],
222218 ]);
223219
224- // Save this to our list of rows
225- $ problems_table [] = [
220+ $ data_to_add = [
226221 'data ' => $ problemdata ,
227222 'actions ' => $ problemactions ,
228223 'link ' => $ this ->generateUrl ('jury_problem ' , ['probId ' => $ p ->getProbid ()]),
229224 ];
225+ if ($ badges ) {
226+ $ problems_table_current [] = $ data_to_add ;
227+ } else {
228+ $ problems_table_other [] = $ data_to_add ;
229+ }
230230 }
231231 $ data = [
232- 'problems ' => $ problems_table ,
232+ 'problems_current ' => $ problems_table_current ,
233+ 'problems_other ' => $ problems_table_other ,
233234 'table_fields ' => $ table_fields ,
234235 ];
235236
0 commit comments