2016-01-26 23:20:08 -05:00
|
|
|
@extends('dashboard.core')
|
|
|
|
|
|
|
|
@section('dashboard-body')
|
|
|
|
@if(!empty($help_text))
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="help-text">
|
|
|
|
{!! $help_text !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2018-01-12 00:02:16 -05:00
|
|
|
<form id="edit-item" class="edit-item" data-id="{{ $id }}" data-model="{{ $model }}" data-path="{{ isset($path) ? $path : $model }}">
|
2016-01-26 23:20:08 -05:00
|
|
|
<input type="hidden" name="_token" id="_token" value="{{ csrf_token() }}" />
|
|
|
|
|
|
|
|
<div class="container-fluid">
|
2016-05-18 20:05:14 -04:00
|
|
|
@foreach($columns as $column)
|
|
|
|
<div class="row">
|
2016-03-15 00:09:58 -04:00
|
|
|
@set('value', $item[$column['name']])
|
2016-01-26 23:20:08 -05:00
|
|
|
|
|
|
|
@if($column['type'] == 'hidden')
|
|
|
|
<input class="text-input" type="hidden" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value }}" />
|
2017-01-03 22:51:16 -05:00
|
|
|
@elseif($column['type'] != 'display' || $id != 'new')
|
2016-01-26 23:20:08 -05:00
|
|
|
<div class="col-xs-12 col-md-2">
|
|
|
|
<label for="{{ $column['name'] }}">{{ empty($column['label']) ? ucfirst($column['name']) : $column['label'] }}:</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-md-10">
|
|
|
|
@if($column['type'] == 'text')
|
|
|
|
<input class="text-input" type="text" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value }}" />
|
|
|
|
@elseif($column['type'] == 'date')
|
2018-01-15 23:43:20 -05:00
|
|
|
<input class="date-picker" type="text" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value == '' ? date('Y-m-d', time()) : preg_replace('/:[0-9][0-9]$/', '', $value) }}" />
|
2016-01-26 23:20:08 -05:00
|
|
|
@elseif($column['type'] == 'mkd')
|
|
|
|
<textarea class="mkd-editor" name="{{ $column['name'] }}" id="{{ $column['name'] }}" value="{{ $value }}"></textarea>
|
2016-05-18 20:05:14 -04:00
|
|
|
@elseif($column['type'] == 'select')
|
|
|
|
<select class="text-input" name="{{ $column['name'] }}" id="{{ $column['name'] }}">
|
|
|
|
@foreach($column['options'] as $option)
|
|
|
|
@if($option === $value)
|
|
|
|
<option value="{{ $option }}" selected="selected">{{ $option }}</option>
|
|
|
|
@else
|
|
|
|
<option value="{{ $option }}">{{ $option }}</option>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</select>
|
2018-01-11 01:13:58 -05:00
|
|
|
@elseif($column['type'] == 'image')
|
|
|
|
<input class="image-upload" type="file" name="{{ $column['name'] }}" id="{{ $column['name'] }}" />
|
|
|
|
|
2018-01-18 22:29:49 -05:00
|
|
|
@set('current_image', "/uploads/$model/img/$id-" . $column['name'] . '.jpg')
|
2018-01-11 01:13:58 -05:00
|
|
|
|
|
|
|
@if(file_exists(base_path() . '/public' . $current_image))
|
2018-01-18 22:29:49 -05:00
|
|
|
<img class="current-image" src="{{ $current_image }}" />
|
2018-01-11 01:13:58 -05:00
|
|
|
@else
|
2018-01-18 22:29:49 -05:00
|
|
|
<div class="no-file">(No Image Set)</div>
|
|
|
|
@endif
|
|
|
|
@elseif($column['type'] == 'file')
|
|
|
|
<input class="file-upload" type="file" name="{{ $column['name'] }}" id="{{ $column['name'] }}" data-ext="{{ $column['ext'] }}" />
|
|
|
|
|
|
|
|
@set('current_file', "/uploads/$model/files/$id-" . $column['name'] . '.' . $column['ext'])
|
|
|
|
|
|
|
|
@if(file_exists(base_path() . '/public' . $current_file))
|
|
|
|
<a class="current-file" href="{{ $current_file }}" target="_blank">View Current {{ strtoupper($column['ext']) }}</a>
|
|
|
|
@else
|
|
|
|
<div class="no-file">(No {{ strtoupper($column['ext']) }} Set)</div>
|
2018-01-11 01:13:58 -05:00
|
|
|
@endif
|
2016-12-19 22:59:19 -05:00
|
|
|
@elseif($column['type'] == 'display')
|
|
|
|
<div class="text-display">{{ $value }}</div>
|
2016-01-26 23:20:08 -05:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
@endif
|
2016-05-18 20:05:14 -04:00
|
|
|
</div>
|
|
|
|
@endforeach
|
2016-01-26 23:20:08 -05:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<button id="back" type="button" class="back-button btn btn-default">Back</button>
|
2018-01-12 23:19:24 -05:00
|
|
|
<button id="submit" type="button" class="submit-button btn btn-primary disabled">{{ $id == 'new' ? 'Create' : 'Update' }} {{ $heading }} Item</button>
|
2016-01-26 23:20:08 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div id="loading-modal">
|
|
|
|
<div class="spinner-container">
|
|
|
|
<div class="sk-folding-cube">
|
|
|
|
<div class="sk-cube1 sk-cube"></div>
|
|
|
|
<div class="sk-cube2 sk-cube"></div>
|
|
|
|
<div class="sk-cube4 sk-cube"></div>
|
|
|
|
<div class="sk-cube3 sk-cube"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|