From 2394b8e419e3804ff478d414793a7a120f77d7df Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 3 Jan 2018 12:47:12 -0600 Subject: [PATCH] Rename field to image_link and add field to edit #111 --- app/Console/Services/Importer.php | 2 +- .../2017_06_21_165410_create_ranks_table.php | 2 +- app/Models/Rank.php | 4 +- resources/views/admin/ranks/fields.blade.php | 97 ++++++++++--------- .../views/admin/ranks/subfleets.blade.php | 4 +- 5 files changed, 59 insertions(+), 50 deletions(-) diff --git a/app/Console/Services/Importer.php b/app/Console/Services/Importer.php index 6dcef14e..1df5f7f6 100644 --- a/app/Console/Services/Importer.php +++ b/app/Console/Services/Importer.php @@ -270,7 +270,7 @@ class Importer $attrs = [ 'name' => $row->rank, - 'link' => $row->rankimage, + 'image_link' => $row->rankimage, 'hours' => $row->minhours, ]; diff --git a/app/Database/migrations/2017_06_21_165410_create_ranks_table.php b/app/Database/migrations/2017_06_21_165410_create_ranks_table.php index 4c04bc59..51ce74fe 100644 --- a/app/Database/migrations/2017_06_21_165410_create_ranks_table.php +++ b/app/Database/migrations/2017_06_21_165410_create_ranks_table.php @@ -16,7 +16,7 @@ class CreateRanksTable extends Migration Schema::create('ranks', function (Blueprint $table) { $table->increments('id'); $table->string('name', 50); - $table->string('link')->nullable(); + $table->string('image_link')->nullable(); $table->unsignedInteger('hours')->default(0); $table->boolean('auto_approve_acars')->default(false); $table->boolean('auto_approve_manual')->default(false); diff --git a/app/Models/Rank.php b/app/Models/Rank.php index 3dd4c343..306e593c 100644 --- a/app/Models/Rank.php +++ b/app/Models/Rank.php @@ -13,11 +13,11 @@ class Rank extends BaseModel public $fillable = [ 'name', - 'link', 'hours', + 'image_link', 'auto_approve_acars', 'auto_approve_manual', - 'auto_promote' + 'auto_promote', ]; protected $casts = [ diff --git a/resources/views/admin/ranks/fields.blade.php b/resources/views/admin/ranks/fields.blade.php index d0beafb7..0ede042a 100644 --- a/resources/views/admin/ranks/fields.blade.php +++ b/resources/views/admin/ranks/fields.blade.php @@ -1,53 +1,62 @@
- -
- {!! Form::label('name', 'Name:') !!} - {!! Form::text('name', null, ['class' => 'form-control']) !!} -
+ +
+ {!! Form::label('name', 'Name:') !!} + {!! Form::text('name', null, ['class' => 'form-control']) !!} +
- -
- {!! Form::label('hours', 'Hours:') !!} - {!! Form::number('hours', null, ['class' => 'form-control']) !!} + +
+ {!! Form::label('hours', 'Hours:') !!} + {!! Form::number('hours', null, ['class' => 'form-control']) !!} +
+
+
+ {!! Form::label('image_link', 'Image Link:') !!} + {!! Form::number('image_link', null, ['class' => 'form-control']) !!} +
+
+
+ +
+
+ +
+
- -
-
- + +
+
+ +
+
+ + +
+
+ +
- -
-
- +
+ +
+
+ {!! Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) !!} +
- - -
-
- -
-
- - -
-
- {!! Form::submit('Add', ['class' => 'btn btn-primary']) !!} -
-
-
diff --git a/resources/views/admin/ranks/subfleets.blade.php b/resources/views/admin/ranks/subfleets.blade.php index dd501786..f99056f5 100644 --- a/resources/views/admin/ranks/subfleets.blade.php +++ b/resources/views/admin/ranks/subfleets.blade.php @@ -40,9 +40,9 @@ 'placeholder' => 'Select Subfleet', 'class' => 'select2_dropdown form-control input-lg']) !!} - {!! Form::button(' add', + {!! Form::button(' Add', ['type' => 'submit', - 'class' => 'btn btn-success btn-s']) !!} + 'class' => 'btn btn-success btn-small']) !!} {!! Form::close() !!}