Skip to content

Fix inverted maintenance button labels in admin dashboard#56

Merged
skerbis merged 2 commits intomainfrom
copilot/update-maintenance-button-labels
Nov 10, 2025
Merged

Fix inverted maintenance button labels in admin dashboard#56
skerbis merged 2 commits intomainfrom
copilot/update-maintenance-button-labels

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Maintenance toggle buttons displayed backwards logic: "Wartung" when mode was OFF, "Aktivieren" when mode was ON. Also used hardcoded German text instead of translation keys.

Changes

  • Fixed button label logic in pages/dashboard_admin.php (lines 345, 400)
    • When maintenance is inactive: button now shows "Aktivieren" (activate)
    • When maintenance is active: button now shows "Deaktivieren" (deactivate)
  • Replaced hardcoded strings with upkeep_activate / upkeep_deactivate translation keys

Before:

<?= $frontendMaintenanceActive ? 'Aktivieren' : 'Wartung' ?>

After:

<?= $frontendMaintenanceActive ? $addon->i18n('upkeep_deactivate') : $addon->i18n('upkeep_activate') ?>

Applies to both Frontend and Backend maintenance buttons.

Original prompt

This section details on the original issue you should resolve

<issue_title>Bezeichnung für Wartungsbuttons irreführend</issue_title>
<issue_description>Die Buttons für die Wartung (FE/BE) sind irreführend.

Wenn der Wartungsmodus aus ist, sollte es eher "Aktvieren" lauten, anstatt "Wartung".
Man würde ja lesen: Frontend Wartungsmodus > Aktivieren

Alternativ "Frontend pausieren" würde auch gehen.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: skerbis <791247+skerbis@users.noreply.github.com>
@skerbis
Copy link
Member

skerbis commented Nov 10, 2025

@copilot was ist mit den Lang-Dateien und @iceman-fx bitte testen

Copilot AI changed the title [WIP] Update maintenance button labels for clarity Fix inverted maintenance button labels in admin dashboard Nov 10, 2025
Copilot AI requested a review from skerbis November 10, 2025 16:53
Copy link
Contributor Author

Copilot AI commented Nov 10, 2025

@copilot was ist mit den Lang-Dateien und @iceman-fx bitte testen

Die Translation-Keys upkeep_activate und upkeep_deactivate sind bereits in beiden Lang-Dateien vorhanden:

lang/de_de.lang (Zeile 298-299):

  • upkeep_activate = Aktivieren
  • upkeep_deactivate = Deaktivieren

lang/en_gb.lang (Zeile 301-302):

  • upkeep_activate = Activate
  • upkeep_deactivate = Deactivate

Die Änderung verwendet diese existierenden Keys korrekt. Keine Änderungen an den Lang-Dateien erforderlich. (Commit: c85de21)

@skerbis skerbis marked this pull request as ready for review November 10, 2025 17:54
Copilot AI review requested due to automatic review settings November 10, 2025 17:54
@skerbis skerbis merged commit 1f7acbd into main Nov 10, 2025
1 check passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the inverted maintenance button labels in the admin dashboard by replacing hardcoded German strings with proper translation keys and correcting the button text logic. However, the button styling and icons remain inverted and should be addressed for full consistency.

Key Changes:

  • Replaced hardcoded "Aktivieren"/"Wartung" strings with upkeep_activate/upkeep_deactivate translation keys
  • Fixed button text logic: now shows "Activate" when maintenance is OFF, "Deactivate" when maintenance is ON
  • Applied changes to both Frontend and Backend maintenance toggle buttons

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 343 to 344
<button type="submit" class="btn btn-sm <?= $frontendMaintenanceActive ? 'btn-success' : 'btn-warning' ?>">
<i class="rex-icon fa-<?= $frontendMaintenanceActive ? 'play' : 'pause' ?>"></i>
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

The button styling and icon logic appear to be inverted. When maintenance is active, the button shows green (btn-success) with a "play" icon, but this is inconsistent with the "Deactivate" text on line 345.

For consistency with other parts of the codebase (e.g., pages/mail_security.badwords.php line 553-554), when maintenance is active, it should show:

  • btn-warning (yellow/orange)
  • fa-pause icon
  • "Deactivate" text

Suggested fix:

<button type="submit" class="btn btn-sm <?= $frontendMaintenanceActive ? 'btn-warning' : 'btn-success' ?>">
    <i class="rex-icon fa-<?= $frontendMaintenanceActive ? 'pause' : 'play' ?>"></i>
Suggested change
<button type="submit" class="btn btn-sm <?= $frontendMaintenanceActive ? 'btn-success' : 'btn-warning' ?>">
<i class="rex-icon fa-<?= $frontendMaintenanceActive ? 'play' : 'pause' ?>"></i>
<button type="submit" class="btn btn-sm <?= $frontendMaintenanceActive ? 'btn-warning' : 'btn-success' ?>">
<i class="rex-icon fa-<?= $frontendMaintenanceActive ? 'pause' : 'play' ?>"></i>

Copilot uses AI. Check for mistakes.
Comment on lines 398 to 399
<button type="submit" class="btn btn-sm <?= $backendMaintenanceActive ? 'btn-success' : 'btn-warning' ?>">
<i class="rex-icon fa-<?= $backendMaintenanceActive ? 'play' : 'pause' ?>"></i>
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

The button styling and icon logic appear to be inverted. When maintenance is active, the button shows green (btn-success) with a "play" icon, but this is inconsistent with the "Deactivate" text on line 400.

For consistency with other parts of the codebase (e.g., pages/mail_security.badwords.php line 553-554), when maintenance is active, it should show:

  • btn-warning (yellow/orange)
  • fa-pause icon
  • "Deactivate" text

Suggested fix:

<button type="submit" class="btn btn-sm <?= $backendMaintenanceActive ? 'btn-warning' : 'btn-success' ?>">
    <i class="rex-icon fa-<?= $backendMaintenanceActive ? 'pause' : 'play' ?>"></i>
Suggested change
<button type="submit" class="btn btn-sm <?= $backendMaintenanceActive ? 'btn-success' : 'btn-warning' ?>">
<i class="rex-icon fa-<?= $backendMaintenanceActive ? 'play' : 'pause' ?>"></i>
<button type="submit" class="btn btn-sm <?= $backendMaintenanceActive ? 'btn-warning' : 'btn-success' ?>">
<i class="rex-icon fa-<?= $backendMaintenanceActive ? 'pause' : 'play' ?>"></i>

Copilot uses AI. Check for mistakes.
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.

Bezeichnung für Wartungsbuttons irreführend

2 participants