Fix inverted maintenance button labels in admin dashboard#56
Conversation
Co-authored-by: skerbis <791247+skerbis@users.noreply.github.com>
|
@copilot was ist mit den Lang-Dateien und @iceman-fx bitte testen |
Die Translation-Keys lang/de_de.lang (Zeile 298-299):
lang/en_gb.lang (Zeile 301-302):
Die Änderung verwendet diese existierenden Keys korrekt. Keine Änderungen an den Lang-Dateien erforderlich. (Commit: c85de21) |
There was a problem hiding this comment.
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_deactivatetranslation 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.
| <button type="submit" class="btn btn-sm <?= $frontendMaintenanceActive ? 'btn-success' : 'btn-warning' ?>"> | ||
| <i class="rex-icon fa-<?= $frontendMaintenanceActive ? 'play' : 'pause' ?>"></i> |
There was a problem hiding this comment.
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-pauseicon- "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>| <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> |
| <button type="submit" class="btn btn-sm <?= $backendMaintenanceActive ? 'btn-success' : 'btn-warning' ?>"> | ||
| <i class="rex-icon fa-<?= $backendMaintenanceActive ? 'play' : 'pause' ?>"></i> |
There was a problem hiding this comment.
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-pauseicon- "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>| <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> |
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
pages/dashboard_admin.php(lines 345, 400)upkeep_activate/upkeep_deactivatetranslation keysBefore:
After:
Applies to both Frontend and Backend maintenance buttons.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.