diff --git a/app/Http/Controllers/TaskKanbanController.php b/app/Http/Controllers/TaskKanbanController.php index 5fa87c69d4f0..e93b854127a2 100644 --- a/app/Http/Controllers/TaskKanbanController.php +++ b/app/Http/Controllers/TaskKanbanController.php @@ -14,10 +14,10 @@ class TaskKanbanController extends BaseController */ public function index() { - $tasks = Task::scope()->with(['project', 'client'])->get(); + $tasks = Task::scope()->with(['project', 'client', 'task_status'])->orderBy('task_status_sort_order')->get(); + $stauses = TaskStatus::scope()->orderBy('sort_order')->get(); $projects = Project::scope()->get(); $clients = Client::scope()->get(); - $stauses = TaskStatus::scope()->get(); // check initial statuses exist if (! $stauses->count()) { diff --git a/app/Models/Task.php b/app/Models/Task.php index ddf7dc67ff7e..531f72cf768f 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -79,6 +79,14 @@ class Task extends EntityModel return $this->belongsTo('App\Models\Project')->withTrashed(); } + /** + * @return mixed + */ + public function task_status() + { + return $this->belongsTo('App\Models\TaskStatus')->withTrashed(); + } + /** * @param $task * diff --git a/resources/views/tasks/kanban.blade.php b/resources/views/tasks/kanban.blade.php index 7fcd5ee846b3..ec424140dd53 100644 --- a/resources/views/tasks/kanban.blade.php +++ b/resources/views/tasks/kanban.blade.php @@ -10,6 +10,10 @@ min-height: 540px; } + .kanban input { + width: 100%; + } + .kanban-column { background-color: #E9E9E9; padding: 10px; @@ -110,6 +114,7 @@ var projectMap = {}; var clientMap = {}; + var statusMap = {}; ko.bindingHandlers.enterkey = { init: function (element, valueAccessor, allBindings, viewModel) { @@ -143,6 +148,7 @@ for (var i=0; i
-
- +
- -
+