Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c843d14
NGSTACK-906 add 'priority' property to Tag objects
AntePrkacin Jun 18, 2025
1c5b716
NGSTACK-906 add support for 'priority' property in the Mapper layer
AntePrkacin Jun 18, 2025
2d27fc0
NGSTACK-906 modify createTagFindQuery method to select 'priority' pro…
AntePrkacin Jun 18, 2025
a8cf605
NGSTACK-906 add 'priority' column to 'eztags' table in MySQL and Post…
AntePrkacin Jun 18, 2025
3a84111
NGSTACK-906 add translations for tag priority
AntePrkacin Jun 18, 2025
8e535ea
NGSTACK-906 show 'priority' column for tag's children
AntePrkacin Jun 18, 2025
7d59685
NGSTACK-906 add 'subitems' tab to the show tag template
AntePrkacin Jun 18, 2025
fe7ba81
NGSTACK-906 add 'subitems' tab template with dropdowns for sortBy and…
AntePrkacin Jun 18, 2025
9158a5d
NGSTACK-906 add translations for tag subitems sorting
AntePrkacin Jun 18, 2025
9ce9427
NGSTACK-906 update tag children sorting functionality in TagControlle…
AntePrkacin Jun 20, 2025
60cf2cf
NGSTACK-906 add support for sorting in loadTagChildren() method in Se…
AntePrkacin Jun 20, 2025
1041265
NGSTACK-906 add support for sorting in loadChildren() method for Tag …
AntePrkacin Jun 20, 2025
0955f35
NGSTACK-906 add support for sorting in getChildren() method for Gatew…
AntePrkacin Jun 20, 2025
43def26
NGSTACK-906 update subitems sort option value from 'tag_id' to 'id' i…
AntePrkacin Jun 20, 2025
f0aa890
NGSTACK-906 remove 'subitems' tag tab and add the tag sorting at the …
AntePrkacin Jun 20, 2025
f1e4e1a
NGSTACK-906 update tests to handle 'priority' property
AntePrkacin Jun 20, 2025
6139978
NGSTACK-906 add enums for tag sortField and sortOrder properties
AntePrkacin Jun 24, 2025
df8003b
NGSTACK-906 add sortField and sortOrder properties to Tag objects and…
AntePrkacin Jun 24, 2025
ef0d60a
NGSTACK-906 update Mappers with sortField and sortOrder fields
AntePrkacin Jun 24, 2025
be00504
NGSTACK-906 remove sortBy and sortOrder parameters from the getChildr…
AntePrkacin Jun 24, 2025
d88c066
NGSTACK-906 remove sortBy and sortOrder parameters from the loadChild…
AntePrkacin Jun 24, 2025
c0bf0f4
NGSTACK-906 remove sortBy and sortOrder parameters from the loadTagCh…
AntePrkacin Jun 24, 2025
c719cc4
NGSTACK-906 rename subitems template to sort_children_tags template a…
AntePrkacin Jun 24, 2025
93c1134
NGSTACK-906 add sortField and sortOrder properties to UpdateStruct an…
AntePrkacin Jun 24, 2025
41e6787
NGSTACK-906 remove sorting logic in ChildrenTagsAdapter
AntePrkacin Jun 24, 2025
705fc35
NGSTACK-906 add new route and controller method for updating sortFiel…
AntePrkacin Jun 24, 2025
2397fcc
NGSTACK-906 rename sortField property to sortBy property everywhere
AntePrkacin Jun 24, 2025
c6c4555
NGSTACK-906 add logic for sorting children by sortBy and sortOrder in…
AntePrkacin Jun 24, 2025
4a5391d
NGSTACK-906 fix tests regarding sortBy and sortOrder properties
AntePrkacin Jun 24, 2025
4224d33
NGSTACK-906 update TagSortBy and TagSortOrder enums, iterate through …
AntePrkacin Jun 24, 2025
e16f73f
NGSTACK-906 throw BadRequestHttpException if sortBy or sortOrder para…
AntePrkacin Jun 24, 2025
dba4689
NGSTACK-906 change sort_by and sort_order column types from enums to …
AntePrkacin Jun 25, 2025
a6100ae
NGSTACK-906 add config params for sorting all child tags and for sort…
AntePrkacin Jun 25, 2025
5733962
NGSTACK-906 update Mapper and DoctrineDatabase Gateway with logic for…
AntePrkacin Jun 25, 2025
5479257
NGSTACK-906 add support for 'sort' config params in tests
AntePrkacin Jun 25, 2025
148a3c3
NGSTACK-906 add ability to modify 'priority' property when editing a …
AntePrkacin Jun 25, 2025
3704566
NGSTACK-906 fix the update() method in DoctrineDatabase and the test …
AntePrkacin Jun 25, 2025
59beb45
NGSTACK-906 update 'sortBy' and 'sortOrder' properties to be null on …
AntePrkacin Jun 25, 2025
84d9758
NGSTACK-906 update getChildren() and update() methods in DoctrineData…
AntePrkacin Jun 25, 2025
fd507dd
NGSTACK-906 update Mapper to properly handle the case when sortBy or …
AntePrkacin Jun 25, 2025
a81d3f6
NGSTACK-906 update sort_children_tags template to check if sortBy or …
AntePrkacin Jun 25, 2025
0ce8c25
NGSTACK-906 add MySQL and PostgreSQL upgrade scripts for 'priority', …
AntePrkacin Jun 26, 2025
3e9628a
NGSTACK-906 don't show 'priority' info on synonyms and remove 'priori…
AntePrkacin Jun 26, 2025
c6d1f47
NGSTACK-906 add 'priority', 'sort_by' and 'sort_order' fields to lega…
AntePrkacin Jun 26, 2025
031c1aa
NGSTACK-906 add policy for sorting children tags
AntePrkacin Jun 26, 2025
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
13 changes: 13 additions & 0 deletions bundle/API/Repository/Values/Enums/TagSortBy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Netgen\TagsBundle\API\Repository\Values\Enums;

enum TagSortBy: string
{
case ID = 'id';
case KEYWORD = 'keyword';
case MODIFIED = 'modified';
case PRIORITY = 'priority';
}
11 changes: 11 additions & 0 deletions bundle/API/Repository/Values/Enums/TagSortOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Netgen\TagsBundle\API\Repository\Values\Enums;

enum TagSortOrder: string
{
case ASC = 'asc';
case DESC = 'desc';
}
22 changes: 22 additions & 0 deletions bundle/API/Repository/Values/Tags/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use DateTimeInterface;
use Ibexa\Contracts\Core\Repository\Values\ValueObject;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortBy;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortOrder;

use function array_map;
use function count;
Expand All @@ -28,6 +30,9 @@
* @property-read bool $alwaysAvailable Indicates if the Tag object is shown in the main language if it is not present in an other requested language
* @property-read string $mainLanguageCode The main language code of the Tag object
* @property-read string[] $languageCodes List of languages in this Tag object
* @property-read int $priority Tag priority
* @property-read TagSortBy $sortBy Specifies by which property the child tags should be sorted on
* @property-read TagSortOrder $sortOrder Specifies whether the sort order should be ascending or descending
*/
final class Tag extends ValueObject
{
Expand Down Expand Up @@ -104,6 +109,23 @@ final class Tag extends ValueObject
*/
protected ?string $prioritizedLanguageCode;

/**
* Tag priority.
*
* Position of the Tag among its siblings when sorted by priority.
*/
protected int $priority;

/**
* Specifies by which property the child tags should be sorted on.
*/
protected TagSortBy $sortBy;

/**
* Specifies whether the sort order should be ascending or descending.
*/
protected TagSortOrder $sortOrder;

/**
* Construct object optionally with a set of properties.
*
Expand Down
12 changes: 12 additions & 0 deletions bundle/API/Repository/Values/Tags/TagStruct.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace Netgen\TagsBundle\API\Repository\Values\Tags;

use Ibexa\Contracts\Core\Repository\Values\ValueObject;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortBy;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortOrder;

use function array_key_exists;

Expand All @@ -22,6 +24,16 @@ abstract class TagStruct extends ValueObject
*/
public ?string $remoteId = null;

/**
* Specifies by which property the child tags should be sorted on.
*/
public ?TagSortBy $sortBy;

/**
* Specifies whether the sort order should be ascending or descending.
*/
public ?TagSortOrder $sortOrder;

/**
* Tag keywords in the target languages
* Eg. array( "cro-HR" => "Hrvatska", "eng-GB" => "Croatia" ).
Expand Down
24 changes: 23 additions & 1 deletion bundle/Controller/Admin/TagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
use Ibexa\Contracts\Core\Repository\ContentTypeService;
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
use Netgen\TagsBundle\API\Repository\TagsService;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortBy;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortOrder;
use Netgen\TagsBundle\API\Repository\Values\Tags\Tag;
use Netgen\TagsBundle\API\Repository\Values\Tags\TagUpdateStruct;
use Netgen\TagsBundle\Core\Pagination\Pagerfanta\SearchTagsAdapter;
use Netgen\TagsBundle\Form\Type\CopyTagsType;
use Netgen\TagsBundle\Form\Type\LanguageSelectType;
Expand Down Expand Up @@ -44,7 +47,6 @@ public function showTagAction(Request $request, ?Tag $tag = null): Response

if (!$tag instanceof Tag || !$tag->isSynonym()) {
$configResolver = $this->getConfigResolver();

$currentPage = (int) $request->query->get('page');
$pager = $this->createPager(
$this->tagChildrenAdapter,
Expand Down Expand Up @@ -264,6 +266,26 @@ public function updateTagAction(Request $request, Tag $tag, string $languageCode
);
}

public function updateTagSortAction(Request $request, Tag $tag): Response
{
if (!$this->isCsrfTokenValid('netgen_tags_admin', (string) ($request->request->get('_csrf_token') ?? ''))) {
$this->addFlashMessage('errors', 'invalid_csrf_token');

return $this->redirectToTag($tag);
}

$sortBy = $request->request->get('sort_by');
$sortOrder = $request->request->get('sort_order');

$tagUpdateStruct = new TagUpdateStruct();
$tagUpdateStruct->sortBy = TagSortBy::from((string) $sortBy);
$tagUpdateStruct->sortOrder = TagSortOrder::from((string) $sortOrder);

$this->tagsService->updateTag($tag, $tagUpdateStruct);

return $this->redirectToTag($tag);
}

/**
* This method is called for delete tag or synonym action.
* It shows a confirmation view.
Expand Down
9 changes: 6 additions & 3 deletions bundle/Core/Pagination/Pagerfanta/ChildrenTagsAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
final class ChildrenTagsAdapter implements AdapterInterface, TagAdapterInterface
{
private ?Tag $tag = null;

private int $nbResults;

public function __construct(private TagsService $tagsService) {}
public function __construct(private readonly TagsService $tagsService) {}

public function setTag(Tag $tag): void
{
Expand All @@ -30,7 +29,11 @@ public function getNbResults(): int

public function getSlice($offset, $length): iterable
{
$childrenTags = $this->tagsService->loadTagChildren($this->tag, $offset, $length);
$childrenTags = $this->tagsService->loadTagChildren(
$this->tag,
$offset,
$length,
);

$this->nbResults = $this->nbResults ?? $this->tagsService->getTagChildrenCount($this->tag);

Expand Down
32 changes: 24 additions & 8 deletions bundle/Core/Persistence/Legacy/Tags/Gateway/DoctrineDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ public function getFullTagDataByKeywordAndParentId(string $keyword, int $parentI

public function getChildren(int $tagId, int $offset = 0, int $limit = -1, ?array $translations = null, bool $useAlwaysAvailable = true): array
{
$tagData = $tagId !== 0 ? $this->getBasicTagData($tagId) : [];
$sortBy = $tagData['sort_by'] ?? 'id';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add configuration for the default sort.

We also need configuration for the default sort for root tag (which has ID = 0), since we can't store this in the database.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also try to instantiate the enum to double check that the value stored in the database is an allowed stored type and direction.

Copy link
Author

@AntePrkacin AntePrkacin Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First four commits made on 25 June 2025 are regarding the config parameters for default sorting.

There are two new config parameters added:

  • one for default sorting of all child tags (sort.by and sort.order)
  • one for default sorting of root tag children (sort.root.by and sort.root.order)

These config parameters are enums (enumNode), so their values will always match the cases of enum. There is even an option to put an enum class in the node, but that is only for Symfony 7.3 (I don't know which Symfony versions you want this bundle to support).

Also, in the database, the 'sort_by' and 'sort_order' column types were changed from enums to just varchar(100). By default, when a new tag is added, it will have empty string ('') NULL set at 'sort_by' and 'sort_order' columns - in this case, these two new config parameters will be fetched for sorting.
Only when the user sorts the children tags of some tag, then will the 'sort_by' and 'sort_order' columns be set for that (parent) tag.

This was done because the <someEnum>::tryFrom() method returns null if the corresponding (given) string has no matching case. In that case, the configResolver is used to get a parameter. Example:

$tag->sortBy = TagSortBy::tryFrom($row['sort_by'])
                        ?? TagSortBy::from($this->configResolver->getParameter('sort.by', 'netgen_tags'));

$sortOrder = $tagData['sort_order'] ?? 'asc';

$tagIdsQuery = $this->createTagIdsQuery($translations, $useAlwaysAvailable);
$tagIdsQuery->andWhere(
$tagIdsQuery->expr()->andX(
Expand All @@ -137,10 +141,11 @@ public function getChildren(int $tagId, int $offset = 0, int $limit = -1, ?array
),
$tagIdsQuery->expr()->eq('eztags.main_tag_id', 0),
),
)->setParameter('parent_id', $tagId, Types::INTEGER)
->orderBy('eztags.keyword', 'ASC')
->setFirstResult($offset)
->setMaxResults($limit > 0 ? $limit : PHP_INT_MAX);
)
->orderBy('eztags.' . $sortBy, $sortOrder)
->setParameter('parent_id', $tagId, Types::INTEGER)
->setFirstResult($offset)
->setMaxResults($limit > 0 ? $limit : PHP_INT_MAX);

$statement = $tagIdsQuery->execute();

Expand All @@ -160,8 +165,8 @@ public function getChildren(int $tagId, int $offset = 0, int $limit = -1, ?array
[':id'],
),
)
->setParameter('id', $tagIds, Connection::PARAM_INT_ARRAY)
->orderBy('eztags_keyword.keyword', 'ASC');
->orderBy('eztags.' . $sortBy, $sortOrder)
->setParameter('id', $tagIds, Connection::PARAM_INT_ARRAY);

return $query->execute()->fetchAll(FetchMode::ASSOCIATIVE);
}
Expand Down Expand Up @@ -446,6 +451,12 @@ public function update(UpdateStruct $updateStruct, int $tagId): void
)->set(
'language_mask',
':language_mask',
)->set(
'sort_by',
':sort_by',
)->set(
'sort_order',
':sort_order',
)->where(
$query->expr()->eq(
'id',
Expand All @@ -469,7 +480,9 @@ public function update(UpdateStruct $updateStruct, int $tagId): void
is_bool($updateStruct->alwaysAvailable) ? $updateStruct->alwaysAvailable : true,
),
Types::INTEGER,
);
)
->setParameter('sort_by', $updateStruct->sortBy->value ?? 'id', Types::STRING)
->setParameter('sort_order', $updateStruct->sortOrder->value ?? 'asc', Types::STRING);

$query->execute();

Expand Down Expand Up @@ -847,7 +860,7 @@ public function deleteTag(int $tagId): void
private function createTagIdsQuery(?array $translations = null, bool $useAlwaysAvailable = true): QueryBuilder
{
$query = $this->connection->createQueryBuilder();
$query->select('DISTINCT eztags.id, eztags.keyword')
$query->select('DISTINCT eztags.id, eztags.keyword, eztags.modified, eztags.priority')
->from('eztags', 'eztags')
// @todo: Joining with eztags_keyword is probably a VERY bad way to gather that information
// since it creates an additional cartesian product with translations.
Expand Down Expand Up @@ -930,6 +943,9 @@ private function createTagFindQuery(?array $translations = null, bool $useAlways
'eztags.remote_id',
'eztags.main_language_id',
'eztags.language_mask',
'eztags.priority',
'eztags.sort_by',
'eztags.sort_order',
// Tag keywords
'eztags_keyword.keyword',
'eztags_keyword.locale',
Expand Down
8 changes: 8 additions & 0 deletions bundle/Core/Persistence/Legacy/Tags/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use Ibexa\Contracts\Core\Persistence\Content\Language\Handler as LanguageHandler;
use Ibexa\Core\Persistence\Legacy\Content\Language\MaskGenerator as LanguageMaskGenerator;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortBy;
use Netgen\TagsBundle\API\Repository\Values\Enums\TagSortOrder;
use Netgen\TagsBundle\SPI\Persistence\Tags\Tag;
use Netgen\TagsBundle\SPI\Persistence\Tags\TagInfo;

Expand Down Expand Up @@ -35,6 +37,9 @@ public function createTagInfoFromRow(array $row): TagInfo
$tagInfo->alwaysAvailable = (bool) ((int) $row['language_mask'] & 1);
$tagInfo->mainLanguageCode = $this->languageHandler->load($row['main_language_id'])->languageCode;
$tagInfo->languageIds = $this->languageMaskGenerator->extractLanguageIdsFromMask((int) $row['language_mask']);
$tagInfo->priority = (int) $row['priority'];
$tagInfo->sortBy = TagSortBy::from($row['sort_by']);
$tagInfo->sortOrder = TagSortOrder::from($row['sort_order']);

return $tagInfo;
}
Expand All @@ -60,6 +65,9 @@ public function extractTagListFromRows(array $rows): array
$tag->alwaysAvailable = (bool) ((int) $row['language_mask'] & 1);
$tag->mainLanguageCode = $this->languageHandler->load($row['main_language_id'])->languageCode;
$tag->languageIds = $this->languageMaskGenerator->extractLanguageIdsFromMask((int) $row['language_mask']);
$tag->priority = (int) $row['priority'];
$tag->sortBy = TagSortBy::from($row['sort_by']);
$tag->sortOrder = TagSortOrder::from($row['sort_order']);
$tagList[$tagId] = $tag;
}

Expand Down
3 changes: 3 additions & 0 deletions bundle/Core/Repository/TagsMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public function buildTagDomainList(array $spiTags, array $prioritizedLanguages =
'mainLanguageCode' => $spiTag->mainLanguageCode,
'languageCodes' => $languageCodes,
'prioritizedLanguageCode' => $prioritizedLanguageCode,
'priority' => $spiTag->priority,
'sortBy' => $spiTag->sortBy,
'sortOrder' => $spiTag->sortOrder,
],
);
}
Expand Down
2 changes: 2 additions & 0 deletions bundle/Core/Repository/TagsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ public function updateTag(Tag $tag, TagUpdateStruct $tagUpdateStruct): Tag
$updateStruct->remoteId = trim($tagUpdateStruct->remoteId ?? $spiTag->remoteId);
$updateStruct->mainLanguageCode = $mainLanguageCode;
$updateStruct->alwaysAvailable = $tagUpdateStruct->alwaysAvailable ?? $spiTag->alwaysAvailable;
$updateStruct->sortBy = $tagUpdateStruct->sortBy ?? $spiTag->sortBy;
$updateStruct->sortOrder = $tagUpdateStruct->sortOrder ?? $spiTag->sortOrder;

$this->repository->beginTransaction();

Expand Down
5 changes: 5 additions & 0 deletions bundle/Resources/config/routing/admin/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ netgen_tags_admin_tag_update_select:
controller: netgen_tags.admin.controller.tag:updateTagSelectAction
methods: [GET, POST]

netgen_tags_admin_tag_update_sort:
path: /{tagId}/update/sort
controller: netgen_tags.admin.controller.tag:updateTagSortAction
methods: [POST]

netgen_tags_admin_tag_update:
path: /{tagId}/update/{languageCode}
controller: netgen_tags.admin.controller.tag:updateTagAction
Expand Down
24 changes: 23 additions & 1 deletion bundle/Resources/public/admin/css/style.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bundle/Resources/sql/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CREATE TABLE `eztags` (
`remote_id` varchar(100) NOT NULL default '',
`main_language_id` int(11) NOT NULL default '0',
`language_mask` int(11) NOT NULL default '0',
`priority` int(11) NOT NULL default '0',
PRIMARY KEY ( `id` ),
KEY `idx_eztags_keyword` ( `keyword`(191) ),
KEY `idx_eztags_keyword_id` ( `keyword`(191), `id` ),
Expand Down
1 change: 1 addition & 0 deletions bundle/Resources/sql/postgresql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CREATE TABLE eztags (
remote_id varchar(100) NOT NULL default '',
main_language_id integer not null default 0,
language_mask integer not null default 0,
priority integer not null default 0,
PRIMARY KEY (id),
CONSTRAINT idx_eztags_remote_id UNIQUE (remote_id)
);
Expand Down
7 changes: 7 additions & 0 deletions bundle/Resources/translations/netgen_tags_admin.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tag.remote_id: 'Remote ID'
tag.tag_name: 'Keyword'
tag.translations: 'Translations'
tag.modified: 'Modified'
tag.priority: 'Priority'
tag.main_tag: 'Main tag'
tag.parent_tag: 'Parent tag'

Expand Down Expand Up @@ -43,6 +44,12 @@ tag.children.no_children: 'No tags found'
tag.subtree_limitations.title: 'Subtree limitations'
tag.subtree_limitations.no_limitations: 'No subtree limitations'

tag.subitems.title: 'Subitems'
tag.subitems.sort_by: 'Sort by'
tag.subitems.sort_order: 'Sort order'
tag.subitems.sort_order.ascending: 'Ascending'
tag.subitems.sort_order.descending: 'Descending'

tag.related_content.title: 'List of content related to tag'
tag.related_content.filter.content_type: 'Content type filter'
tag.related_content.filter.sort: 'Sort'
Expand Down
7 changes: 7 additions & 0 deletions bundle/Resources/translations/netgen_tags_admin.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tag.remote_id: 'Identification à distance'
tag.tag_name: 'Mot-clé'
tag.translations: 'Traductions'
tag.modified: 'Modifié'
tag.priority: 'Priorité'
tag.main_tag: 'Tag principale'
tag.parent_tag: 'Tag parent'

Expand Down Expand Up @@ -43,6 +44,12 @@ tag.children.no_children: 'Pas de tags trouvés'
tag.subtree_limitations.title: 'Limites des sous-arbres'
tag.subtree_limitations.no_limitations: 'Aucune limite de sous-arbre'

tag.subitems.title: 'Sous-éléments'
tag.subitems.sort_by: 'Trier par'
tag.subitems.sort_order: 'Ordre de tri'
tag.subitems.sort_order.ascending: 'Ascendant'
tag.subitems.sort_order.descending: 'Descendant'

tag.related_content.title: 'Liste des contenus liés au tag'

tag.add.title: 'Nouveau tag'
Expand Down
6 changes: 6 additions & 0 deletions bundle/Resources/views/admin/tag/children.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<th>{{ 'tag.tag_name'|trans }}</th>
<th>{{ 'tag.translations'|trans }}</th>
<th>{{ 'tag.modified'|trans }}</th>
<th>{{ 'tag.priority'|trans }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -48,6 +49,7 @@
{% endfor %}
</td>
<td>{{ child.modificationDate|date }}</td>
<td>{{ child.priority }}</td>
</tr>
{% endfor %}
</tbody>
Expand All @@ -71,6 +73,10 @@
{% endif %}
</div>
</form>

{% if tag is defined and not tag.isSynonym %}
{% include '@NetgenTags/admin/tag/sort_children_tags.html.twig' %}
{% endif %}
{% else %}
<p>{{ 'tag.children.no_children'|trans }}</p>
{% endif %}
Loading
Loading