Skip to content
Open
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
3 changes: 3 additions & 0 deletions src/Resources/views/tailwind_2/_header.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

<header class="whatwedo_table:header sm:flex sm:justify-between mb-4">
<div class="whatwedo_table:header__title flex-1 min-w-0 whatwedo-utility-heading-1 sm:truncate">
{% if table.option('meta') and table.option('meta') != table.option('title') %}
<strong class="block mb-1 text-base font-semibold text-neutral-700">{{ table.option('meta') }}</strong>
{% endif %}
{% if table.option('title') %}
<h1>
{{ table.option('title')|trans }}
Expand Down
4 changes: 4 additions & 0 deletions src/Table/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class Table
{
public const OPT_TITLE = 'title';

public const OPT_META = 'meta';

public const OPT_PRIMARY_LINK = 'primary_link';

public const OPT_ATTRIBUTES = 'attributes';
Expand Down Expand Up @@ -85,6 +87,7 @@ public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
self::OPT_TITLE => null,
self::OPT_META => null,
self::OPT_PRIMARY_LINK => null,
self::OPT_ATTRIBUTES => [],
self::OPT_SEARCHABLE => false,
Expand Down Expand Up @@ -114,6 +117,7 @@ public function configureOptions(OptionsResolver $resolver): void
]);

$resolver->setAllowedTypes(self::OPT_TITLE, ['null', 'string']);
$resolver->setAllowedTypes(self::OPT_META, ['null', 'string']);
$resolver->setAllowedTypes(self::OPT_PRIMARY_LINK, ['null', 'callable']);
$resolver->setAllowedTypes(self::OPT_ATTRIBUTES, ['array']);
$resolver->setAllowedTypes(self::OPT_SEARCHABLE, ['boolean']);
Expand Down