aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Micieli <micieli@laposte.net>2019-10-26 15:06:43 +0200
committerWilly Micieli <micieli@laposte.net>2019-10-26 15:06:43 +0200
commit17ee9bb9c738ad0036c9444fe3a5a7998a101675 (patch)
tree3db1c85a1bfcc48f6dbbcf17ff575a8d419a01bc
parent8fbf41112f40955fed848586d2bf2d13fea3f6aa (diff)
downloadimperium-17ee9bb9c738ad0036c9444fe3a5a7998a101675.zip
imperium-17ee9bb9c738ad0036c9444fe3a5a7998a101675.tar.gz
fix todo texts
-rw-r--r--config/todo.yaml6
-rw-r--r--imperium/Controller/Task.php8
2 files changed, 10 insertions, 4 deletions
diff --git a/config/todo.yaml b/config/todo.yaml
new file mode 100644
index 0000000..f013e81
--- /dev/null
+++ b/config/todo.yaml
@@ -0,0 +1,6 @@
+todo_not_created: 'The task has not been created'
+todo_created: 'The task has been created'
+todo_updated: 'The task has been updated'
+todo_not_updated: 'The task has not been updated'
+toto_not_close: 'The task has not been closed'
+toto_closed: 'The task is now closed' \ No newline at end of file
diff --git a/imperium/Controller/Task.php b/imperium/Controller/Task.php
index 8ea2f1c..7a9d048 100644
--- a/imperium/Controller/Task.php
+++ b/imperium/Controller/Task.php
@@ -32,7 +32,7 @@ namespace Imperium\Controller {
*/
public function finish(int $id): RedirectResponse
{
- return Todo::destroy($id) ? $this->back('removed') : $this->back('not removed',false);
+ return Todo::destroy($id) ? $this->back($this->config('todo','toto_closed')) : $this->back($this->config('todo','toto_not_close'),false);
}
/**
@@ -47,7 +47,7 @@ namespace Imperium\Controller {
*/
public function update(): RedirectResponse
{
- return Todo::update($this->request()->request->get('id'),$this->collect($this->request()->request->all())->del(CSRF_TOKEN,'method')->all()) ? $this->back('updated') : $this->back('not updated',false);
+ return Todo::update($this->request()->request->get('id'),$this->collect($this->request()->request->all())->del(CSRF_TOKEN,'method')->all()) ? $this->back($this->config('todo','todo_updated')) : $this->back($this->config('todo','todo_not_updated'),false);
}
/**
@@ -64,7 +64,7 @@ namespace Imperium\Controller {
public function add(): RedirectResponse
{
$todo = collect($this->request()->request->all())->del(CSRF_TOKEN,'method')->all();
- return Todo::create($todo) ? $this->back('created') : $this->back('fail',false);
+ return Todo::create($todo) ? $this->back($this->config('todo','todo_created')) : $this->back($this->config('todo','todo_not_created'),false);
}
/**
@@ -94,7 +94,7 @@ namespace Imperium\Controller {
->end_row_and_new()
->select(false,'priority',['none','low','medium','high'])
->end_row_and_new()
- ->submit('add')
+ ->submit(fa('fa','fa-plus'))
->end_row()
->get();
return $this->view('@todo/home',compact('todo','form'));