diff --git a/src/Controller/JobController.php b/src/Controller/JobController.php index 56c7522..c698e77 100644 --- a/src/Controller/JobController.php +++ b/src/Controller/JobController.php @@ -33,7 +33,7 @@ class JobController extends AbstractController return $this->render('job/view.html.twig', ['job' => $job, 'runs' => $runs, 'allruns' => $all == 'all']); } elseif($request->getMethod() == 'DELETE') { $success = $jobRepo->deleteJob($id); - $this->addFlash('success', $success['message']); + $this->addFlash('success', 'job.index.flashes.jobdeleted'); return new JsonResponse(['return_path' => $this->GenerateUrl('job_index')]); } return new JsonResponse(['success'=>false, 'message' => 'Your request is invalid'], Response::HTTP_BAD_REQUEST); @@ -55,7 +55,7 @@ class JobController extends AbstractController $this->addFlash('danger', $e->getMessage()); return new RedirectResponse($this->GenerateUrl('job_edit', ['id' => $allValues['id']])); } - $this->addFlash('success', $joboutput['message']); + $this->addFlash('success', 'settings.edit.flashes.jobedited'); return new RedirectResponse($this->GenerateUrl('job_index')); } return new JsonResponse(['success'=>false, 'message' => 'Your request is invalid'], Response::HTTP_BAD_REQUEST); @@ -74,7 +74,7 @@ class JobController extends AbstractController $this->addFlash('danger', $e->getMessage()); return new RedirectResponse($this->GenerateUrl('job_add')); } - $this->addFlash('success', $joboutput['message']); + $this->addFlash('success', 'settings.add.flashes.jobadded'); return new RedirectResponse($this->GenerateUrl('job_index')); } else { return new Response('Not implemented yet', Response::HTTP_TOO_EARLY); diff --git a/translations/messages.en-l33t.yaml b/translations/messages.en-l33t.yaml index 55022a3..37eea5f 100644 --- a/translations/messages.en-l33t.yaml +++ b/translations/messages.en-l33t.yaml @@ -41,6 +41,8 @@ job: success: "Cr0nj0b succ3sfuLLy r4n" failed: "Cr0nj0b f41L3d. PL34s3 ch3ck 0utput b3L0w" message: "Cr0nj0b r4n 1n _runtime_ s3c0ndz w1th 3x1t c0d3 _exitcode_" + flashes: + jobdeleted: "Cr0nj0b b succ3ssfuLLy d3L3t3d" view: title: "0v3rv13w 0f runz 4 _jobname_" header: "0v3rv13w 0f runz 4 _jobname_" @@ -58,9 +60,13 @@ job: edit: title: "3d1t j0b" header: "3d1t j0b _jobname_" + flashes: + jobadded: "Cr0nj0b succ3ssfuLLy 3d1t3d" add: title: "4dd j0b" header: "4dd n3w j0b" + flashes: + jobadded: "Cr0nj0b succ3ssfuLLy 4dd3d" addedit: generalinfo: header: "G3n3r4L 1nf0" diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml index 902980f..e75f5f3 100644 --- a/translations/messages.en.yaml +++ b/translations/messages.en.yaml @@ -41,6 +41,8 @@ job: success: "Cronjob succesfully ran" failed: "Cronjob failed. Please check output below" message: "Cronjob ran in _runtime_ seconds with exit code _exitcode_" + flashes: + jobdeleted: "Cronjob is successfully deleted" view: title: "Overview of runs for _jobname_" header: "Overview of runs for _jobname_" @@ -58,9 +60,13 @@ job: edit: title: "Edit job" header: "Edit job _jobname_" + flashes: + jobadded: "Cronjob successfully edited" add: title: "Add job" header: "Add new job" + flashes: + jobadded: "Cronjob successfully added" addedit: generalinfo: header: "General info" diff --git a/translations/messages.nl.yaml b/translations/messages.nl.yaml index e44751f..818f69f 100644 --- a/translations/messages.nl.yaml +++ b/translations/messages.nl.yaml @@ -42,6 +42,8 @@ job: success: "Taak werd succesvol uitgevoerd" failed: "Taak faalde. Hieronder vind u de output ter controle" message: "Taak werd in _runtime_ seconden uitgevoerd met resultaat _exitcode_" + flashes: + jobdeleted: "Taak werd succesvol verwijderd" view: title: "Overzicht van uitvoeringen van _jobname_" header: "Overzicht van uitvoeringen van _jobname_" @@ -59,9 +61,13 @@ job: edit: title: "Bewerk taak" header: "Bewerk taak _jobname_" + flashes: + jobedited: "Taak werd succesvol bijgewerkt" add: title: "Taak toevoegen" header: "Nieuwe taak toevoegen" + flashes: + jobadded: "Taak werd succesvol toegevoegd" addedit: generalinfo: header: "Algemene info"