From 2164659838d60f6e21b241519fb10cae9df492c0 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sun, 5 Nov 2017 11:07:57 +0800 Subject: [PATCH] Add feature tasks sort button to sort tasks priorities --- app/Http/Requests/Accounts/RegisterRequest.php | 2 +- resources/lang/id/app.php | 1 + resources/lang/id/feature.php | 1 + .../views/features/partials/feature-show.blade.php | 4 ++-- .../features/partials/feature-tasks.blade.php | 25 ++++++++++++++++++---- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/Http/Requests/Accounts/RegisterRequest.php b/app/Http/Requests/Accounts/RegisterRequest.php index b010081..fb2888c 100644 --- a/app/Http/Requests/Accounts/RegisterRequest.php +++ b/app/Http/Requests/Accounts/RegisterRequest.php @@ -25,7 +25,7 @@ class RegisterRequest extends Request { return [ 'name' => 'required|max:255', - 'email' => 'required|email|max:255|unique:users,email|unique:agencies,email', + 'email' => 'required|email|max:255|unique:users,email', 'password' => 'required|between:6,15|confirmed', 'password_confirmation' => 'required', ]; diff --git a/resources/lang/id/app.php b/resources/lang/id/app.php index 24df63b..0d55159 100644 --- a/resources/lang/id/app.php +++ b/resources/lang/id/app.php @@ -35,6 +35,7 @@ return [ 'delete_confirm_button' => 'Ya, silakan hapus!', 'delete_confirm' => 'Anda yakin ingin menghapus?', 'change_photo' => 'Ganti Foto', + 'done' => 'Selesai', // Attributes 'name' => 'Nama', diff --git a/resources/lang/id/feature.php b/resources/lang/id/feature.php index 3b33b01..e66cae6 100644 --- a/resources/lang/id/feature.php +++ b/resources/lang/id/feature.php @@ -25,6 +25,7 @@ return [ 'deleted' => 'Hapus data Fitur telah berhasil.', 'undeleted' => 'Data Fitur gagal dihapus.', 'add_from_other_project' => 'Tambah Fitur dari Project Lain', + 'sort_tasks' => 'Urutkan Prioritas Task', // Attributes 'name' => 'Nama Fitur', diff --git a/resources/views/features/partials/feature-show.blade.php b/resources/views/features/partials/feature-show.blade.php index 0604b44..ceb00eb 100644 --- a/resources/views/features/partials/feature-show.blade.php +++ b/resources/views/features/partials/feature-show.blade.php @@ -2,7 +2,7 @@

{{ trans('feature.show') }}

- + @@ -11,4 +11,4 @@
{{ trans('feature.name') }}{{ $feature->name }}
{{ trans('feature.name') }}{{ $feature->name }}
{{ trans('feature.type') }}{{ $feature->type() }}
{{ trans('feature.price') }}{{ formatRp($feature->price) }}
{{ trans('feature.tasks_count') }}{{ $feature->tasks->count() }}
{{ trans('feature.description') }}{!! nl2br($feature->description) !!}
- \ No newline at end of file + diff --git a/resources/views/features/partials/feature-tasks.blade.php b/resources/views/features/partials/feature-tasks.blade.php index 112c71e..cd04901 100644 --- a/resources/views/features/partials/feature-tasks.blade.php +++ b/resources/views/features/partials/feature-tasks.blade.php @@ -1,5 +1,12 @@ -
-

{{ trans('feature.tasks') }}

+
+
+ @if (request('action') == 'sort_tasks') + {{ link_to_route('features.show', trans('app.done'), [$feature->id], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin: -2px -8px']) }} + @else + {{ link_to_route('features.show', trans('feature.sort_tasks'), [$feature->id, 'action' => 'sort_tasks', '#feature-tasks'], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin: -2px -8px']) }} + @endif +

{{ trans('feature.tasks') }}

+
@@ -49,12 +56,20 @@ - +
{{ trans('app.table_no') }}
Total {{ formatDecimal($feature->tasks->avg('progress')) }} % + @if (request('action') == 'sort_tasks') + {{ link_to_route('features.show', trans('app.done'), [$feature->id], ['class' => 'btn btn-default btn-xs pull-right']) }} + @else + {{ link_to_route('features.show', trans('feature.sort_tasks'), [$feature->id, 'action' => 'sort_tasks', '#feature-tasks'], ['class' => 'btn btn-default btn-xs pull-right']) }} + @endif +
+@if (request('action') == 'sort_tasks') + @section('ext_js') {!! Html::script(url('assets/js/plugins/jquery-ui.min.js')) !!} @endsection @@ -72,4 +87,6 @@ }); })(); -@endsection \ No newline at end of file +@endsection + +@endif