• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zostera / django-bootstrap4 / 14969570320

12 May 2025 10:11AM CUT coverage: 90.734%. Remained the same
14969570320

Pull #818

github

web-flow
Merge 4584b0cfb into f9a52afbd
Pull Request #818: Bump dependabot/fetch-metadata from 2.2.0 to 2.4.0

233 of 302 branches covered (77.15%)

Branch coverage included in aggregate %.

1275 of 1360 relevant lines covered (93.75%)

10.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.74
/src/bootstrap4/components.py
1
from django.utils.safestring import mark_safe
11✔
2
from django.utils.translation import gettext as _
11✔
3

4
from bootstrap4.utils import render_tag
11✔
5

6
from .text import text_value
11✔
7

8

9
def render_alert(content, alert_type=None, dismissible=True):
11✔
10
    """Render a Bootstrap alert."""
11
    button = ""
11✔
12
    if not alert_type:
11✔
13
        alert_type = "info"
11✔
14
    css_classes = ["alert", "alert-" + text_value(alert_type)]
11✔
15
    if dismissible:
11!
16
        css_classes.append("alert-dismissible")
11✔
17
        close = _("close")
11✔
18
        button = f'<button type="button" class="close" data-dismiss="alert" aria-label="{close}">&times;</button>'
11✔
19
    button_placeholder = "__BUTTON__"
11✔
20
    return mark_safe(
11✔
21
        render_tag(
22
            "div",
23
            attrs={"class": " ".join(css_classes), "role": "alert"},
24
            content=mark_safe(button_placeholder) + text_value(content),
25
        ).replace(button_placeholder, button)
26
    )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc