Merge branch 'refs/heads/develop'
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'default' => 'sqlite',
|
||||
|
||||
'connections' => array(
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:',
|
||||
'prefix' => ''
|
||||
),
|
||||
)
|
||||
);
|
||||
@@ -38,7 +38,8 @@ class ModelsController extends AdminController {
|
||||
{
|
||||
// Show the page
|
||||
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
|
||||
return View::make('backend/models/edit')->with('depreciation_list',$depreciation_list)->with('model',new Model);
|
||||
$category_list = array('' => '') + DB::table('categories')->lists('name', 'id');
|
||||
return View::make('backend/models/edit')->with('category_list',$category_list)->with('depreciation_list',$depreciation_list)->with('model',new Model);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,8 +103,8 @@ class ModelsController extends AdminController {
|
||||
}
|
||||
|
||||
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
|
||||
$model_options = array('' => 'Top Level') + DB::table('models')->where('id', '!=', $modelId)->lists('name', 'id');
|
||||
return View::make('backend/models/edit', compact('model'))->with('model_options',$model_options)->with('depreciation_list',$depreciation_list);
|
||||
$category_list = array('' => '') + DB::table('categories')->lists('name', 'id');
|
||||
return View::make('backend/models/edit', compact('model'))->with('category_list',$category_list)->with('depreciation_list',$depreciation_list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase {
|
||||
|
||||
/**
|
||||
* Default preparation for each test
|
||||
*
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp(); // Don't forget this!
|
||||
|
||||
$this->prepareForTests();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
@@ -16,4 +28,15 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase {
|
||||
return require __DIR__.'/../../bootstrap/start.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrates the database and set the mailer to 'pretend'.
|
||||
* This will cause the tests to run quickly.
|
||||
*
|
||||
*/
|
||||
private function prepareForTests()
|
||||
{
|
||||
Artisan::call('migrate');
|
||||
Mail::pretend(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<label class="control-label" for="asset_tag">Asset Tag</label>
|
||||
<div class="controls">
|
||||
<input class="span4" type="text" name="asset_tag" id="asset_tag" value="{{ Input::old('asset_tag', $asset->asset_tag) }}" />
|
||||
{{ $errors->first('asset_tag', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('asset_tag', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Asset Title -->
|
||||
@@ -51,7 +51,7 @@
|
||||
<label class="control-label" for="name">Asset Name</label>
|
||||
<div class="controls">
|
||||
<input class="span4" type="text" name="name" id="name" value="{{ Input::old('name', $asset->name) }}" />
|
||||
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('name', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<label class="control-label" for="serial">Serial</label>
|
||||
<div class="controls">
|
||||
<input class="span4" type="text" name="serial" id="serial" value="{{ Input::old('serial', $asset->serial) }}" />
|
||||
{{ $errors->first('serial', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('serial', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<label class="control-label" for="order_number">Order Number</label>
|
||||
<div class="controls">
|
||||
<input class="span4" type="text" name="order_number" id="order_number" value="{{ Input::old('order_number', $asset->order_number) }}" />
|
||||
{{ $errors->first('order_number', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('order_number', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<label class="control-label" for="parent">Model</label>
|
||||
<div class="controls">
|
||||
{{ Form::select('model_id', $model_list , Input::old('model_id', $asset->model_id), array('class'=>'select2', 'style'=>'min-width:350px')) }}
|
||||
{{ $errors->first('model_id', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('model_id', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<label class="control-label" for="purchase_date">Purchase Date</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="datepicker span2" data-date-format="yyyy-mm-dd" placeholder="Select Date" name="purchase_date" id="purchase_date" value="{{ Input::old('purchase_date', $asset->purchase_date) }}">
|
||||
{{ $errors->first('purchase_date', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('purchase_date', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,7 +100,7 @@
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">$</span>
|
||||
<input class="span2" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost', $asset->purchase_cost) }}" />
|
||||
{{ $errors->first('purchase_cost', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('purchase_cost', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -110,7 +110,7 @@
|
||||
<label class="control-label" for="serial">Warranty</label>
|
||||
<div class="controls">
|
||||
<input class="span1" type="text" name="warranty_months" id="warranty_months" value="{{ Input::old('warranty_months', $asset->warranty_months) }}" /> months
|
||||
{{ $errors->first('warranty_months', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('warranty_months', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<div class="controls">
|
||||
<div class="field-box">
|
||||
{{ Form::select('depreciation_id', $depreciation_list , Input::old('depreciation_id', $asset->depreciation_id), array('class'=>'select2', 'style'=>'width:250px')) }}
|
||||
{{ $errors->first('depreciation_id', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('depreciation_id', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -131,7 +131,7 @@
|
||||
<div class="controls">
|
||||
<div class="field-box">
|
||||
{{ Form::select('status_id', $statuslabel_list , Input::old('status_id', $asset->status_id), array('class'=>'select2', 'style'=>'width:250px')) }}
|
||||
{{ $errors->first('depreciation_id', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('depreciation_id', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,7 +142,7 @@
|
||||
<label class="control-label" for="notes">Notes</label>
|
||||
<div class="controls">
|
||||
<input class="span6" type="text" name="notes" id="notes" value="{{ Input::old('notes', $asset->notes) }}" />
|
||||
{{ $errors->first('notes', '<span class="help-inline">:message</span>') }}
|
||||
{{ $errors->first('notes', '<span class="help-inline"><i class="icon-remove-sign"></i> :message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<!-- Tabs Content -->
|
||||
<div class="tab-content">
|
||||
|
||||
<!-- General tab -->
|
||||
<div class="tab-pane active" id="tab-general">
|
||||
<!-- Model Title -->
|
||||
@@ -60,7 +59,15 @@
|
||||
{{ $errors->first('depreciation_id', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Category -->
|
||||
<div class="control-group {{ $errors->has('category_id') ? 'error' : '' }}">
|
||||
<label class="control-label" for="parent">Category</label>
|
||||
<div class="controls">
|
||||
{{ Form::select('category_id', $category_list , Input::old('category_id', $model->category_id), array('class'=>'select2', 'style'=>'width:250px')) }}
|
||||
{{ $errors->first('category_id', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user