Skip to content

Conversation

meisterT
Copy link
Member

@meisterT meisterT commented Oct 4, 2025

Also generalize multi-delete code where it makes sense.

More progress towards #229.

Also generalize multi-delete code where it makes sense.

More progress towards DOMjudge#229.
@meisterT
Copy link
Member Author

meisterT commented Oct 4, 2025

Now also including teams, team affiliation, and team categories.

Also handle plural correctly of entities ending with "y".

Part of DOMjudge#229.
{% block title %}
{% if count > 1 %}
Delete {{ count }} {{ type }}s
Delete {{ count }} {% if type|slice(-1) == 'y' %}{{ type|slice(0, -1) }}ies{% else %}{{ type }}s{% endif %}
Copy link
Member Author

Choose a reason for hiding this comment

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

@eldering this is the fix for pluralizing team category

'name' => ['title' => 'name', 'sort' => true, 'default_sort' => true],
];

if ($this->isGranted('ROLE_ADMIN')) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we maybe make a generalized method of this in the base class? Also for the one below? So that we don't have this repeated html everywhere, if we ever want to change styling or something.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, please check the last two commits.

@vmcj
Copy link
Member

vmcj commented Oct 4, 2025

I think we should add unit tests for this,

@meisterT
Copy link
Member Author

meisterT commented Oct 4, 2025

I think we should add unit tests for this,

Do we have good examples for unit tests where individual entities get deleted?

@meisterT
Copy link
Member Author

meisterT commented Oct 4, 2025

@vmcj I have added a unit test for the problems entity in the last commit, PTAL.

@meisterT meisterT added this pull request to the merge queue Oct 5, 2025
Merged via the queue into DOMjudge:main with commit 436bcbb Oct 5, 2025
36 checks passed
@meisterT meisterT deleted the user_multidelete branch October 5, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants