From c4538a06eb8e18ffbda24f76fe1adc6a35c29aac Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 18 May 2016 20:05:14 -0400 Subject: [PATCH] Add an option-select option to the set of available form items in the dashboard edit item page and document its use in the readme --- readme.md | 2 ++ resources/views/dashboard/edit-item.blade.php | 24 ++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 9e5423e..c1e664f 100644 --- a/readme.md +++ b/readme.md @@ -174,6 +174,7 @@ This function should be named the same as the one above except with `Edit` at th 'columns' => [ [ 'name' => 'title', 'type' => 'text', 'label' => 'The Title' ], [ 'name' => 'iframe', 'type' => 'text' ], + [ 'name' => 'halign', 'type' => 'select', 'options' => [ 'left', 'center', 'right' ] ], [ 'name' => 'story', 'type' => 'mkd' ], [ 'name' => 'order', 'type' => 'hidden' ] ] @@ -199,6 +200,7 @@ The following is a list of possible `types` in the `columns` array for Editable * `text`: Text input field for text data * `mkd`: Markdown editor for text data containing markdown * `date`: Date and time selection tool for date/time data +* `select`: Text input via option select with possible options in an `options` array * `hidden`: Fields that will contain values to pass to the update function but won't appear on the page (this must be used for the sort column) #### Edit Item Functionality diff --git a/resources/views/dashboard/edit-item.blade.php b/resources/views/dashboard/edit-item.blade.php index 61564ac..498f60f 100644 --- a/resources/views/dashboard/edit-item.blade.php +++ b/resources/views/dashboard/edit-item.blade.php @@ -17,8 +17,8 @@
-
- @foreach($columns as $column) + @foreach($columns as $column) +
@set('value', $item[$column['name']]) @if($column['type'] == 'hidden') @@ -35,12 +35,24 @@ @elseif($column['type'] == 'mkd') + @elseif($column['type'] == 'select') + @endif
@endif - @endforeach +
+ @endforeach - @if(!empty($imgup) && $imgup) + @if(!empty($imgup) && $imgup) +
@@ -55,8 +67,8 @@
(No Image Set)
@endif
- @endif -
+ + @endif