forked from corowne/lorekeeper
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a9b789
commit 96f3499
Showing
8 changed files
with
125 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
database/migrations/2024_10_14_184542_add_feature_variant_column.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
// | ||
Schema::table('features', function (Blueprint $table) { | ||
$table->unsignedInteger('parent_id')->nullable()->default(null); | ||
$table->foreign('parent_id')->references('id')->on('features')->onDelete('set null'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
// | ||
Schema::table('features', function (Blueprint $table) { | ||
$table->dropForeign(['parent_id']); | ||
$table->dropColumn('parent_id'); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<div class="row world-entry"> | ||
@if ($variant->has_image) | ||
<div class="col-md-3 world-entry-image"> | ||
<a href="{{ $variant->imageUrl }}" data-lightbox="entry" data-title="{{ $variant->name }}"> | ||
<img src="{{ $variant->imageUrl }}" class="world-entry-image" alt="{{ $variant->name }}" /> | ||
</a> | ||
</div> | ||
@endif | ||
<div class="{{ $variant->has_image ? 'col-md-9' : 'col-12' }}"> | ||
<x-admin-edit title="Trait" :object="$variant" /> | ||
<h3> | ||
@if (!$variant->is_visible) | ||
<i class="fas fa-eye-slash mr-1"></i> | ||
@endif | ||
{!! $variant->displayName !!} | ||
<a href="{{ $variant->searchUrl }}" class="world-entry-search text-muted"> | ||
<i class="fas fa-search"></i> | ||
</a> | ||
</h3> | ||
@if ($variant->feature_category_id) | ||
<div> | ||
<strong>Category:</strong> {!! $variant->category->displayName !!} | ||
</div> | ||
@endif | ||
@if ($variant->species_id) | ||
<div> | ||
<strong>Species:</strong> {!! $variant->species->displayName !!} | ||
@if ($variant->subtype_id) | ||
({!! $variant->subtype->displayName !!} subtype) | ||
@endif | ||
</div> | ||
@endif | ||
<div class="world-entry-text parsed-text"> | ||
{!! $variant->parsed_description !!} | ||
</div> | ||
</div> | ||
</div> |