Skip to content

Commit

Permalink
Entity subpages better helper texts
Browse files Browse the repository at this point in the history
  • Loading branch information
ilestis committed Jan 9, 2025
1 parent 5b1488f commit 5029077
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lang/en/entities/abilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'success' => 'Abilities successfully reordered',
],
'show' => [
'helper' => 'Attach abilities to this entity. You can always edit the visibility or remove an ability. Abilities belonging to the same parent ability will display as filter boxes.',
'helper' => 'Attach abilities to :name to represent what powers they possess.',
'reorder' => 'Reorder',
'title' => ':name Abilities',
],
Expand Down
6 changes: 5 additions & 1 deletion lang/en/entities/attributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
'unlock' => 'Attribute unlocked',
'unpin' => 'Attribute unpinned',
],
'tutorial' => 'Attributes are little bits of information attached to an entity. For example, a character might have an :hp and :str stat, while a location might have a :pop one. This can easily be tracked with attributes.',
'tutorials' => [
'general' => 'Attributes are little bits of information attached to :name.',
'character' => 'For example, they might have an :hp and :str property.',
'location' => 'For example, they might have a :pop. property.',
],
'types' => [
'attribute' => 'Attribute',
'block' => 'Block',
Expand Down
2 changes: 1 addition & 1 deletion lang/en/entities/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'helpers' => [
'characters' => 'Setting the type as either the date of birth or of death for this character will automatically calculate their age. :more.',
'founding' => 'Setting the type as :type will automatically calculate the entity\'s age since founding.',
'no_events_v2' => 'This entity can be linked to the campaign\'s calendars through reminders, which are displayed here.',
'reminders' => 'Reminders linked to :name will be displayed here.',
],
'show' => [
'actions' => [
Expand Down
6 changes: 5 additions & 1 deletion lang/en/entities/inventories.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
'tooltips' => [
'equipped' => 'This item is equipped',
],
'tutorial' => 'Keep track of what an entity possesses with by adding items to its inventory.',
'tutorials' => [
'character' => 'Keep track of what :name possesses or has for sale by adding items to their inventory.',
'location' => 'Keep track of what :name has for sale or to loot by adding items to its inventory.',
'other' => 'Keep track of what :name possesses by adding items to its inventory.',
],
'update' => [
'success' => 'Item :item updated for :entity.',
'title' => 'Update an item on :name',
Expand Down
16 changes: 8 additions & 8 deletions resources/views/components/tutorial.blade.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

<div class="alert p-4 @if ($type) alert-{{ $type }} @else alert-info @endif tutorial rounded" id="{{ $id }}">
@auth
<button type="button" class="text-xl opacity-50 hover:opacity-100 focus:opacity-100 cursor-pointer text-decoration-none float-right" data-dismiss="tutorial" data-target="#{{ $id }}" aria-hidden="true" data-url="{{ route('tutorials.dismiss', ['code' => $code]) }}">
<x-icon class="fa-regular fa-circle-xmark" tooltip="1" title="{{ __('crud.delete_modal.close') }}" />
</button>
@endauth
{!! $slot !!}

@if (!empty($doc))
<p>
{!! __('crud.helpers.learn_more', ['documentation' => '<a href="' . $doc . '" target="_blank"><i class="fa-solid fa-external-link" aria-hidden="true"></i> ' . __('footer.documentation') . '</a>']) !!}
</p>
@endif
<div class="flex flex-col gap-2">
{!! $slot !!}
@if (!empty($doc))
<p>
{!! __('crud.helpers.learn_more', ['documentation' => '<a href="' . $doc . '" target="_blank"><i class="fa-solid fa-external-link" aria-hidden="true"></i> ' . __('footer.documentation') . '</a>']) !!}
</p>
@endif
</div>
</div>
2 changes: 1 addition & 1 deletion resources/views/entities/pages/abilities/render.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-tutorial code="abilities" doc="https://docs.kanka.io/en/latest/entities/abilities.html">
<p>{{ __('entities/abilities.show.helper') }}</p>
<p>{!! __('entities/abilities.show.helper', ['name' => $entity->name]) !!}</p>
</x-tutorial>
@include('entities.pages.abilities._abilities')
17 changes: 13 additions & 4 deletions resources/views/entities/pages/attributes/main.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<?php /** @var \App\Models\Entity $entity */?>
<x-tutorial code="attributes" doc="https://docs.kanka.io/en/latest/features/attributes.html">
<p>{!! __('entities/attributes.tutorial', [
'hp' => '<code>HP</code>',
'str' => '<code>STR</code>',
'pop' => '<code>Population</code>',
<p>{!! __('entities/attributes.tutorials.general', [
'name' => $entity->name,
]) !!}</p>
@if ($entity->isCharacter())
<p>{!! __('entities/attributes.tutorials.character', [
'hp' => '<code>HP</code>',
'str' => '<code>STR</code>',
]) !!}</p>
@elseif ($entity->isLocation())
<p>{!! __('entities/attributes.tutorials.location', [
'pop' => '<code>Population</code>',
]) !!}</p>
@endif
</x-tutorial>

@include('entities.pages.attributes.render')
Expand Down
9 changes: 8 additions & 1 deletion resources/views/entities/pages/inventory/render.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php /** @var \App\Models\Entity $entity */?>
<x-tutorial code="inventory" doc="https://docs.kanka.io/en/latest/features/inventory.html">
<p>{{ __('entities/inventories.tutorial') }}</p>
@if ($entity->isCharacter())
<p>{!! __('entities/inventories.tutorials.character', ['name' => $entity->name]) !!}</p>
@elseif ($entity->isLocation())
<p>{!! __('entities/inventories.tutorials.location', ['name' => $entity->name]) !!}</p>
@else
<p>{!! __('entities/inventories.tutorials.other', ['name' => $entity->name]) !!}</p>
@endif
</x-tutorial>
@include('entities.pages.inventory.grid')
2 changes: 1 addition & 1 deletion resources/views/entities/pages/reminders/_list.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<x-tutorial code="events" doc="https://docs.kanka.io/en/latest/features/reminders.html">
<p>{{ __('entities/events.helpers.no_events_v2') }}</p>
<p>{!! __('entities/events.helpers.reminders', ['name' => $entity->name]) !!}</p>
</x-tutorial>

@if ($rows->count() > 0)
Expand Down

0 comments on commit 5029077

Please sign in to comment.