Skip to content

Conversation

Copy link

Copilot AI commented Sep 12, 2025

Fixed broken tooltips on disabled "Enroll" buttons when students violate age or gender restrictions during course registration.

Problem

The tooltips that should appear when hovering over disabled "Enroll" buttons were not working. The issue was that the code was using Bootstrap tooltip attributes (data-toggle="popover", data-placement, data-content) while the application uses the Foundation CSS framework.

Solution

Updated the student_register_link template tag in coderdojochi/templatetags/coderdojochi_extras.py to use Foundation tooltip syntax instead of Bootstrap:

Before (Bootstrap - Broken):

button_href = (
    'data-trigger="hover" data-placement="top"'
    f' data-toggle="popover" title="" data-content="{message}"'
    f' data-original-title="{title}"'
)

After (Foundation - Working):

button_href = (
    f'data-tooltip data-position="top" title="{message}"'
)
button_modifier = "btn-default has-tip"

Changes Made

  • Replaced data-toggle="popover" with data-tooltip
  • Replaced data-placement="top" with data-position="top"
  • Replaced data-content="{message}" with title="{message}"
  • Added has-tip class to enable Foundation tooltip styling
  • Applied fixes to all three restriction scenarios:
    • Age restrictions only
    • Gender restrictions only
    • Combined age and gender restrictions

Testing

Created a demonstration page that validates the fix works correctly for all tooltip scenarios. The tooltips now properly display restriction messages when hovering over disabled enrollment buttons.

![Tooltip Demo](https://github.com/user-attachments/assets/e4b1f88f-e129-4552-b054-56f42b37b125)

Fixes #859.


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

Copilot AI changed the title [WIP] Tooltips broken. Fix broken tooltips for age/gender restrictions by replacing Bootstrap with Foundation classes Sep 12, 2025
Copilot AI requested a review from karbassi September 12, 2025 18:27
Copilot finished work on behalf of karbassi September 12, 2025 18:27
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.

Tooltips broken.

2 participants