Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix info-page issues #6100

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ <h3 id="responsible-body">{% trans 'Responsible body' %}</h3>
{% endif %}

{% if organisation.url %}
<p>{% trans "Website" %}:
<a href="{{ organisation.url }}" target="_blank" rel="noopener noreferrer">{{ organisation.url }}</a>
</p>
{% endif %}
<p>{% trans "Website" %}:
<a href="{{ organisation.url }}" target="_blank" rel="noopener noreferrer">{{ organisation.url }}</a>
</p>
{% endif %}
</address>
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<h3 id="contact-questions">{% trans "Contact for questions" %}</h3>
<address aria-labelledby="contact-questions" class="mt-2">
<p>{{ contact.contact_name }}</p>

{% if contact.contact_address_text %}
<p>{{ contact.contact_address_text|linebreaksbr }}</p>
{% endif %}

{% if contact.contact_email %}
<p>{% trans "Email" %}:
Expand All @@ -17,6 +21,12 @@ <h3 id="contact-questions">{% trans "Contact for questions" %}</h3>
<a href="tel:{{ contact.contact_phone }}" aria-label="{% trans 'Call' %} {{ contact.contact_name }}">{{ contact.contact_phone }}</a>
</p>
{% endif %}

{% if contact.contact_url %}
<p>{% trans "Website" %}:
<a href="{{ contact.contact_url }}" target="_blank" rel="noopener noreferrer">{{ contact.contact_url }}</a>
</p>
{% endif %}
</address>
</div>
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% load i18n %}
{% load i18n ckeditor_tags %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this necessary? As far as I know, safe is built into django?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's needed so the collapsible element (accordion) renders correctly.
as a matter of fact i forgot one extra tag (disable_iframes)

@goapunk's explanation:

yes it makes the accordions (called collapsibles in our code for some reason) render correctly

so it's only needed in places the ckeditor allows adding accordions

and there's a tag for places where the ckeditor allows embeding videos called disable_iframes which prevents the videos from auto-loading and leaking data to youtube before agreeing to the video opt in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i forgot to explicitly call the collapsible on the template too 🙈

Copy link
Collaborator

Choose a reason for hiding this comment

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

that explains my confusion :D


{% block title %}
{{ project.name }} -{% trans 'Information' %}
Expand Down Expand Up @@ -38,7 +38,9 @@ <h2 id="description-title">
<span class="aural">{% trans 'Project Description' %}</span>
{{ project.name }}
</h2>
<div>{{ project.information|safe }}</div>
<div class="ck-content">
{{ project.information | transform_collapsibles | disable_iframes | safe }}
</div>
</section>

{% if project.has_contact_details or project.organisation %}
Expand Down