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

zostera / django-bootstrap4 / 13586154518

28 Feb 2025 10:23AM CUT coverage: 90.728%. Remained the same
13586154518

Pull #806

github

web-flow
Merge a6d4ee07f into 73c00f56e
Pull Request #806: Use src/django_bootstrap4 structure

233 of 302 branches covered (77.15%)

Branch coverage included in aggregate %.

24 of 24 new or added lines in 15 files covered. (100.0%)

1274 of 1359 relevant lines covered (93.75%)

14.06 hits per line

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

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

4
from django_bootstrap4.utils import render_tag
15✔
5

6
from .text import text_value
15✔
7

8

9
def render_alert(content, alert_type=None, dismissible=True):
15✔
10
    """Render a Bootstrap alert."""
11
    button = ""
15✔
12
    if not alert_type:
15✔
13
        alert_type = "info"
15✔
14
    css_classes = ["alert", "alert-" + text_value(alert_type)]
15✔
15
    if dismissible:
15!
16
        css_classes.append("alert-dismissible")
15✔
17
        close = _("close")
15✔
18
        button = f'<button type="button" class="close" data-dismiss="alert" aria-label="{close}">&times;</button>'
15✔
19
    button_placeholder = "__BUTTON__"
15✔
20
    return mark_safe(
15✔
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