Skip to content

Commit

Permalink
Use wording suggested by Tobi
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Oct 4, 2023
1 parent 10fb800 commit d2c55ec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions webapp/src/Controller/Jury/ExecutableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function __construct(
#[Route(path: '', name: 'jury_executables')]
public function indexAction(Request $request): Response
{
$executables_tables_enabled = [];
$executables_tables_disabled = [];
$executables_tables_used = [];
$executables_tables_unused = [];
$data = [];
$form = $this->createForm(ExecutableUploadType::class, $data);
$form->handleRequest($request);
Expand Down Expand Up @@ -127,14 +127,14 @@ public function indexAction(Request $request): Response
'link' => $this->generateUrl('jury_executable_download', ['execId' => $e->getExecid()])
];

if ($e->checkEnabled($configScripts)) {
$executables_tables_enabled[] = [
if ($e->checkUsed($configScripts)) {
$executables_tables_used[] = [
'data' => $execdata,
'actions' => $execactions,
'link' => $this->generateUrl('jury_executable', ['execId' => $e->getExecid()]),
];
} else {
$executables_tables_disabled[] = [
$executables_tables_unused[] = [
'data' => $execdata,
'actions' => $execactions,
'link' => $this->generateUrl('jury_executable', ['execId' => $e->getExecid()]),
Expand All @@ -146,8 +146,8 @@ public function indexAction(Request $request): Response
unset($table_fields['type']);

return $this->render('jury/executables.html.twig', [
'executables_enabled' => $executables_tables_enabled,
'executables_disabled' => $executables_tables_disabled,
'executables_used' => $executables_tables_used,
'executables_unused' => $executables_tables_unused,
'table_fields' => $table_fields,
'form' => $form,
]);
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/Entity/Executable.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function getZipfileContent(string $tempdir): string
/**
* @param string[] $configScripts
*/
public function checkEnabled(array $configScripts): bool
public function checkUsed(array $configScripts): bool
{
foreach ($configScripts as $config_script) {
if ($this->execid === $config_script) {
Expand Down
8 changes: 4 additions & 4 deletions webapp/templates/jury/executables.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

{% block content %}

<h1>Enabled executables</h1>
{{ macros.table(executables_enabled, table_fields, {'ordering': 'false'}) }}
<h1>Used executables</h1>
{{ macros.table(executables_used, table_fields, {'ordering': 'false'}) }}

<h1>Disabled executables</h1>
{{ macros.table(executables_disabled, table_fields, {'ordering': 'false'}) }}
<h1>Unused executables</h1>
{{ macros.table(executables_unused, table_fields, {'ordering': 'false'}) }}

{% if is_granted('ROLE_ADMIN') %}
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ExecutableControllerTest extends JuryControllerTestCase
protected static string $deleteEntityIdentifier = 'description';
protected static string $getIDFunc = 'getExecid';
protected static string $className = Executable::class;
protected static array $DOM_elements = ['h1' => ['Enabled executables', 'Disabled executables']];
protected static array $DOM_elements = ['h1' => ['Used executables', 'Unused executables']];
protected static string $addForm = 'executable_upload[';
protected static array $addEntitiesShown = ['type'];
protected static array $addEntities = [];
Expand Down

0 comments on commit d2c55ec

Please sign in to comment.