Events index cards: restore presence icons + clickable cards#390
Open
GeneralDido wants to merge 3 commits intorc-1.5.0from
Open
Events index cards: restore presence icons + clickable cards#390GeneralDido wants to merge 3 commits intorc-1.5.0from
GeneralDido wants to merge 3 commits intorc-1.5.0from
Conversation
Extract shared heading partial, restore presence icons on /events cards, remove event type pills from /events index cards, dedupe SciLifeLab badge predicate, normalize collection_item locals.
Make cards clickable via stretched-link overlay, ensure nested links/tooltips stay clickable via z-index elevation, add old-style hover highlight, add title clamping, event layout styles, and meta-row height normalization.
Add coverage for stretched-link markup on both indexes, validate event type pills removal, add a real nil-presence rendering test, and assert course “Next instance” link rendering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key details
Tests
Changes by file
app/views/common/_index_card_heading.html.erb/eventsand/coursesindex cards to keep the title + right-side icons markup consistent.link_to resource) with classcourse-card__stretched-link(this link provides the “click anywhere” overlay via CSS)..course-card__title-text) so we can clamp the text without putting overflow rules on the<a>(puttingoverflow: hiddenon the stretched link canclip the overlay and break click-anywhere).
.course-card__icons) populated by pre-rendered HTML passed in viaicons:local.app/views/events/_index_event.html.erb.course-card__presence-mobile) that’s shown on small screens when the left column is hidden./eventsindex card (Option 2), reducing clutter + height variance; this does not remove facets or show-page display..course-card__meta--event+.course-card__meta-itemwrappers:show_scilifelab_badge?(event)helper instead of duplicating the slug check.app/views/courses/_index_course.html.erbcollection_itemhandling viacollection_item = local_assigns[:collection_item]and guards withpresent?to avoid shared-partial/local-variable pitfalls.show_scilifelab_badge?(course)helper (deduped predicate).app/helpers/application_helper.rbshow_scilifelab_badge?(resource)helper to dedupe the SciLifeLab badge condition across event/course index cards.associated_nodes(which is preloaded on index pages), so it’s primarily about reuse/consistency rather than DB query reduction.app/assets/stylesheets/courses/_index_cards.scss.course-card__stretched-link::aftercreates a full-card overlay (z-index: 1)..course-cardisposition: relativeso the overlay is correctly contained within the card.position: relative; z-index: 2on links/buttons/tooltips/etc. so they sit above the overlay and still receive clicks/hover..course-card__interactiveas an escape-hatch utility class: if someone adds a future clickable widget inside the card, adding this class guarantees it won’t be“dead under the overlay”.
[role="button"]/[role="link"]and both Bootstrap 3 (data-toggle) + Bootstrap 5 (data-bs-toggle) tooltip/popover hooks for robustness.#d2e5e7, matching the initial.link-overlayfeel)..course-card__layout) with a fixed-width presence column on desktop..course-card__presence-mobile..course-card__meta--event,.course-card__meta-item) for tight icon→text pairing + clean wrap./eventsright-side alignment: ensures.course-card__contentgrows to full width inside the two-column layout (prevents icons/badge from bunching next to the title).min-height: 44px) to reduce card-height “jitter”; removed on mobile where the layout stacks.test/controllers/events_controller_test.rbupdate_column(:presence, nil)to bypassbefore_validation :presence_default..course-card__leadingand.course-card__presence-mobile).test/controllers/courses_controller_test.rb/courses.