Skip to content

feat: add Civic Cookie Control banner to MozFest base template#16182

Merged
mmmavis merged 5 commits into
feature/cookie-banner-civicfrom
TP1-4025-cookie-mozfest
Jul 14, 2026
Merged

feat: add Civic Cookie Control banner to MozFest base template#16182
mmmavis merged 5 commits into
feature/cookie-banner-civicfrom
TP1-4025-cookie-mozfest

Conversation

@mmmavis

@mmmavis mmmavis commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Add Civic Cookie Control banner to MozFest base template. (Mimicking the setup we have for redesign and legacy pages)
Note: This branch is based off TP1-4024-cookie-legacy. The PR will be updated to merge into the feature branch once TP1-4024-cookie-legacy is in.

Related PRs/issues: Jira Ticket

To Test

We haven't gotten our actual Civic subscription yet. For now this will have to be tested locally.

  1. Ensure https://cc.cdn.civiccomputing.com is added to your .env for:
    • CSP_SCRIPT_SRC
    • CSP_STYLE_SRC
  2. Add COOKIE_CONTROL_API_KEY to your .env. Key can be found on Civic Dashboard (click on ... on the COOKIE CONTROL Multi-site PRO Edition (v9))
  3. Check out this branch
  4. docker compose up
  5. Go to http://localhost:8000/cms/sites/ and swap the site hosts so the MozFest site is accessible at the root:
    • Redesign site: change host from localhost to e.g. new.localhost
    • Legacy site: change host from legacy.localhost to e.g. old.localhost
    • MozFest site: change host from mozfest.localhost to localhost
  6. Go to http://localhost:8000
  7. Civic's cookie banner should appear. Layout and font styles match the legacy site (Zilla Slab for heading, Nunito Sans for body text)

@mmmavis
mmmavis marked this pull request as ready for review July 6, 2026 20:54
@mmmavis
mmmavis requested a review from ramram-mf July 6, 2026 20:54
@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@ramram-mf ramram-mf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @mmmavis looks great I just found a couple of lines out of place, and turns out are not even needed so we can just remove those and then its ready to go. Thanks!

Comment thread foundation_cms/legacy_apps/mozfest/templates/mozfest/mozfest-base.html Outdated
Base automatically changed from TP1-4024-cookie-legacy to feature/cookie-banner-civic July 14, 2026 16:48
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4025-c-bsptzb July 14, 2026 16:49 Inactive
Co-authored-by: Ram <ramon@mozillafoundation.org>
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4025-c-bsptzb July 14, 2026 17:19 Inactive
@mmmavis

mmmavis commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

PR updated!

@ramram-mf ramram-mf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looking good now! Thanks @mmmavis

@mmmavis
mmmavis merged commit c4e7d45 into feature/cookie-banner-civic Jul 14, 2026
10 of 11 checks passed
@mmmavis
mmmavis deleted the TP1-4025-cookie-mozfest branch July 14, 2026 19:01
mmmavis added a commit that referenced this pull request Jul 15, 2026
* feat: Civic cookie banner (styling, localized text, GTM Consent Mode v2 defaults) (#16128)

* basic Civic cookie banner set up & styling overrides

* feat: extract cookie consent localized text into separate module

* style: add a new color token & update styling for cookie banner

* feat: scaffold localized text for all supported cookie banner locales

* added another placeholder for optional cookie category

* fix formatting/linting issues

* feat: scaffold optional cookie categories with functional cookie list

* refactor: move cookie control JS files into civic_cookie_control/ folder

* docs: add COOKIE_CONTROL_API_KEY to README env vars

* feat: populate cookie lists for performance and personalized advertising categories

* feat: set gtag Consent Mode v2 defaults to denied before GTM loads

* styling fixes

* feat: enable consent logging for testing

* refactor: remove manual gtag consent callbacks as it will be handled by Civic GTM Template (TP1-3991)

* feat: scaffold optional cookie category text for all locales and add ES localized banner text

* feat: add FR localized banner text

* refactor: reorder text keys to match English structure and document closeLabel usage

* feat: add SW localized banner text

* feat: add NL localized banner text

* feat: add PL localized banner text

* feat: add PT localized banner text

* fix formatting/linting issues

* revert: remove optional cookie categories work (deferred to TP1-4033)

* revert: remove optional cookie categories work (deferred to TP1-4033)

* feat: add placeholder cookie categories and TODOs for TP1-4033

* chore: add dev-only logging and placeholder cookie categories for PR testing

* small fixes

* Move console.log to after the config has been loaded

* Remove extra code

* chore: update Civic cookie control product type to PRO_MULTISITE

Updated to reflect the new Pro Multisite licence.

* feat(cookie-control): add CCPA mode for California visitors (#16157)

* feat(cookie-control): add CCPA mode detection and ccpaConfig scaffolding

* feat(cookie-control): apply CCPA-specific text overrides across all locales

* style(cookie-control): move ...CCPA_CONFIG_SHARED to last key in all ccpaConfig blocks

* style(cookie-control): fix formatting/linting issues

* remove extra line

* fix(cookie-control): align ccpaConfig.rejectButton with rejectSettings across all locales

* Revert "fix(cookie-control): align ccpaConfig.rejectButton with rejectSettings across all locales"

This reverts commit b68c923.

* refactor(cookie-control): extract CCPA opt-out label into CCPA_TITLE and align rejectButton with rejectSettings

* fix(cookie-control): remove draft prefixes from localized ccpaConfig descriptions

* chore(cookie-control): add CCPA_TITLE for nl, note missing OneTrust CCPA text for pl

* fix(cookie-control): fall back ca and fy to English until translations are sourced

* fix(cookie-control): remove [WIP] placeholders and fall back pl to English

- Drop the [WIP] prefix from all localized closeLabel values; a TODO comment is left in place until proper translations are sourced.
- Move Polish (pl) out of CCPA_TITLE's inline object and into the English-fallback block alongside ca and fy, mirroring the pattern used for those locales.
- Replace the [WIP] Polish ccpaConfig description and name with the English text so the widget is functional rather than broken.

* fix(cookie-control): replace misplaced fr ccpaConfig description with correct CCPA intro paragraph

The French ccpaConfig.description was set to a single opt-out statement instead of the full cookie policy intro paragraph. Replaced with the correct French CCPA text. Also reformatted the nl ccpaConfig.description to use a separate line for readability (no content change).

* fix(cookie-control): wrap CCPA buttons when container is too narrow

* chore(cookie-control): remove dev-only cookie reset on page reload

* fix(cookie-control): update CCPA_CONFIG_SHARED url and date to Mozilla privacy policy

* feat: add Civic Cookie Control banner to legacy base template (#16179)

* feat: add Civic Cookie Control banner to MozFest base template (#16182)

* feat: add Civic Cookie Control banner to legacy base template

* feat: add Civic Cookie Control banner to MozFest base template

* Remove redundant code

Co-authored-by: Ram <ramon@mozillafoundation.org>

* remove extra line

---------

Co-authored-by: Ram <ramon@mozillafoundation.org>

* Configure necessary and optional cookie categories (#16202)

* Configure necessary and optional cookie categories

* Update categories

* Add missing categorie cookie and update labels

---------
Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com>

* feat(cookie-control): localize optionalCookies label/description text (#16217)

* feat(cookie-control): extract optionalCookies label/description into text.js

* feat(cookie-control): resolve optionalCookies text per locale

Extracts the static analytics/marketing config (cookies, callbacks) into BASE_OPTIONAL_COOKIES in init.js and adds withOptionalCookiesText to merge in the localized label/description from text.js, mirroring how withCCPATitle already handles the text/ccpaConfig overrides.

Adds English placeholder label/description for analytics/marketing to each locale in text.js, matching the closeLabel pattern already used for other untranslated strings. Real translations land in TP1-4033.

* style(cookie-control): use single-line strings for optionalCookies descriptions

* feat(cookie-control): add real optionalCookies translations for de, es, fr, nl, pl, pt

* docs(cookie-control): document OneTrust accept/reject label mismatch

Restores and expands the TODO noting that accept/reject button text was copied as-is from OneTrust, where the English copy says "Accept/Reject Analytics Cookies" but non-English copy says a generic "accept/reject all cookies" — the two were already out of sync in the source and need reconciling once optional category names are confirmed.

* fix(cookie-control): fix accept/reject button labels to match actual behavior

Changes the English notify-banner accept/reject text from "Accept/Reject Analytics Cookies" to "Accept All"/"Reject All", since clicking either button actually toggles both the analytics and marketing optional categories together (verified live — both end up "accepted" or both "revoked"), not just analytics. This also brings English back in line with the other locales, which already used generic "accept/reject all cookies" wording, so the previously-documented OneTrust mismatch no longer applies and that TODO is removed.

* fix(cookie-control): remove debug console.log statements (#16219)

* Remove OneTrust CMP from all Mozilla Foundation web properties (#16218)

* Remove OneTrust CMP from all Mozilla Foundation web properties

* Remove obsolete code

---------
Co-authored-by: Adalberto Cima <adalbertoc@mozillafoundation.org>

---------

Co-authored-by: Ram <ramon@mozillafoundation.org>
Co-authored-by: adalcima <cima.adalberto@gmail.com>
Co-authored-by: Adalberto Cima <adalbertoc@mozillafoundation.org>
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