Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Version 1.6.0 (#58)
Browse files Browse the repository at this point in the history
This version is suited for the latest release of eveseat/web 3.0.10 and higher. SeAT now uses a newer version of datatables and therefore raw columns need to be enabled to show its html content.
Also the dependency on form generator in edit blade was removed.
  • Loading branch information
herpaderpaldent authored Dec 9, 2018
1 parent dbc8ef2 commit 50f05c0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 1.6.0
This version is suited for the latest release of eveseat/web 3.0.10 and higher. SeAT now uses a newer version of datatables and therefore raw columns need to be enabled to show its html content.
Also the dependency on form generator in edit blade was removed.

# Version 1.5.2
This is a minor usability update. All of the found improvements are based from @Eingang's Feedback. Whenever you find any issues please don't hesitate to open an issue.
* Empty corporation affiliation request caused an error. This update adds validation to form request
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": ">=7.1",
"laravel/framework": "5.5.*",
"eveseat/web": "~3"
"eveseat/web": ">=3.0.10"
},
"require-dev": {
"orchestra/testbench": "3.5.*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Herpaderpaldent\Seat\SeatGroups\Actions\SeatGroups\GetCurrentAffiliationAction;
use Herpaderpaldent\Seat\SeatGroups\Http\Validation\Affiliation\GetCurrentAffiliationsRequest;
use Illuminate\Routing\Controller;
use Yajra\Datatables\Datatables;
use Yajra\DataTables\DataTables;

class SeatGroupAffiliationController extends Controller
{
Expand All @@ -20,13 +20,14 @@ public function getCurrentAffiliations(GetCurrentAffiliationsRequest $request, G

$affiliations = collect($action->execute($request->all()));

return Datatables::of($affiliations)
return DataTables::of($affiliations)
->addColumn('affiliation', function ($row) {
return view('seatgroups::affiliation.partials.table-partials.affiliation', compact('row'))->render();
})
->addColumn('remove', function ($row) {
return view('seatgroups::affiliation.partials.table-partials.remove-button', compact('row'))->render();
})
->rawColumns(['affiliation', 'remove'])
->make(true);

}
Expand Down
5 changes: 3 additions & 2 deletions src/Http/Controllers/Logs/SeatGroupLogsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use Herpaderpaldent\Seat\SeatGroups\Models\SeatgroupLog;
use Seat\Web\Http\Controllers\Controller;
use Yajra\Datatables\Datatables;
use Yajra\DataTables\DataTables;

class SeatGroupLogsController extends Controller
{
Expand All @@ -26,13 +26,14 @@ public function getSeatGroupLogs()
{
$logs = SeatgroupLog::query();

return Datatables::of($logs)
return DataTables::of($logs)
->editColumn('created_at', function ($row) {
return view('seatgroups::logs.partials.date', compact('row'));
})
->editColumn('event', function ($row) {
return view('seatgroups::logs.partials.event', compact('row'));
})
->rawColumns(['created_at', 'event'])
->make(true);

}
Expand Down
5 changes: 3 additions & 2 deletions src/Http/Controllers/SeatGroupUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Illuminate\Http\Request;
use Seat\Web\Acl\AccessManager;
use Seat\Web\Http\Controllers\Controller;
use Yajra\Datatables\Datatables;
use Yajra\DataTables\DataTables;

class SeatGroupUserController extends Controller
{
Expand Down Expand Up @@ -226,13 +226,14 @@ public function getMembersTable($id)
{
$seatgroup_members = Seatgroup::find($id)->group;

return Datatables::of($seatgroup_members)
return DataTables::of($seatgroup_members)
->addColumn('name', function ($row) {
return view('seatgroups::partials.modal-partials.modal-name', compact('row'))->render();
})
->addColumn('actions', function ($row) {
return view('seatgroups::partials.modal-partials.modal-actions', compact('row'))->render();
})
->rawColumns(['name', 'actions'])
->make(true);
}
}
2 changes: 1 addition & 1 deletion src/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
'uses' => 'SeatGroupsController@removeAffiliation',
]);

Route::delete('/{seat_group_id}/user/{group_id}', [
Route::post('/{seat_group_id}/user/{group_id}', [
'as' => 'seatgroupuser.removeGroupFromSeatGroup',
'middleware' => 'bouncer:seatgroups.create',
'uses' => 'SeatGroupUserController@removeGroupFromSeatGroup',
Expand Down
2 changes: 1 addition & 1 deletion src/config/seatgroups.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 10:24.
*/
return [
'version' => '1.5.2',
'version' => '1.6.0',
];

//TODO: Update Version
28 changes: 13 additions & 15 deletions src/resources/views/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,12 @@
<div class="col-md-12"></div>
<div class="form-group col-md-12">
<label for="type">{{trans('seatgroups::seat.seat_groups_type')}}</label>
{{Form::select('type',[
'auto' => 'auto',
'managed'=>[
'open'=>'open',
'managed' => 'managed'
],
'hidden' => 'hidden'
], $seatgroup->type,['class'=>'form-control'])}}

<select class="form-control" name="type">
<option value="auto" {{$seatgroup->type === 'auto' ? 'selected' : ''}}>auto</option>
<option value="open" {{$seatgroup->type === 'open' ? 'selected' : ''}}>open</option>
<option value="managed" {{$seatgroup->type === 'managed' ? 'selected' : ''}}>managed</option>
<option value="hidden" {{$seatgroup->type === 'hidden' ? 'selected' : ''}}>hidden</option>
</select>
</div>
</div>

Expand Down Expand Up @@ -172,12 +169,13 @@
{{ $group->users->map(function($user) { return $user->name; })->implode(', ') }}
</td>
<td>
{!! Form::open(['method' => 'DELETE',
'route' => ['seatgroupuser.removeGroupFromSeatGroup',$seatgroup->id,$group->id],
'style'=>'display:inline'
]) !!}
{!! Form::submit(trans('web::seat.remove'), ['class' => 'btn btn-danger btn-xs pull-right']) !!}
{!! Form::close() !!}

<form role="form" action="{{ route('seatgroupuser.removeGroupFromSeatGroup',['seat_group_id' => $seatgroup->id, 'group_id' => $group->id]) }}" method="post">
{{ csrf_field() }}
<button type="submit" class="btn btn-danger btn-xs pull-right">
{{ trans('web::seat.remove') }}
</button>
</form>
</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/partials/managed-group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

</div>
<div class="box-footer">
Managers: {{$seatgroup->manager->map(function($user) { return $user->main_character->name; })->concat($seatgroup->children->map(function($children) { return $children->name; }))->implode(', ')}}
Managers: {{$seatgroup->manager->map(function($user) { return optional($user->main_character)->name; })->concat($seatgroup->children->map(function($children) { return $children->name; }))->implode(', ')}}

@includeWhen($seatgroup->isManager(auth()->user()->group) || auth()->user()->hasSuperUser(),'seatgroups::partials.manager-modal')

Expand Down

0 comments on commit 50f05c0

Please sign in to comment.