Skip to content

Commit

Permalink
Changes for v1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
sohelamin committed May 11, 2016
1 parent 44cd0c5 commit 9f3ccfe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
9 changes: 4 additions & 5 deletions src/Commands/CrudViewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ class CrudViewCommand extends Command
* @var string
*/
protected $formBodyHtml = '';


/**
* Html of view to show.
Expand Down Expand Up @@ -225,8 +224,8 @@ public function handle()

$field = $value['name'];
$label = ucwords(str_replace('_', ' ', $field));
if($this->option('localize') == 'yes') {
$label = 'trans(\'' . $this->crudName . '.' . $field . '\')';
if ($this->option('localize') == 'yes') {
$label = '{{ trans(\'' . $this->crudName . '.' . $field . '\') }}';
}
$this->formHeadingHtml .= '<th> ' . $label . ' </th>';
$this->formBodyHtml .= '<td>{{ $item->' . $field . ' }}</td>';
Expand Down Expand Up @@ -367,9 +366,9 @@ protected function wrapField($item, $field)
</div>
</div>\n
EOD;
$labelText = "'".ucwords(strtolower(str_replace('_', ' ', $item['name'])))."'";
$labelText = "'" . ucwords(strtolower(str_replace('_', ' ', $item['name']))) . "'";

if($this->option('localize') == 'yes') {
if ($this->option('localize') == 'yes') {
$labelText = 'trans(\'' . $this->crudName . '.' . $item['name'] . '\')';
}

Expand Down
11 changes: 6 additions & 5 deletions src/stubs/index.blade.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@section('content')
<div class="container">

<h1>%%crudNameCap%% <a href="{{ url('/%%routeGroup%%%%crudName%%/create') }}" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-plus" aria-hidden="true"/></a></h1>
<h1>%%crudNameCap%% <a href="{{ url('/%%routeGroup%%%%crudName%%/create') }}" class="btn btn-primary btn-xs" title="Add New %%modelName%%"><span class="glyphicon glyphicon-plus" aria-hidden="true"/></a></h1>
<div class="table">
<table class="table table-bordered table-striped table-hover">
<thead>
Expand All @@ -19,16 +19,17 @@
<td>{{ $x }}</td>
%%formBodyHtml%%
<td>
<a href="{{ url('/%%routeGroup%%%%crudName%%/' . $item->%%primaryKey%%) }}" class="btn btn-success btn-xs"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"/></a>
<a href="{{ url('/%%routeGroup%%%%crudName%%/' . $item->%%primaryKey%% . '/edit') }}" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-pencil" aria-hidden="true"/></a>
<a href="{{ url('/%%routeGroup%%%%crudName%%/' . $item->%%primaryKey%%) }}" class="btn btn-success btn-xs" title="View %%modelName%%"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"/></a>
<a href="{{ url('/%%routeGroup%%%%crudName%%/' . $item->%%primaryKey%% . '/edit') }}" class="btn btn-primary btn-xs" title="Edit %%modelName%%"><span class="glyphicon glyphicon-pencil" aria-hidden="true"/></a>
{!! Form::open([
'method'=>'DELETE',
'url' => ['/%%routeGroup%%%%crudName%%', $item->%%primaryKey%%],
'style' => 'display:inline'
]) !!}
{!! Form::button('<span class="glyphicon glyphicon-trash" aria-hidden="true"/>', array(
{!! Form::button('<span class="glyphicon glyphicon-trash" aria-hidden="true" title="Delete %%modelName%%" />', array(
'type' => 'submit',
'class'=> 'btn btn-danger btn-xs',
'class' => 'btn btn-danger btn-xs',
'title' => 'Delete %%modelName%%',
'onclick'=>'return confirm("Confirm delete?")'
));!!}
{!! Form::close() !!}
Expand Down
5 changes: 3 additions & 2 deletions src/stubs/show.blade.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
<tfoot>
<tr>
<td colspan="2">
<a href="{{ url('%%routeGroup%%%%crudName%%/' . $%%crudNameSingular%%->id . '/edit') }}" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-pencil" aria-hidden="true"/></a>
<a href="{{ url('%%routeGroup%%%%crudName%%/' . $%%crudNameSingular%%->id . '/edit') }}" class="btn btn-primary btn-xs" title="Edit %%modelName%%"><span class="glyphicon glyphicon-pencil" aria-hidden="true"/></a>
{!! Form::open([
'method'=>'DELETE',
'url' => ['%%routeGroup%%%%crudName%%', $%%crudNameSingular%%->id],
'style' => 'display:inline'
]) !!}
{!! Form::button('<span class="glyphicon glyphicon-trash" aria-hidden="true"/>', array(
'type' => 'submit',
'class'=> 'btn btn-danger btn-xs',
'class' => 'btn btn-danger btn-xs',
'title' => 'Delete %%modelName%%',
'onclick'=>'return confirm("Confirm delete?")'
));!!}
{!! Form::close() !!}
Expand Down

0 comments on commit 9f3ccfe

Please sign in to comment.