Rename field to image_link and add field to edit #111

This commit is contained in:
Nabeel Shahzad 2018-01-03 12:47:12 -06:00
parent 15726d0610
commit 2394b8e419
5 changed files with 59 additions and 50 deletions

View File

@ -270,7 +270,7 @@ class Importer
$attrs = [ $attrs = [
'name' => $row->rank, 'name' => $row->rank,
'link' => $row->rankimage, 'image_link' => $row->rankimage,
'hours' => $row->minhours, 'hours' => $row->minhours,
]; ];

View File

@ -16,7 +16,7 @@ class CreateRanksTable extends Migration
Schema::create('ranks', function (Blueprint $table) { Schema::create('ranks', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('name', 50); $table->string('name', 50);
$table->string('link')->nullable(); $table->string('image_link')->nullable();
$table->unsignedInteger('hours')->default(0); $table->unsignedInteger('hours')->default(0);
$table->boolean('auto_approve_acars')->default(false); $table->boolean('auto_approve_acars')->default(false);
$table->boolean('auto_approve_manual')->default(false); $table->boolean('auto_approve_manual')->default(false);

View File

@ -13,11 +13,11 @@ class Rank extends BaseModel
public $fillable = [ public $fillable = [
'name', 'name',
'link',
'hours', 'hours',
'image_link',
'auto_approve_acars', 'auto_approve_acars',
'auto_approve_manual', 'auto_approve_manual',
'auto_promote' 'auto_promote',
]; ];
protected $casts = [ protected $casts = [

View File

@ -1,18 +1,25 @@
<div class="row"> <div class="row">
<!-- Name Field --> <!-- Name Field -->
<div class="form-group col-sm-6"> <div class="col-sm-6">
{!! Form::label('name', 'Name:') !!} {!! Form::label('name', 'Name:') !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!} {!! Form::text('name', null, ['class' => 'form-control']) !!}
</div> </div>
<!-- Hours Field --> <!-- Hours Field -->
<div class="form-group col-sm-6"> <div class="col-sm-6">
{!! Form::label('hours', 'Hours:') !!} {!! Form::label('hours', 'Hours:') !!}
{!! Form::number('hours', null, ['class' => 'form-control']) !!} {!! Form::number('hours', null, ['class' => 'form-control']) !!}
</div>
</div> </div>
<div class="row">
<!-- Auto Approve Acars Field --> <div class="col-md-12">
<div class="form-group col-sm-4 text-center"> {!! Form::label('image_link', 'Image Link:') !!}
{!! Form::number('image_link', null, ['class' => 'form-control']) !!}
</div>
</div>
<div class="row">
<!-- Auto Approve Acars Field -->
<div class="col-sm-4 text-center">
<div class="checkbox"> <div class="checkbox">
<label class="checkbox-inline"> <label class="checkbox-inline">
{!! Form::hidden('auto_approve_acars', false) !!} {!! Form::hidden('auto_approve_acars', false) !!}
@ -20,10 +27,10 @@
{!! Form::label('auto_approve_acars', 'Auto Approve ACARS') !!} {!! Form::label('auto_approve_acars', 'Auto Approve ACARS') !!}
</label> </label>
</div> </div>
</div> </div>
<!-- Auto Approve Manual Field --> <!-- Auto Approve Manual Field -->
<div class="form-group col-sm-4 text-center"> <div class="col-sm-4 text-center">
<div class="checkbox"> <div class="checkbox">
<label class="checkbox-inline"> <label class="checkbox-inline">
{!! Form::hidden('auto_approve_manual', false) !!} {!! Form::hidden('auto_approve_manual', false) !!}
@ -31,10 +38,10 @@
{!! Form::label('auto_approve_manual', 'Auto Approve Manual') !!} {!! Form::label('auto_approve_manual', 'Auto Approve Manual') !!}
</label> </label>
</div> </div>
</div> </div>
<!-- Auto Promote Field --> <!-- Auto Promote Field -->
<div class="form-group col-sm-4 text-center"> <div class="col-sm-4 text-center">
<div class="checkbox"> <div class="checkbox">
<label class="checkbox-inline"> <label class="checkbox-inline">
{!! Form::hidden('auto_promote', false) !!} {!! Form::hidden('auto_promote', false) !!}
@ -42,12 +49,14 @@
{!! Form::label('auto_promote', 'Auto Promote') !!} {!! Form::label('auto_promote', 'Auto Promote') !!}
</label> </label>
</div> </div>
</div>
<!-- Submit Field -->
<div class="form-group col-sm-12 text-right">
<div class="pull-right">
{!! Form::submit('Add', ['class' => 'btn btn-primary']) !!}
</div> </div>
</div> </div>
<div class="row">
<!-- Submit Field -->
<div class="col-sm-12">
<div class="text-right">
{!! Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) !!}
</div>
</div>
</div> </div>

View File

@ -40,9 +40,9 @@
'placeholder' => 'Select Subfleet', 'placeholder' => 'Select Subfleet',
'class' => 'select2_dropdown form-control input-lg']) 'class' => 'select2_dropdown form-control input-lg'])
!!} !!}
{!! Form::button('<i class="fa fa-times"></i> add', {!! Form::button('<i class="fa fa-plus"></i> Add',
['type' => 'submit', ['type' => 'submit',
'class' => 'btn btn-success btn-s']) !!} 'class' => 'btn btn-success btn-small']) !!}
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>