Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions l5scaffold.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/*
This file should be on your_app_dir/resources/lang/##/ (## is your app language).
*/
return [
'create' => 'Create',
'edit' => 'Edit',
'save' => 'Save',
'input_errors' => 'There were some problems with your input.',
'options' => 'OPTIONS',
'view' => 'View',
'empty' => 'No records.',
'id' => 'ID',
'delete' => 'Delete',
'delete_confirmation' => 'Delete? Are you sure?',
'back' => 'Back',
'item_created' => 'Item created successfully.',
'item_updated' => 'Item updated successfully.',
'item_deleted' => 'Item deleted successfully.'
];
6 changes: 3 additions & 3 deletions src/stubs/controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class {{class}} extends Controller {

${{model_name_var_sgl}}->save();

return redirect()->route('{{model_name_var}}.index')->with('message', 'Item created successfully.');
return redirect()->route('{{model_name_var}}.index')->with('message', trans('l5scaffold.item_created'));
}

/**
Expand Down Expand Up @@ -88,7 +88,7 @@ class {{class}} extends Controller {

${{model_name_var_sgl}}->save();

return redirect()->route('{{model_name_var}}.index')->with('message', 'Item updated successfully.');
return redirect()->route('{{model_name_var}}.index')->with('message', trans('l5scaffold.item_updated'));
}

/**
Expand All @@ -102,7 +102,7 @@ class {{class}} extends Controller {
${{model_name_var_sgl}} = {{model_name_class}}::findOrFail($id);
${{model_name_var_sgl}}->delete();

return redirect()->route('{{model_name_var}}.index')->with('message', 'Item deleted successfully.');
return redirect()->route('{{model_name_var}}.index')->with('message', trans('l5scaffold.item_deleted'));
}

}
6 changes: 3 additions & 3 deletions src/stubs/html_assets/create.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@endsection
@section('header')
<div class="page-header">
<h1><i class="glyphicon glyphicon-plus"></i> {{Class}} / Create </h1>
<h1><i class="glyphicon glyphicon-plus"></i> {{Class}} / {{ trans('l5scaffold.create') }} </h1>
</div>
@endsection

Expand All @@ -19,8 +19,8 @@

{{content_fields}}
<div class="well well-sm">
<button type="submit" class="btn btn-primary">Create</button>
<a class="btn btn-link pull-right" href="{{ route('{{class}}.index') }}"><i class="glyphicon glyphicon-backward"></i> Back</a>
<button type="submit" class="btn btn-primary">{{ trans('l5scaffold.create') }}</button>
<a class="btn btn-link pull-right" href="{{ route('{{class}}.index') }}"><i class="glyphicon glyphicon-backward"></i> {{ trans('l5scaffold.back') }}</a>
</div>
</form>

Expand Down
6 changes: 3 additions & 3 deletions src/stubs/html_assets/edit.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@endsection
@section('header')
<div class="page-header">
<h1><i class="glyphicon glyphicon-edit"></i> {{Class}} / Edit #{{${{classSingle}}->id}}</h1>
<h1><i class="glyphicon glyphicon-edit"></i> {{Class}} / {{ trans('l5scaffold.edit') }} #{{${{classSingle}}->id}}</h1>
</div>
@endsection

Expand All @@ -20,8 +20,8 @@

{{content_fields}}
<div class="well well-sm">
<button type="submit" class="btn btn-primary">Save</button>
<a class="btn btn-link pull-right" href="{{ route('{{class}}.index') }}"><i class="glyphicon glyphicon-backward"></i> Back</a>
<button type="submit" class="btn btn-primary">{{ trans('l5scaffold.save') }}</button>
<a class="btn btn-link pull-right" href="{{ route('{{class}}.index') }}"><i class="glyphicon glyphicon-backward"></i> {{ trans('l5scaffold.back') }}</a>
</div>
</form>

Expand Down
4 changes: 2 additions & 2 deletions src/stubs/html_assets/error.stub
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@if (count($errors) > 0)
<div class="alert alert-danger">
<p>There were some problems with your input.</p>
<p>{{ trans('l5scaffold.input_errors') }}</p>
<ul>
@foreach ($errors->all() as $error)
<li><i class="glyphicon glyphicon-remove"></i> {{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@endif
18 changes: 9 additions & 9 deletions src/stubs/html_assets/index.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="page-header clearfix">
<h1>
<i class="glyphicon glyphicon-align-justify"></i> {{Class}}
<a class="btn btn-success pull-right" href="{{ route('{{class}}.create') }}"><i class="glyphicon glyphicon-plus"></i> Create</a>
<a class="btn btn-success pull-right" href="{{ route('{{class}}.create') }}"><i class="glyphicon glyphicon-plus"></i> {{ trans('l5scaffold.create') }}</a>
</h1>

</div>
Expand All @@ -17,9 +17,9 @@
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>ID</th>
<th>{{ trans('l5scaffold.id') }}</th>
{{header_fields}}
<th class="text-right">OPTIONS</th>
<th class="text-right">{{ trans('l5scaffold.options') }}</th>
</tr>
</thead>

Expand All @@ -29,12 +29,12 @@
<td>{{${{classSingle}}->id}}</td>
{{content_fields}}
<td class="text-right">
<a class="btn btn-xs btn-primary" href="{{ route('{{class}}.show', ${{classSingle}}->id) }}"><i class="glyphicon glyphicon-eye-open"></i> View</a>
<a class="btn btn-xs btn-warning" href="{{ route('{{class}}.edit', ${{classSingle}}->id) }}"><i class="glyphicon glyphicon-edit"></i> Edit</a>
<form action="{{ route('{{class}}.destroy', ${{classSingle}}->id) }}" method="POST" style="display: inline;" onsubmit="if(confirm('Delete? Are you sure?')) { return true } else {return false };">
<a class="btn btn-xs btn-primary" href="{{ route('{{class}}.show', ${{classSingle}}->id) }}"><i class="glyphicon glyphicon-eye-open"></i> {{ trans('l5scaffold.view') }}</a>
<a class="btn btn-xs btn-warning" href="{{ route('{{class}}.edit', ${{classSingle}}->id) }}"><i class="glyphicon glyphicon-edit"></i> {{ trans('l5scaffold.edit') }}</a>
<form action="{{ route('{{class}}.destroy', ${{classSingle}}->id) }}" method="POST" style="display: inline;" onsubmit="if(confirm('{{ trans('l5scaffold.delete_confirmation') }}')) { return true } else {return false };">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-xs btn-danger"><i class="glyphicon glyphicon-trash"></i> Delete</button>
<button type="submit" class="btn btn-xs btn-danger"><i class="glyphicon glyphicon-trash"></i> {{ trans('l5scaffold.delete') }}</button>
</form>
</td>
</tr>
Expand All @@ -43,10 +43,10 @@
</table>
{!! ${{class}}->render() !!}
@else
<h3 class="text-center alert alert-info">Empty!</h3>
<h3 class="text-center alert alert-info">{{ trans('l5scaffold.empty') }}</h3>
@endif

</div>
</div>

@endsection
@endsection
12 changes: 6 additions & 6 deletions src/stubs/html_assets/show.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
@section('header')
<div class="page-header">
<h1>{{Class}} / Show #{{${{classSingle}}->id}}</h1>
<form action="{{ route('{{class}}.destroy', ${{classSingle}}->id) }}" method="POST" style="display: inline;" onsubmit="if(confirm('Delete? Are you sure?')) { return true } else {return false };">
<form action="{{ route('{{class}}.destroy', ${{classSingle}}->id) }}" method="POST" style="display: inline;" onsubmit="if(confirm('{{ trans('l5scaffold.delete_confirmation') }}')) { return true } else {return false };">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="btn-group pull-right" role="group" aria-label="...">
<a class="btn btn-warning btn-group" role="group" href="{{ route('{{class}}.edit', ${{classSingle}}->id) }}"><i class="glyphicon glyphicon-edit"></i> Edit</a>
<button type="submit" class="btn btn-danger">Delete <i class="glyphicon glyphicon-trash"></i></button>
<a class="btn btn-warning btn-group" role="group" href="{{ route('{{class}}.edit', ${{classSingle}}->id) }}"><i class="glyphicon glyphicon-edit"></i> {{ trans('l5scaffold.edit') }}</a>
<button type="submit" class="btn btn-danger">{{ trans('l5scaffold.delete') }} <i class="glyphicon glyphicon-trash"></i></button>
</div>
</form>
</div>
Expand All @@ -19,15 +19,15 @@

<form action="#">
<div class="form-group">
<label for="nome">ID</label>
<label for="nome">{{ trans('l5scaffold.id') }}</label>
<p class="form-control-static"></p>
</div>
{{content_fields}}
</form>

<a class="btn btn-link" href="{{ route('{{class}}.index') }}"><i class="glyphicon glyphicon-backward"></i> Back</a>
<a class="btn btn-link" href="{{ route('{{class}}.index') }}"><i class="glyphicon glyphicon-backward"></i> {{ trans('l5scaffold.back') }}</a>

</div>
</div>

@endsection
@endsection