Initial upload icon support

This commit is contained in:
Chris
2018-02-02 15:16:55 +00:00
parent daa7079b0c
commit e32d9609e7
7 changed files with 46 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<section class="item-container">
<div class="item" style="background-color: {{ $app->colour }}">
@if($app->icon)
<img src="" />
<img src="{{ asset('storage/'.$app->icon) }}" />
@else
<i class="fas fa-app-store-ios"></i>
@endif

View File

@@ -2,7 +2,7 @@
@section('content')
{!! Form::open(array('route' => 'items.store','method'=>'POST')) !!}
{!! Form::open(array('route' => 'items.store', 'files' => true, 'method'=>'POST')) !!}
@include('items.form')
{!! Form::close() !!}

View File

@@ -2,7 +2,7 @@
@section('content')
{!! Form::model($item, ['method' => 'PATCH','route' => ['items.update', $item->id]]) !!}
{!! Form::model($item, ['method' => 'PATCH', 'files' => true, 'route' => ['items.update', $item->id]]) !!}
@include('items.form')
{!! Form::close() !!}

View File

@@ -8,10 +8,10 @@
</header>
<div class="create">
{!! csrf_field() !!}
<div class="input">
<!--<div class="input">
<label>Application name</label>
{!! Form::select('supported', \App\Item::supportedOptions(), array('placeholder' => 'Title','class' => 'form-control')) !!}
</div>
</div>-->
<div class="input">
<label>Application name</label>
@@ -25,6 +25,29 @@
<label>URL</label>
{!! Form::text('url', null, array('placeholder' => 'Url','class' => 'form-control')) !!}
</div>
<div class="input">
<label>Icon *</label>
@if(isset($item->icon) && !empty($item->icon))
{{ asset('storage/'.$item->icon) }}
{!! Form::hidden('icon', $item->icon, ['class' => 'form-control']) !!}
@endif
<input name="file" type="file" class="form-control">
</div>
<label class="switch">
<?php
$checked = false;
if(isset($item->pinned) && $item->pinned === 1) $checked = true;
$set_checked = ($checked) ? ' checked="checked"' : '';
?>
<input type="checkbox" name="active" value="1"<?php echo $set_checked;?> />
<span class="slider round"></span>
</label>
</div>
</section>