From 51f6926216662806526d2d632f3092648e6b3c96 Mon Sep 17 00:00:00 2001 From: Johan Alvarez Date: Tue, 4 Oct 2016 22:58:21 -0500 Subject: [PATCH] Actualizaciones menores --- src/Providers/RouteGenerator.php | 2 +- src/Resources/Views/GeneratorTemplates/model.blade.php | 2 ++ .../Views/GeneratorTemplates/pageObjects/Create.blade.php | 1 - .../Views/GeneratorTemplates/pageObjects/Delete.blade.php | 1 - .../Views/GeneratorTemplates/pageObjects/Edit.blade.php | 1 - .../Views/GeneratorTemplates/pageObjects/Index.blade.php | 1 - .../Views/GeneratorTemplates/pageObjects/Show.blade.php | 1 - src/Resources/Views/GeneratorTemplates/views/create.php | 2 +- src/Resources/Views/GeneratorTemplates/views/edit.php | 2 +- src/Resources/Views/GeneratorTemplates/views/show.php | 2 +- 10 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Providers/RouteGenerator.php b/src/Providers/RouteGenerator.php index 341bb58..66ed06c 100644 --- a/src/Providers/RouteGenerator.php +++ b/src/Providers/RouteGenerator.php @@ -92,7 +92,7 @@ public function generateRoute() // restaurar archivos de papelera if ($this->hasDeletedAtColumn($this->fields)) { - $restore_route = "Route::put(\n\t'/{$this->route()}/restore/{{$this->modelClassName()}}',\n\t[\n\t'as' => '{$this->route()}.restore',\n\t'uses' => '{$this->controllerClassName()}@restore'\n\t]\n);\n"; + $restore_route = "Route::put(\n\t'/{$this->route()}/restore/{{$this->table_name}}',\n\t[\n\t'as' => '{$this->route()}.restore',\n\t'uses' => '{$this->controllerClassName()}@restore'\n\t]\n);\n"; $route = $restore_route.$route; } diff --git a/src/Resources/Views/GeneratorTemplates/model.blade.php b/src/Resources/Views/GeneratorTemplates/model.blade.php index c993c53..56f026e 100644 --- a/src/Resources/Views/GeneratorTemplates/model.blade.php +++ b/src/Resources/Views/GeneratorTemplates/model.blade.php @@ -147,6 +147,8 @@ public static function findRequested($request) // ordenamos los resultados $request->get('sort') and $query->orderBy($request->get('sort'), $request->get('sortType', 'asc')); + !$request->has('sort') and $query->orderBy('created_at', 'desc'); + // paginamos los resultados return $query->paginate(15); } diff --git a/src/Resources/Views/GeneratorTemplates/pageObjects/Create.blade.php b/src/Resources/Views/GeneratorTemplates/pageObjects/Create.blade.php index 3223f77..7f7295d 100644 --- a/src/Resources/Views/GeneratorTemplates/pageObjects/Create.blade.php +++ b/src/Resources/Views/GeneratorTemplates/pageObjects/Create.blade.php @@ -50,7 +50,6 @@ class {{$test}} extends Base public function __construct(\FunctionalTester $I) { - $this->functionalTester = $I; parent::__construct($I); $this->initUIMap(); diff --git a/src/Resources/Views/GeneratorTemplates/pageObjects/Delete.blade.php b/src/Resources/Views/GeneratorTemplates/pageObjects/Delete.blade.php index a703dcf..3aa133a 100644 --- a/src/Resources/Views/GeneratorTemplates/pageObjects/Delete.blade.php +++ b/src/Resources/Views/GeneratorTemplates/pageObjects/Delete.blade.php @@ -47,7 +47,6 @@ class {{$test}} extends Base public function __construct(\FunctionalTester $I) { - $this->functionalTester = $I; parent::__construct($I); self::$deleteBtn = [ diff --git a/src/Resources/Views/GeneratorTemplates/pageObjects/Edit.blade.php b/src/Resources/Views/GeneratorTemplates/pageObjects/Edit.blade.php index 145cbdb..c36d256 100644 --- a/src/Resources/Views/GeneratorTemplates/pageObjects/Edit.blade.php +++ b/src/Resources/Views/GeneratorTemplates/pageObjects/Edit.blade.php @@ -47,7 +47,6 @@ class {{$test}} extends Base public function __construct(\FunctionalTester $I) { - $this->functionalTester = $I; parent::__construct($I); self::$linkToEdit = [ diff --git a/src/Resources/Views/GeneratorTemplates/pageObjects/Index.blade.php b/src/Resources/Views/GeneratorTemplates/pageObjects/Index.blade.php index b593ac9..ffd5e6e 100644 --- a/src/Resources/Views/GeneratorTemplates/pageObjects/Index.blade.php +++ b/src/Resources/Views/GeneratorTemplates/pageObjects/Index.blade.php @@ -35,7 +35,6 @@ class {{$test}} extends Base public function __construct(\FunctionalTester $I) { - $this->functionalTester = $I; parent::__construct($I); self::$title = [ diff --git a/src/Resources/Views/GeneratorTemplates/pageObjects/Show.blade.php b/src/Resources/Views/GeneratorTemplates/pageObjects/Show.blade.php index 4a906fc..3ca6a85 100644 --- a/src/Resources/Views/GeneratorTemplates/pageObjects/Show.blade.php +++ b/src/Resources/Views/GeneratorTemplates/pageObjects/Show.blade.php @@ -35,7 +35,6 @@ class {{$test}} extends Base public function __construct(\FunctionalTester $I) { - $this->functionalTester = $I; parent::__construct($I); self::$title = [ diff --git a/src/Resources/Views/GeneratorTemplates/views/create.php b/src/Resources/Views/GeneratorTemplates/views/create.php index ca73128..bbd5734 100644 --- a/src/Resources/Views/GeneratorTemplates/views/create.php +++ b/src/Resources/Views/GeneratorTemplates/views/create.php @@ -27,7 +27,7 @@ @include ('layout.notifications') -
+
{!! Form::open(['route' => 'route()?>.store', 'method' => 'POST', 'name' => 'create-getDashedModelName()?>-form']) !!} diff --git a/src/Resources/Views/GeneratorTemplates/views/edit.php b/src/Resources/Views/GeneratorTemplates/views/edit.php index 5e32319..81816b5 100644 --- a/src/Resources/Views/GeneratorTemplates/views/edit.php +++ b/src/Resources/Views/GeneratorTemplates/views/edit.php @@ -27,7 +27,7 @@ @include ('layout.notifications')
-
+
{!! Form::model($modelVariableName()?>, ['route' => ['route()?>.update', $modelVariableName()?>->id], 'method' => 'PUT', 'name' => 'edit-getDashedModelName()?>-form']) !!} diff --git a/src/Resources/Views/GeneratorTemplates/views/show.php b/src/Resources/Views/GeneratorTemplates/views/show.php index b36922d..2235228 100644 --- a/src/Resources/Views/GeneratorTemplates/views/show.php +++ b/src/Resources/Views/GeneratorTemplates/views/show.php @@ -27,7 +27,7 @@ @include ('layout.notifications')
-
+
{!! Form::model($modelVariableName()?>, ['name' => 'show-getDashedModelName()?>-form', 'data-show' => ($show = true)]) !!}