Skip to content

Conversation

@mambax7
Copy link
Collaborator

@mambax7 mambax7 commented May 26, 2025

No description provided.

Copy link
Contributor

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 Admin “help” toggle by swapping the hide icon to a grayscale version, enforcing inline display, and improving the show/hide logic in JS, plus removes an extra character in the banners template.

  • Swap help-hide icon to help_bw.png and add display: inline; across theme and template files
  • Change JS to explicitly hide/show each toggle link and initially hide the “hide” icon
  • Remove stray > from the banner count check in system_banners.tpl

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
htdocs/modules/system/themes/dark/modules/system/admin/system_header.tpl Added display: inline; style and swapped to help_bw.png
htdocs/modules/system/templates/admin/system_header.tpl Added display: inline; style and swapped to help_bw.png
htdocs/modules/system/templates/admin/system_header.html Added display: inline; style and swapped to help_bw.png
htdocs/modules/system/templates/admin/system_banners.tpl Removed extra > from the banner count condition
htdocs/modules/system/js/admin.js Replaced .toggle() calls with explicit .hide()/ .show(), plus initial state setup
Comments suppressed due to low confidence (1)

htdocs/modules/system/js/admin.js:33

  • [nitpick] Consider using .on('click', ...) instead of .click(...) for more consistent event binding and future compatibility.
$("a.help_view").click(function () {

Comment on lines 31 to 42
$("a.help_hide").hide();

$("a.help_view").click(function () {
$("div#xo-system-help").slideToggle(1000);
$("a.help_view").toggle();
$("a.help_hide").toggle();
$("a.help_view").hide();
$("a.help_hide").show();
});

$("a.help_hide").click(function () {
$("div#xo-system-help").slideToggle(1000);
$("a.help_view").toggle();
$("a.help_hide").toggle();
$("a.help_hide").hide();
$("a.help_view").show();
Copy link

Copilot AI May 26, 2025

Choose a reason for hiding this comment

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

[nitpick] You may want to cache these jQuery selections (e.g., const $view = $("a.help_view");) to avoid querying the DOM multiple times for the same elements.

Copilot uses AI. Check for mistakes.
alt="<{$smarty.const._AM_SYSTEM_HELP_VIEW}>"/></a>
<a class="cursorhelp tooltip help_hide" title="<{$smarty.const._AM_SYSTEM_HELP_HIDE}>"
style="background-image:url('<{$theme_img}>/bc_separator_end.png');"><img src="<{xoAdminIcons 'help.png'}>"
style="background-image:url('<{$theme_img}>/bc_separator_end.png'); display: inline;"><img src="<{xoAdminIcons 'help_bw.png'}>"
Copy link

Copilot AI May 26, 2025

Choose a reason for hiding this comment

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

[nitpick] Avoid inline styles in templates; consider moving display: inline; into a shared CSS class to reduce repetition and improve maintainability.

Copilot uses AI. Check for mistakes.
@mambax7 mambax7 requested a review from Copilot May 26, 2025 14:41
Copy link
Contributor

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 admin help toggle functionality by updating the UI markup, JavaScript behavior, and CSS styles across several templates and assets.

  • Updated the HTML templates to use new classes (e.g., xo-help-button) for toggle behavior and removed redundant inline styles.
  • Improved the JavaScript implementation by caching selectors and using delegated event handling with appropriate class manipulation.
  • Fixed a syntax error in the banners template by removing an extraneous character.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
htdocs/modules/system/themes/dark/modules/system/admin/system_header.tpl Updated markup for help toggle with new CSS classes.
htdocs/modules/system/templates/admin/system_header.tpl Similar markup adjustments for a consistent toggle behavior.
htdocs/modules/system/templates/admin/system_header.html Updated help_hide element ensuring display style consistency.
htdocs/modules/system/templates/admin/system_banners.tpl Removed an extraneous closing bracket causing a syntax error.
htdocs/modules/system/js/admin.js Refactored event handling for help toggle with cached selectors.
htdocs/modules/system/css/button.css Added CSS for the new xo-help-button and its hidden state.
Comments suppressed due to low confidence (1)

htdocs/modules/system/templates/admin/system_banners.tpl:4

  • The condition expression contains an extraneous '>' at the end, which could cause a syntax error. Please remove the extra character to ensure proper template syntax.
<{if isset($banner_count) && $banner_count == true}>}>

@mambax7 mambax7 merged commit a031b9f into XOOPS:master May 31, 2025
4 checks passed
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.

1 participant