From 9e38399fe247b51797e11ba2d451adb97fdde319 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sun, 5 Nov 2017 11:36:39 +0800 Subject: [PATCH] Add project features sort button to sort features priorities --- resources/lang/id/project.php | 1 + resources/views/projects/features.blade.php | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/resources/lang/id/project.php b/resources/lang/id/project.php index 336c8a8..1e6f6a0 100644 --- a/resources/lang/id/project.php +++ b/resources/lang/id/project.php @@ -28,6 +28,7 @@ return [ 'features_export_html' => 'Export HTML', 'features_export_excel' => 'Export Excel', 'features_export_progress_excel' => 'Export Progress', + 'sort_features' => 'Urutkan Prioritas Fitur', // Attributes 'name' => 'Nama Project', diff --git a/resources/views/projects/features.blade.php b/resources/views/projects/features.blade.php index 8dd94f6..23b3827 100755 --- a/resources/views/projects/features.blade.php +++ b/resources/views/projects/features.blade.php @@ -17,12 +17,18 @@ @foreach($features->groupBy('type_id') as $key => $groupedFeatures) -
+
- {!! link_to_route('projects.features-export', trans('project.features_export_html'), [$project->id, 'html', 'feature_type' => $key], ['class' => '','target' => '_blank']) !!} | - {!! link_to_route('projects.features-export', trans('project.features_export_excel'), [$project->id, 'excel', 'feature_type' => $key], ['class' => '']) !!} | - {!! link_to_route('projects.features-export', trans('project.features_export_progress_excel'), [$project->id, 'excel-progress', 'feature_type' => $key], ['class' => '']) !!} + @if (request('action') == 'sort_features') + {{ link_to_route('projects.features', trans('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin-top: -2px; margin-left: 6px; margin-right: -8px']) }} + @else + {{ link_to_route('projects.features', trans('project.sort_features'), [$project->id, 'action' => 'sort_features', '#project-features'], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin-top: -2px; margin-left: 6px; margin-right: -8px']) }} + + {!! link_to_route('projects.features-export', trans('project.features_export_html'), [$project->id, 'html', 'feature_type' => $key], ['class' => '','target' => '_blank']) !!} | + {!! link_to_route('projects.features-export', trans('project.features_export_excel'), [$project->id, 'excel', 'feature_type' => $key], ['class' => '']) !!} | + {!! link_to_route('projects.features-export', trans('project.features_export_progress_excel'), [$project->id, 'excel-progress', 'feature_type' => $key], ['class' => '']) !!} + @endif

{{ $key == 1 ? 'Daftar Fitur' : 'Fitur Tambahan' }} @@ -78,7 +84,13 @@ ({{ formatDecimal($project->getFeatureOveralProgress()) }} %) {{ formatRp($groupedFeatures->sum('price')) }} - + + @if (request('action') == 'sort_features') + {{ link_to_route('projects.features', trans('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right']) }} + @else + {{ link_to_route('projects.features', trans('project.sort_features'), [$project->id, 'action' => 'sort_features', '#project-features'], ['class' => 'btn btn-default btn-xs pull-right']) }} + @endif + @@ -87,6 +99,8 @@ @endsection +@if (request('action') == 'sort_features') + @section('ext_js') {!! Html::script(url('assets/js/plugins/jquery-ui.min.js')) !!} @endsection @@ -103,4 +117,6 @@ }); })(); -@endsection \ No newline at end of file +@endsection + +@endif