Refactoring

Removes extraneous create.blade.php, cleaned up some functions
This commit is contained in:
snipe
2013-11-16 03:25:40 -05:00
parent 4f0a1789db
commit 2e132331e7
21 changed files with 101 additions and 508 deletions
+19 -17
View File
@@ -39,9 +39,10 @@ class AssetsController extends AdminController {
public function getCreate()
{
// Grab the dropdown list of models
$model_list = array('0' => 'Select') + Model::lists('name', 'id');
$model_list = array('' => 'Select') + Model::lists('name', 'id');
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
return View::make('backend/assets/create')->with('model_list',$model_list)->with('depreciation_list',$depreciation_list);
return View::make('backend/assets/edit')->with('model_list',$model_list)->with('depreciation_list',$depreciation_list)->with('asset',new Asset);
}
@@ -57,7 +58,7 @@ class AssetsController extends AdminController {
$rules = array(
'name' => 'required|min:3',
'asset_tag' => 'required|min:3',
'model_id' => 'required|min:1',
'model_id' => 'required',
'serial' => 'required|min:3',
);
@@ -74,8 +75,7 @@ class AssetsController extends AdminController {
// Create a new asset
$asset = new Asset;
// Update the asset data
// Update the asset data
// Save the asset data
$asset->name = e(Input::get('name'));
$asset->serial = e(Input::get('serial'));
$asset->model_id = e(Input::get('model_id'));
@@ -90,11 +90,11 @@ class AssetsController extends AdminController {
// Was the asset created?
if($asset->save())
{
// Redirect to the new asset page
// Redirect to the asset listing page
return Redirect::to("assets/assets")->with('success', Lang::get('admin/assets/message.create.success'));
}
// Redirect to the asset create page
// Redirect to the asset create page with an error
return Redirect::to('assets/assets/create')->with('error', Lang::get('admin/assets/message.create.error'));
}
@@ -109,12 +109,14 @@ class AssetsController extends AdminController {
// Check if the asset exists
if (is_null($asset = Asset::find($assetId)))
{
// Redirect to the blogs management page
// Redirect to the asset management page
return Redirect::to('admin/settings/assets')->with('error', Lang::get('admin/assets/message.does_not_exist'));
}
// Grab the dropdown list of models
$model_list = array('0' => 'Select') + Model::lists('name', 'id');
$model_list = array('' => 'Select') + Model::lists('name', 'id');
// get depreciation list
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
return View::make('backend/assets/edit', compact('asset'))->with('model_list',$model_list)->with('depreciation_list',$depreciation_list);
}
@@ -128,10 +130,10 @@ class AssetsController extends AdminController {
*/
public function postEdit($assetId = null)
{
// Check if the blog post exists
// Check if the asset exists
if (is_null($asset = Asset::find($assetId)))
{
// Redirect to the blogs management page
// Redirect to the asset management page with error
return Redirect::to('admin/assets')->with('error', Lang::get('admin/assets/message.does_not_exist'));
}
@@ -139,7 +141,7 @@ class AssetsController extends AdminController {
$rules = array(
'name' => 'required|min:3',
'asset_tag' => 'required|min:3',
'model_id' => 'required|min:1',
'model_id' => 'required',
'serial' => 'required|min:3',
);
@@ -171,8 +173,8 @@ class AssetsController extends AdminController {
return Redirect::to("assets/assets/$assetId/edit")->with('success', Lang::get('admin/assets/message.update.success'));
}
// Redirect to the asset management page
return Redirect::to("assets/assets/$assetID/edit")->with('error', Lang::get('admin/assets/message.update.error'));
// Redirect to the asset management page with error
return Redirect::to("assets/assets/$assetId/edit")->with('error', Lang::get('admin/assets/message.update.error'));
}
/**
@@ -186,14 +188,14 @@ class AssetsController extends AdminController {
// Check if the blog post exists
if (is_null($asset = Asset::find($assetId)))
{
// Redirect to the blogs management page
// Redirect to the asset management page with error
return Redirect::to('assets/assets')->with('error', Lang::get('admin/assets/message.not_found'));
}
// Delete the blog post
// Delete the asset
$asset->delete();
// Redirect to the blog posts management page
// Redirect to the asset management page
return Redirect::to('assets/assets')->with('success', Lang::get('admin/assets/message.delete.success'));
}
@@ -38,7 +38,7 @@ class CategoriesController extends AdminController {
{
// Show the page
$category_options = array('0' => 'Top Level') + Category::lists('name', 'id');
return View::make('backend/categories/create')->with('category_options',$category_options);
return View::make('backend/categories/edit')->with('category_options',$category_options)->with('category',new Category);
}
@@ -38,7 +38,7 @@ class DepreciationsController extends AdminController {
{
// Show the page
$depreciation_options = array('0' => 'Top Level') + Depreciation::lists('name', 'id');
return View::make('backend/depreciations/create')->with('depreciation_options',$depreciation_options);
return View::make('backend/depreciations/edit')->with('depreciation_options',$depreciation_options)->with('depreciation',new Depreciation);
}
+3 -3
View File
@@ -38,7 +38,7 @@ class LicensesController extends AdminController {
{
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
return View::make('backend/licenses/create')->with('license_options',$license_options);
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('license',new License);
}
@@ -87,7 +87,7 @@ class LicensesController extends AdminController {
}
// Redirect to the license create page
return Redirect::to('admin/licenses/create')->with('error', Lang::get('admin/licenses/message.create.error'));
return Redirect::to('admin/licenses/edit')->with('error', Lang::get('admin/licenses/message.create.error'))->with('license',new License);
}
/**
@@ -162,7 +162,7 @@ class LicensesController extends AdminController {
}
// Redirect to the license management page
return Redirect::to("admin/licenses/$licenseID/edit")->with('error', Lang::get('admin/licenses/message.update.error'));
return Redirect::to("admin/licenses/$licenseId/edit")->with('error', Lang::get('admin/licenses/message.update.error'));
}
/**
@@ -13,7 +13,7 @@ use View;
class ManufacturersController extends AdminController {
/**
* Show a list of all the blog posts.
* Show a list of all manufacturers
*
* @return View
*/
@@ -36,7 +36,7 @@ class ManufacturersController extends AdminController {
{
// Show the page
$manufacturer_options = array('0' => 'Top Level') + Manufacturer::lists('name', 'id');
return View::make('backend/manufacturers/create')->with('manufacturer_options',$manufacturer_options);
return View::make('backend/manufacturers/edit')->with('manufacturer_options',$manufacturer_options)->with('manufacturer', new Manufacturer);
}
@@ -141,7 +141,7 @@ class ManufacturersController extends AdminController {
}
// Redirect to the manufacturer management page
return Redirect::to("admin/settings/manufacturers/$manufacturerID/edit")->with('error', Lang::get('admin/manufacturers/message.update.error'));
return Redirect::to("admin/settings/manufacturers/$manufacturerId/edit")->with('error', Lang::get('admin/manufacturers/message.update.error'));
}
/**
@@ -159,7 +159,7 @@ class ManufacturersController extends AdminController {
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.not_found'));
}
// Delete the blog post
// Delete the manufacturer
$manufacturer->delete();
// Redirect to the manufacturers management page
+6 -1
View File
@@ -19,6 +19,8 @@ class Asset extends Eloquent {
public function depreciation()
{
$depreciation_id = Model::find($this->model_id)->depreciation_id;
if (isset($depreciation_id)) {
$depreciation_term = Depreciation::find($depreciation_id)->months;
$purchase_date = strtotime($this->purchase_date);
@@ -32,7 +34,10 @@ class Asset extends Eloquent {
if ($current_value < 0) {
$current_value = 0;
}
return $current_value;
return $current_value;
} else {
return $this->purchase_cost;
}
}
+2 -58
View File
@@ -3,71 +3,15 @@
class Model extends Eloquent {
/**
* Deletes a blog post and all the associated comments.
* Deletes the model
*
* @return bool
*/
public function delete()
{
// Delete the comments
$this->comments()->delete();
// Delete the blog post
// Delete the model
return parent::delete();
}
/**
* Returns a formatted post content entry, this ensures that
* line breaks are returned.
*
* @return string
*/
public function content()
{
return nl2br($this->content);
}
/**
* Return the post's author.
*
* @return User
*/
public function author()
{
return $this->belongsTo('User', 'user_id');
}
/**
* Return how many comments this post has.
*
* @return array
*/
public function comments()
{
return $this->hasMany('Comment');
}
/**
* Return the URL to the post.
*
* @return string
*/
public function url()
{
return URL::route('view-post', $this->slug);
}
/**
* Return the post thumbnail image url.
*
* @return string
*/
public function thumbnail()
{
# you should save the image url on the database
# and return that url here.
return 'http://lorempixel.com/130/90/business/';
}
}
+2
View File
@@ -39,10 +39,12 @@ class User extends SentryUserModel {
public function numassets()
{
/*
$assetcount = DB::table('users')
->join('contacts', 'users.id', '=', 'contacts.user_id')
->join('orders', 'users.id', '=', 'orders.user_id')
->select('users.id', 'contacts.phone', 'orders.price');
*/
}
}
-10
View File
@@ -110,16 +110,6 @@ Route::group(array('prefix' => 'admin'), function()
Route::get('{depreciationId}/delete', array('as' => 'delete/depreciations', 'uses' => 'Controllers\Admin\DepreciationsController@getDelete'));
});
# Depreciation
Route::group(array('prefix' => 'depreciation'), function()
{
Route::get('/', array('as' => 'depreciation', 'uses' => 'Controllers\Admin\ModelsController@getIndex'));
});
});
-122
View File
@@ -1,122 +0,0 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
Create a New Asset ::
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Create a New Asset
<div class="pull-right">
<a href="{{ route('assets') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
</div>
<form class="form-horizontal" method="post" action="" autocomplete="off">
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<!-- Tabs Content -->
<div class="tab-content">
<div class="tab-pane active" id="tab-general">
<!-- Asset Title -->
<div class="control-group {{ $errors->has('name') ? 'error' : '' }}">
<label class="control-label" for="name">Asset Name</label>
<div class="controls">
<input class="span6" type="text" name="name" id="name" value="{{ Input::old('name') }}" />
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Asset Tag -->
<div class="control-group {{ $errors->has('asset_tag') ? 'error' : '' }}">
<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') }}" />
{{ $errors->first('asset_tag', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Serial -->
<div class="control-group {{ $errors->has('serial') ? 'error' : '' }}">
<label class="control-label" for="serial">Serial</label>
<div class="controls">
<input class="span4" type="text" name="serial" id="serial" value="{{ Input::old('serial') }}" />
{{ $errors->first('serial', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Order Number -->
<div class="control-group {{ $errors->has('order_number') ? 'error' : '' }}">
<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') }}" />
{{ $errors->first('order_number', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Model -->
<div class="control-group {{ $errors->has('model_id') ? 'error' : '' }}">
<label class="control-label" for="parent">Model</label>
<div class="controls">
{{ Form::select('model_id', $model_list , Input::old('model_id')) }}
{{ $errors->first('model_id', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Purchase Date -->
<div class="control-group {{ $errors->has('purchase_date') ? 'error' : '' }}">
<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') }}"> <span class="add-on"><i class="icon-th"></i></span>
{{ $errors->first('purchase_date', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Purchase Cost -->
<div class="control-group {{ $errors->has('purchase_cost') ? 'error' : '' }}">
<label class="control-label" for="purchase_cost">Purchase Cost</label>
<div class="controls">
$<input class="span2" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost') }}" />
{{ $errors->first('purchase_cost', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Depreciation -->
<div class="control-group {{ $errors->has('depreciation_id') ? 'error' : '' }}">
<label class="control-label" for="parent">Depreciation</label>
<div class="controls">
{{ Form::select('depreciation_id', $model_list , Input::old('depreciation_id')) }}
{{ $errors->first('depreciation_id', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Notes -->
<div class="control-group {{ $errors->has('notes') ? 'error' : '' }}">
<label class="control-label" for="notes">Notes</label>
<div class="controls">
<input class="span6" type="text" name="notes" id="notes" value="{{ Input::old('notes') }}" />
{{ $errors->first('notes', '<span class="help-inline">:message</span>') }}
</div>
</div>
</div>
<!-- Form actions -->
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('assets') }}">Cancel</a>
<button type="submit" class="btn btn-success">Create New</button>
</div>
</div>
</form>
@stop
+10 -2
View File
@@ -2,7 +2,11 @@
{{-- Page title --}}
@section('title')
Asset Update ::
@if ($asset->id)
Asset Update ::
@else
Create Asset ::
@endif
@parent
@stop
@@ -10,7 +14,11 @@ Asset Update ::
@section('content')
<div class="page-header">
<h3>
Update Asset
@if ($asset->id)
Asset Update
@else
Create Asset
@endif
<div class="pull-right">
<a href="{{ route('assets') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
+2 -2
View File
@@ -41,8 +41,8 @@ Assets ::
<td>{{ $asset->serial }}</td>
<td>{{ $asset->status }}</td>
<td>{{ $asset->purchase_date }}</td>
<td>${{ $asset->purchase_cost }}</td>
<td>${{ $asset->depreciation() }}</td>
<td>${{ number_format($asset->purchase_cost) }}</td>
<td>${{ number_format($asset->depreciation()) }}</td>
<td>
<a href="{{ route('update/asset', $asset->id) }}" class="btn btn-mini">@lang('button.edit')</a>
<a href="{{ route('delete/asset', $asset->id) }}" class="btn btn-mini btn-danger">@lang('button.delete')</a>
@@ -1,58 +0,0 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
Create a New Asset Category ::
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Create a New Blog Post
<div class="pull-right">
<a href="{{ route('categories') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
</div>
<form class="form-horizontal" method="post" action="" autocomplete="off">
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<!-- Tabs Content -->
<div class="tab-content">
<div class="tab-pane active" id="tab-general">
<!-- Category Title -->
<div class="control-group {{ $errors->has('name') ? 'error' : '' }}">
<label class="control-label" for="name">Category Name</label>
<div class="controls">
<input class="span6" type="text" name="name" id="name" value="{{ Input::old('name') }}" />
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Category Parent Title -->
<div class="control-group {{ $errors->has('parent') ? 'error' : '' }}">
<label class="control-label" for="parent">Category Parent</label>
<div class="controls">
{{ Form::select('parent', $category_options , Input::old('parent')) }}
{{ $errors->first('parent', '<span class="help-inline">:message</span>') }}
</div>
</div>
</div>
<!-- Form actions -->
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('blogs') }}">Cancel</a>
<button type="submit" class="btn btn-success">Publish</button>
</div>
</div>
</form>
@stop
+11 -3
View File
@@ -2,7 +2,11 @@
{{-- Page title --}}
@section('title')
Category Update ::
@if ($category->id)
Category Update ::
@else
Create Category ::
@endif
@parent
@stop
@@ -10,7 +14,11 @@ Category Update ::
@section('content')
<div class="page-header">
<h3>
Update Category
@if ($category->id)
Category Update
@else
Create Category
@endif
<div class="pull-right">
<a href="{{ route('categories') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@@ -49,7 +57,7 @@ Category Update ::
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('blogs') }}">Cancel</a>
<button type="submit" class="btn btn-success">Publish</button>
<button type="submit" class="btn btn-success">Save</button>
</div>
</div>
</form>
@@ -1,58 +0,0 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
Create a New Depreciation Class ::
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Create a Depreciation Class
<div class="pull-right">
<a href="{{ route('depreciations') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
</div>
<form class="form-horizontal" method="post" action="" autocomplete="off">
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<!-- Tabs Content -->
<div class="tab-content">
<div class="tab-pane active" id="tab-general">
<!-- Class Title -->
<div class="control-group {{ $errors->has('name') ? 'error' : '' }}">
<label class="control-label" for="name">Depreciation Class Name</label>
<div class="controls">
<input class="span6" type="text" name="name" id="name" value="{{ Input::old('name') }}" />
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Months -->
<div class="control-group {{ $errors->has('months') ? 'error' : '' }}">
<label class="control-label" for="name">Number of Months</label>
<div class="controls">
<input class="span6" type="text" name="months" id="months" value="{{ Input::old('months') }}" />
{{ $errors->first('months', '<span class="help-inline">:message</span>') }}
</div>
</div>
</div>
<!-- Form actions -->
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('depreciations') }}">Cancel</a>
<button type="submit" class="btn btn-success">Save</button>
</div>
</div>
</form>
@stop
+12 -2
View File
@@ -2,7 +2,13 @@
{{-- Page title --}}
@section('title')
Update Depreciation Class ::
@if ($depreciation->id)
Update Depreciation
@else
Create Depreciation
@endif
@parent
@stop
@@ -10,7 +16,11 @@ Update Depreciation Class ::
@section('content')
<div class="page-header">
<h3>
Update Depreciation Class
@if ($depreciation->id)
Update Depreciation
@else
Create Depreciation
@endif
<div class="pull-right">
<a href="{{ route('depreciations') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
+5
View File
@@ -18,7 +18,9 @@ Group Management ::
</h3>
</div>
@if (count($groups) > 10)
{{ $groups->links() }}
@endif
<table class="table table-bordered table-striped table-hover">
<thead>
@@ -52,5 +54,8 @@ Group Management ::
</tbody>
</table>
@if (count($groups) > 10)
{{ $groups->links() }}
@endif
@stop
-109
View File
@@ -1,109 +0,0 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
Create a Software License ::
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Create a Software License
<div class="pull-right">
<a href="{{ route('licenses') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
</div>
<form class="form-horizontal" method="post" action="" autocomplete="off">
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<!-- Tabs Content -->
<div class="tab-content">
<div class="tab-pane active" id="tab-general">
<!-- Category Title -->
<div class="control-group {{ $errors->has('name') ? 'error' : '' }}">
<label class="control-label" for="name">Software Name</label>
<div class="controls">
<input class="span6" type="text" name="name" id="name" value="{{ Input::old('name') }}" />
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
</div>
</div>
<div class="control-group {{ $errors->has('serial') ? 'error' : '' }}">
<label class="control-label" for="serial">Serial</label>
<div class="controls">
<input class="span6" type="text" name="serial" id="serial" value="{{ Input::old('serial') }}" />
{{ $errors->first('serial', '<span class="help-inline">:message</span>') }}
</div>
</div>
<div class="control-group {{ $errors->has('license_email') ? 'error' : '' }}">
<label class="control-label" for="license_email">License Email</label>
<div class="controls">
<input class="span6" type="text" name="license_email" id="license_email" value="{{ Input::old('license_email') }}" />
{{ $errors->first('license_email', '<span class="help-inline">:message</span>') }}
</div>
</div>
<div class="control-group {{ $errors->has('license_name') ? 'error' : '' }}">
<label class="control-label" for="license_name">License Name</label>
<div class="controls">
<input class="span6" type="text" name="license_name" id="license_name" value="{{ Input::old('license_name') }}" />
{{ $errors->first('license_name', '<span class="help-inline">:message</span>') }}
</div>
</div>
<div class="control-group {{ $errors->has('notes') ? 'error' : '' }}">
<label class="control-label" for="notes">Notes</label>
<div class="controls">
<input class="span6" type="text" name="notes" id="notes" value="{{ Input::old('notes') }}" />
{{ $errors->first('notes', '<span class="help-inline">:message</span>') }}
</div>
</div>
<div class="control-group {{ $errors->has('order_number') ? 'error' : '' }}">
<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') }}" />
{{ $errors->first('order_number', '<span class="help-inline">:message</span>') }}
</div>
</div>
<div class="control-group {{ $errors->has('purchase_cost') ? 'error' : '' }}">
<label class="control-label" for="purchase_cost">Purchase Cost</label>
<div class="controls">
$ <input class="span2" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost') }}" />
{{ $errors->first('purchase_cost', '<span class="help-inline">:message</span>') }}
</div>
</div>
<div class="control-group {{ $errors->has('purchase_date') ? 'error' : '' }}">
<label class="control-label" for="purchase_date">Purchase Date (YYYY-mm-dd)</label>
<div class="controls">
<input class="span4" type="text" name="purchase_date" id="purchase_date" value="{{ Input::old('purchase_date') }}" />
{{ $errors->first('purchase_date', '<span class="help-inline">:message</span>') }}
</div>
</div>
</div>
<!-- Form actions -->
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('licenses') }}">Cancel</a>
<button type="submit" class="btn btn-success">Create</button>
</div>
</div>
</form>
@stop
+10 -2
View File
@@ -2,7 +2,11 @@
{{-- Page title --}}
@section('title')
License Update ::
@if ($license->id)
License Update ::
@else
Create License ::
@endif
@parent
@stop
@@ -10,7 +14,11 @@ License Update ::
@section('content')
<div class="page-header">
<h3>
Update License
@if ($license->id)
Update License ::
@else
Create License ::
@endif
<div class="pull-right">
<a href="{{ route('licenses') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@@ -1,50 +0,0 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
Create a New Asset Manufacturer ::
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Create a New Blog Post
<div class="pull-right">
<a href="{{ route('manufacturers') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
</div>
<form class="form-horizontal" method="post" action="" autocomplete="off">
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<!-- Tabs Content -->
<div class="tab-content">
<div class="tab-pane active" id="tab-general">
<!-- Category Title -->
<div class="control-group {{ $errors->has('name') ? 'error' : '' }}">
<label class="control-label" for="name">Manufacturer Name</label>
<div class="controls">
<input class="span6" type="text" name="name" id="name" value="{{ Input::old('name') }}" />
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
</div>
</div>
</div>
<!-- Form actions -->
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('blogs') }}">Cancel</a>
<button type="submit" class="btn btn-success">Save</button>
</div>
</div>
</form>
@stop
+13 -5
View File
@@ -2,7 +2,11 @@
{{-- Page title --}}
@section('title')
Update Manufacturer ::
@if ($manufacturer->id)
Update Manufacturer
@else
Create manufacturer
@endif
@parent
@stop
@@ -10,7 +14,11 @@ Update Manufacturer ::
@section('content')
<div class="page-header">
<h3>
Update Category
@if ($manufacturer->id)
Update Manufacturer
@else
Create manufacturer
@endif
<div class="pull-right">
<a href="{{ route('manufacturers') }}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@@ -32,7 +40,7 @@ Update Manufacturer ::
<label class="control-label" for="name">Category Name</label>
<div class="controls">
<input type="text" name="name" id="name" value="{{ Input::old('name', $manufacturer->name) }}" />
{{ $errors->first('title', '<span class="help-inline">:message</span>') }}
{{ $errors->first('name', '<span class="help-inline">:message</span>') }}
</div>
</div>
@@ -41,8 +49,8 @@ Update Manufacturer ::
<!-- Form actions -->
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('blogs') }}">Cancel</a>
<button type="submit" class="btn btn-success">Publish</button>
<a class="btn btn-link" href="{{ route('manufacturers') }}">Cancel</a>
<button type="submit" class="btn btn-success">Save</button>
</div>
</div>
</form>