@extends('admin.layouts.master') @section('title') @if($edit_mode) Edit Attribute - {{ $attribute->name}} @else New Attribute @endif @stop @section('content')
Product Attributes


{{ Form::open(array('url' => 'admin/products/categories/attributeGroups/attributes/save','class'=>'form-horizontal')) }} {{ Form::hidden('edit_mode', $edit_mode) }} @if($edit_mode) {{ Form::hidden('attribute_id', $attribute->id) }} @endif
@if($edit_mode) {{ Form::text('codename', $attribute->codename, array('class' =>' form-control input-lg', 'disabled' => 'disabled')) }} @else {{ Form::text('codename', null, array('class' =>' form-control')) }} @endif {{ Form::label('codename') }} * Codename has to be 1 lower case word, e.g. name, my_codename

{{ Form::text('name', $edit_mode ? $attribute->name : Input::get('name'), array('class' =>' form-control')) }} {{ Form::label('name') }}

{{ Form::select('input_type', array( 'text' => 'Text', 'textarea' => 'Textarea', 'select' => 'Select', 'multiselect' => 'Multi Select', ), $edit_mode ? $attribute->input_type : Input::get('input_type'), array('id'=>'input_type','class'=>'bs-select form-control', 'data-live-search'=>'true', 'data-size'=>'8')) }} {{ Form::label('input_type', 'Input Type') }}

{{ Form::select('is_required', array( 0 => 'No', 1 => 'Yes',), $edit_mode ? $attribute->is_required : Input::get('is_required'), array('class'=>'bs-select form-control', 'data-live-search'=>'true', 'data-size'=>'8')) }} {{ Form::label('is_required', 'Is Required') }}

@foreach($groups as $group)
{{ Form::radio('group_id', $group->id, $edit_mode ? $attribute->group_id == $group->id ? true : false : false,array('class'=>'md-radiobtn','id'=>'group_' . $group->id)) }}
@endforeach
Back to Products Attributes {{ Form::submit('Save', array('class' => 'pull-right btn btn-success btn-lg')) }}
{{ Form::close() }}
@stop @section('scripts') @parent @stop