categories dropdown in create/edit form
This commit is contained in:
@@ -35,7 +35,8 @@ class CategoriesController extends AdminController {
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
return View::make('backend/categories/create');
|
||||
$category_options = array('' => 'Top Level') + Category::lists('name', 'id');
|
||||
return View::make('backend/categories/create')->with('category_options',$category_options);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +98,8 @@ class CategoriesController extends AdminController {
|
||||
}
|
||||
|
||||
// Show the page
|
||||
return View::make('backend/categories/edit', compact('category'));
|
||||
$category_options = array('' => 'Top Level') + Category::lists('name', 'id');
|
||||
return View::make('backend/categories/edit', compact('category'))->with('category_options',$category_options);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,4 +172,5 @@ class CategoriesController extends AdminController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ Create a New Asset Category ::
|
||||
<div class="control-group {{ $errors->has('parent') ? 'error' : '' }}">
|
||||
<label class="control-label" for="parent">Category Parent</label>
|
||||
<div class="controls">
|
||||
<input class="span6" type="text" name="parent" id="parent" value="{{ Input::old('parent') }}" />
|
||||
{{ Form::select('parent', $category_options , Input::old('parent')) }}
|
||||
{{ $errors->first('parent', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@ Category Update ::
|
||||
<div class="control-group {{ $errors->has('parent') ? 'error' : '' }}">
|
||||
<label class="control-label" for="parent">Category Parent</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="parent" id="parent" value="{{ Input::old('name', $category->parent) }}" />
|
||||
{{ Form::select('parent', $category_options, Input::old('parent', $category->parent)) }}
|
||||
{{ $errors->first('parent', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user