Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add implant icons #679

Merged
merged 6 commits into from
May 25, 2024
Merged
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
16 changes: 14 additions & 2 deletions src/Http/Controllers/Character/SheetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of SeAT
*
* Copyright (C) 2015 to 2022 Leon Jacobs
* Copyright (C) 2015 to present Leon Jacobs
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -23,6 +23,7 @@
namespace Seat\Web\Http\Controllers\Character;

use Seat\Eveapi\Models\Character\CharacterInfo;
use Seat\Eveapi\Models\Sde\InvType;
use Seat\Web\Http\Controllers\Controller;

/**
Expand All @@ -38,6 +39,17 @@ class SheetController extends Controller
*/
public function show(CharacterInfo $character)
{
return view('web::character.sheet', compact('character'));
//create key/value pairs for implant IDs and texts
$jumpclone_implant_ids = collect($character->jump_clones)
->pluck('implants')
->flatten()
->unique();

$jumpclone_implants = InvType::whereIn('typeID', $jumpclone_implant_ids)
->get()
->pluck('typeName', 'typeID')
->toArray();

return view('web::character.sheet', compact('character', 'jumpclone_implants'));
}
}
9 changes: 9 additions & 0 deletions src/resources/views/character/sheet.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@
@else
Location is unknown
@endif

@if(! empty($clone->implants))
</br>&nbsp&nbsp
@foreach($clone->implants as $implant_id)
<i data-toggle="tooltip" title="{{ $jumpclone_implants[$implant_id] }}">
{!! img('types', 'icon', $implant_id, 32, ['class' => 'img-circle eve-icon small-icon'], false) !!}
</i>
@endforeach
@endif
</li>
@endforeach

Expand Down
Loading