Skip to content

feat(cms): add all Bootstrap 4 alert color choices - #1195

Merged
wesleyboar merged 11 commits into
mainfrom
feat/wp-1297-alert-color-choices
Jul 3, 2026
Merged

feat(cms): add all Bootstrap 4 alert color choices#1195
wesleyboar merged 11 commits into
mainfrom
feat/wp-1297-alert-color-choices

Conversation

@wesleyboar

@wesleyboar wesleyboar commented Jul 2, 2026

Copy link
Copy Markdown
Member

Overview

Exposes all Bootstrap 4 alert context variants (success, danger, warning, info) in the CMS Bootstrap Alert plugin. Previously only primary, secondary, light, and dark were available.

Warning

Offer these new Styles for Buttons also, but they have no effect, cuz buttons set "tertiary" colors for all of these Styles.

Related

Changes

  • added success, danger, warning, info to DJANGOCMS_BOOTSTRAP4_COLOR_STYLE_CHOICES
  • deleted outdated comments disabling those choices
  • added create_test_page_alert_style management command (all 8 context variants)

Testing

  1. make start
  2. docker exec core_cms python manage.py create_test_page_alert_style --replace
  3. Visit the generated URL and verify all 8 alert variants render with the correct Bootstrap color class.
  4. Optionally: add a Bootstrap Alert plugin manually and confirm all 8 contexts appear in the Context dropdown.

UI

localhost_8000_test_test-alert-style_

Closes WP-1297

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Expose full Bootstrap 4 alert context variants in CMS plugin

✨ Enhancement 🕐 Less than 10 minutes

Grey Divider

AI Description

• Add missing Bootstrap 4 alert context variants to the CMS alert plugin dropdown.
• Remove outdated comments that previously disabled success/danger/warning/info choices.
• Ensure editors can select all 8 standard Bootstrap alert styles.
Diagram

graph TD
  A["CMS editor"] --> B["Bootstrap Alert plugin"] --> C["Context dropdown"] --> D["DJANGOCMS_BOOTSTRAP4_COLOR_STYLE_CHOICES"] --> E["Rendered alert"] --> F["Bootstrap CSS classes"]

  subgraph Legend
    direction LR
    _usr["User"] ~~~ _cmp["Component"] ~~~ _cfg[("Configuration")] 
  end
Loading
High-Level Assessment

The chosen approach—explicitly enabling the missing success, danger, warning, and info entries in the existing choices tuple—is the most direct and least risky way to expose standard Bootstrap 4 alert variants in the CMS. Alternatives like dynamically deriving variants from upstream libraries or duplicating per-plugin lists add complexity without clear benefit for this simple, stable set of options.

Files changed (1) +4 / -6

Enhancement (1) +4 / -6
djangocms_plugins.pyEnable Bootstrap 4 alert context variants in color style choices +4/-6

Enable Bootstrap 4 alert context variants in color style choices

• Adds 'success', 'danger', 'warning', and 'info' to 'DJANGOCMS_BOOTSTRAP4_COLOR_STYLE_CHOICES' so the CMS Bootstrap Alert plugin exposes all standard Bootstrap 4 alert contexts. Removes obsolete commented-out entries that previously disabled these variants.

taccsite_cms/_settings/djangocms_plugins.py

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

wesleyboar and others added 3 commits July 2, 2026 16:06
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wesleyboar added a commit to TACC/Core-Styles that referenced this pull request Jul 2, 2026
## Overview

Bootstrap alert links uncolored.

## Related

- [WP-1297](https://tacc-main.atlassian.net/browse/WP-1297)
- TACC/Core-CMS#1195

## Changes

- **updated** `.alert .alert-link` selector to match Bootstrap
specificity
- **updated** link color from `unset` to
`var(--global-color-accent--light)`

## Testing

1. `npm run build:css`
2. `npm start`
3. Open http://localhost:3000/components/preview/alert
4. Verify section-scoped alert links are blue
(`var(--global-color-accent--light)`).
5. Verify `alert-primary` link remains white (inherits from
scope-global).

## UI

<img width="1600" height="1500" alt="image-1783032964204"
src="https://github.com/user-attachments/assets/78ff1085-db50-4199-a8c1-6ceba05ba884"
/>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
wesleyboar and others added 6 commits July 2, 2026 19:56
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n-nav)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wesleyboar
wesleyboar merged commit 9fbee18 into main Jul 3, 2026
@wesleyboar
wesleyboar deleted the feat/wp-1297-alert-color-choices branch July 3, 2026 02:24
wesleyboar added a commit that referenced this pull request Jul 3, 2026
## Overview

**Child** `test/*` pages (Sections, Cards, Alerts) now appear in the
site navigation by default. **Parent** `/test/` page remains hidden.

## Related

- requires #1195

## Changes

- **updated** `in_navigation` from `False` to `True`

## Testing

1. `make start`
2. Run any `create_test_page_*` command with `--replace`.
3. Verify the test page appears in the site nav but `/test/` itself does
not.

## UI

Skipped. Tested, though.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@wesleyboar wesleyboar mentioned this pull request Jul 3, 2026
wesleyboar added a commit that referenced this pull request Jul 3, 2026
## Overview

1. Offer color to buttons of style success, warning, and danger.
2. Offer command to create test page.

## Related

Minimal solution to gotcha introduced by #1195.

## Changes

- **updates** @tacc/core-styles
- **adds** `manage.py` command to create test page

## Testing

1. Create page.
2. Add buttons of various types.
    ```
docker exec core_cms python manage.py create_test_page_button_style
--replace
    ```
3. Review buttons use and reuse blue, gray, and white.


## UI

<img width="780" height="460" alt="Screenshot 2026-07-02 at 22 57 46"
src="https://github.com/user-attachments/assets/dcff9529-6192-44dc-9bae-c45ae79aa57e"
/>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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