Skip to content

[icos] Add Community Hub module (cp_community_hub)#25

Open
ahd44 wants to merge 31 commits into
masterfrom
andrew/add-community-hub
Open

[icos] Add Community Hub module (cp_community_hub)#25
ahd44 wants to merge 31 commits into
masterfrom
andrew/add-community-hub

Conversation

@ahd44
Copy link
Copy Markdown
Member

@ahd44 ahd44 commented May 18, 2026

Adds the module cp_community_hub which adds the data structures for Community Resources (content type), an associated view block, styles, and Javascript. Also adjusts the navigation menu to reduce spacing when screen is narrow, allowing for the addition of the Community Hub to the nav bar.

Setup instructions included in README.md

@ahd44 ahd44 changed the title Andrew/add community hub Add Community Hub module (cp_community_hub) May 18, 2026
@ahd44 ahd44 changed the title Add Community Hub module (cp_community_hub) [icos] Add Community Hub module (cp_community_hub) May 25, 2026
@ahd44 ahd44 marked this pull request as ready for review May 25, 2026 11:13
@ahd44 ahd44 requested a review from jonathanthiry May 25, 2026 11:13
Copy link
Copy Markdown
Contributor

@jonathanthiry jonathanthiry left a comment

Choose a reason for hiding this comment

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

Looks good 👍

theme:
css/cp-community-hub.css: {}
js:
js/cp-community-hub-view.js: {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You probably should add core/drupal, core/once, and core/drupal.ajax as dependencies.

Comment on lines +60 to +69
const clone = filterWrapper.cloneNode(true);
for (let checkbox of clone.querySelectorAll('input[type="checkbox"]')) {
checkbox.setAttribute('form', viewsFormId);
checkbox.classList.add('btn-check');
checkbox.setAttribute('autocomplete', 'off');
const label = clone.querySelector('label[for="' + checkbox.id + '"]');
if (label) {
label.classList.add('btn', 'btn-outline-primary');
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like you keep the same ID for the inputs, could it be an issue to have duplicates on the page?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know this file should only be included on the community hub page right now, but if that would change some of these selectors are generic (e.g. h1.title) and could break other things. You could consider scoping them to the page.

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.

2 participants