File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
webapp/src/Controller/Jury Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -158,14 +158,28 @@ public function indexAction(): Response
158
158
'probId ' => $ p ->getProbid (),
159
159
])
160
160
];
161
- $ problemactions [] = [
161
+
162
+ $ problemIsLocked = false ;
163
+ foreach ($ p ->getContestProblems () as $ contestProblem ) {
164
+ if ($ contestProblem ->getContest ()->isLocked ()) {
165
+ $ problemIsLocked = true ;
166
+ }
167
+ }
168
+
169
+ $ deleteAction = [
162
170
'icon ' => 'trash-alt ' ,
163
171
'title ' => 'delete this problem ' ,
164
172
'link ' => $ this ->generateUrl ('jury_problem_delete ' , [
165
173
'probId ' => $ p ->getProbid (),
166
174
]),
167
175
'ajaxModal ' => true ,
168
176
];
177
+ if ($ problemIsLocked ) {
178
+ $ deleteAction ['title ' ] .= ' - problem belongs to a locked contest ' ;
179
+ $ deleteAction ['disabled ' ] = true ;
180
+ unset($ deleteAction ['link ' ]);
181
+ }
182
+ $ problemactions [] = $ deleteAction ;
169
183
}
170
184
171
185
// Add formatted {mem,output}limit row data for the table.
You can’t perform that action at this time.
0 commit comments