@@ -75,16 +75,11 @@ public function indexAction(): Response
75
75
->groupBy ('p.probid ' )
76
76
->getQuery ()->getResult ();
77
77
78
- $ badgeTitle = '' ;
79
- $ currentContest = $ this ->dj ->getCurrentContest ();
80
- if ($ currentContest !== null ) {
81
- $ badgeTitle = 'in ' . $ currentContest ->getShortname ();
82
- }
83
78
$ table_fields = [
84
79
'probid ' => ['title ' => 'ID ' , 'sort ' => true , 'default_sort ' => true ],
85
80
'externalid ' => ['title ' => 'external ID ' , 'sort ' => true ],
86
81
'name ' => ['title ' => 'name ' , 'sort ' => true ],
87
- 'badges ' => ['title ' => $ badgeTitle , 'sort ' => false ],
82
+ 'badges ' => ['title ' => '' , 'sort ' => false ],
88
83
'num_contests ' => ['title ' => '# contests ' , 'sort ' => true ],
89
84
'timelimit ' => ['title ' => 'time limit ' , 'sort ' => true ],
90
85
'memlimit ' => ['title ' => 'memory limit ' , 'sort ' => true ],
@@ -107,7 +102,8 @@ public function indexAction(): Response
107
102
}
108
103
109
104
$ propertyAccessor = PropertyAccess::createPropertyAccessor ();
110
- $ problems_table = [];
105
+ $ problems_table_current = [];
106
+ $ problems_table_other = [];
111
107
foreach ($ problems as $ row ) {
112
108
/** @var Problem $p */
113
109
$ p = $ row [0 ];
@@ -221,15 +217,20 @@ public function indexAction(): Response
221
217
'type ' => ['value ' => $ type ],
222
218
]);
223
219
224
- // Save this to our list of rows
225
- $ problems_table [] = [
220
+ $ data_to_add = [
226
221
'data ' => $ problemdata ,
227
222
'actions ' => $ problemactions ,
228
223
'link ' => $ this ->generateUrl ('jury_problem ' , ['probId ' => $ p ->getProbid ()]),
229
224
];
225
+ if ($ badges ) {
226
+ $ problems_table_current [] = $ data_to_add ;
227
+ } else {
228
+ $ problems_table_other [] = $ data_to_add ;
229
+ }
230
230
}
231
231
$ data = [
232
- 'problems ' => $ problems_table ,
232
+ 'problems_current ' => $ problems_table_current ,
233
+ 'problems_other ' => $ problems_table_other ,
233
234
'table_fields ' => $ table_fields ,
234
235
];
235
236
0 commit comments