Skip to content

Commit

Permalink
[#1432] Fix links openen vanuit veelgestelde vragen
Browse files Browse the repository at this point in the history
  • Loading branch information
linssen814 committed Feb 21, 2025
1 parent 0a039c3 commit c7b6bfe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/open_inwoner/templates/pages/profile/me.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,7 @@ <h2 class="utrecht-heading-2" id="overview">{% trans "Overzicht" %}</h2>
{% endif %}
<div class="card__body">
<div class="ellipsis">
<p class="card__heading-4">
<span class="link link__text">
{% if mentor_contacts|length < 2 %}
{% trans "Mijn begeleider" %}
{% else %}
{% trans "Mijn begeleiders" %}
{% endif %}
</span>
</p>
<p class="card__heading-4"><span class="link link__text">{% trans "Mijn begeleider" %}</span></p>
{% render_list %}
{% for name in mentor_contact_names %}
{% list_item text=name compact=True strong=False %}
Expand Down
16 changes: 15 additions & 1 deletion src/open_inwoner/utils/ckeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,21 @@ def get_rendered_content(content: str) -> str:
for element in soup.find_all(tag):
element.attrs["class"] = class_name
if element.name == "a" and element.attrs.get("href", "").startswith("http"):
element.attrs["target"] = "_blank"
# icon & screenreader support
icon = soup.new_tag("span")
icon.attrs.update({"aria-hidden": "true", "class": "material-icons"})
icon.append("open_in_new")

screen_reader_only_text = soup.new_tag("span")
screen_reader_only_text.attrs.update(
{
"class": "sr-only",
}
)
screen_reader_only_text.append(_("Opens external website"))

element.append(icon)
element.append(screen_reader_only_text)

return str(soup)

Expand Down

0 comments on commit c7b6bfe

Please sign in to comment.