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

♿(templates) fix organization glimpse #2512

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).

### Fixed

- Fix organization glimpse card title for accessibility purposes
- Fix logic to know if user is enrolled to a ongoing product
- Normalize credit card brand on CreditCardBrandLogo component

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div
class="organization-{{ organization_variant }}{% if organization_page.publisher_is_draft is True %} organization-{{ organization_variant }}--draft{% endif %}"
>
<a href="{{ organization_page.get_absolute_url }}" title="{{ organization_page.get_title }}" property="{{ organization_property|default:'author' }}" typeof="CollegeOrUniversity">
<a href="{{ organization_page.get_absolute_url }}" title="{% blocktranslate with title=organization_page.get_title %}Link to the organization page of {{ title }}{% endblocktranslate %}" property="{{ organization_property|default:'author' }}" typeof="CollegeOrUniversity">
<meta property="url" content="{{ SITE.web_url }}{{ organization_page.get_absolute_url }}" />
{% if organization_variant == "row" %}
<div class="organization-{{ organization_variant }}__logo">
Expand Down
8 changes: 5 additions & 3 deletions tests/apps/courses/test_cms_plugins_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def test_cms_plugins_organization_render_on_public_page(self):
self.assertIn(
(
'<div class="organization-glimpse"><a href="/en/public-title/" '
'title="public title" property="author" typeof="CollegeOrUniversity">'
'title="Link to the organization page of public title" '
'property="author" typeof="CollegeOrUniversity">'
),
htmlmin.minify(
response.content.decode("UTF-8"), remove_optional_attribute_quotes=False
Expand Down Expand Up @@ -129,7 +130,7 @@ def test_cms_plugins_organization_render_on_public_page(self):
url = page.get_absolute_url(language="fr")
response = self.client.get(url)
self.assertIn(
'<a href="/fr/titre-public/" title="titre public"',
'<a href="/fr/titre-public/" title="Link to the organization page of titre public"',
re.sub(" +", " ", str(response.content).replace("\\n", "")),
)
pattern = (
Expand Down Expand Up @@ -287,7 +288,8 @@ def test_cms_plugins_organization_fallback_when_never_published(self):
self.assertIn(
(
'<div class="organization-glimpse">'
'<a href="/en/organisation-publique/" title="organisation publique" '
'<a href="/en/organisation-publique/" '
'title="Link to the organization page of organisation publique" '
'property="author" typeof="CollegeOrUniversity">'
),
htmlmin.minify(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_cms_plugins_organizations_by_category_render_on_public_page(self):
# The organization's name should be present as a link to the cms page
# And CMS page title should be in title attribute of the link
self.assertIn(
'<a href="/en/public-title/" title="public title"',
'<a href="/en/public-title/" title="Link to the organization page of public title"',
re.sub(" +", " ", str(response.content).replace("\\n", "")),
)

Expand Down Expand Up @@ -134,7 +134,7 @@ def test_cms_plugins_organizations_by_category_render_on_public_page(self):
url = page.get_absolute_url(language="fr")
response = self.client.get(url)
self.assertIn(
'<a href="/fr/titre-public/" title="titre public"',
'<a href="/fr/titre-public/" title="Link to the organization page of titre public"',
re.sub(" +", " ", str(response.content).replace("\\n", "")),
)
pattern = (
Expand Down
4 changes: 2 additions & 2 deletions tests/apps/courses/test_templates_person_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def test_templates_person_detail_cms_draft_content(self):
self.assertIn(
# pylint: disable=consider-using-f-string
'<div class="organization-glimpse">'
'<a href="{:s}" title="{:s}" '
'<a href="{:s}" title="Link to the organization page of {:s}" '
'property="author" typeof="CollegeOrUniversity">'.format(
published_organization.extended_object.get_absolute_url(),
published_organization.extended_object.get_title(),
Expand All @@ -356,7 +356,7 @@ def test_templates_person_detail_cms_draft_content(self):
# The not published organization should not be on the page
self.assertIn(
# pylint: disable=consider-using-f-string
'<a href="{:s}" title="{:s}" '
'<a href="{:s}" title="Link to the organization page of {:s}" '
'property="author" typeof="CollegeOrUniversity">'.format(
not_published_organization.extended_object.get_absolute_url(),
not_published_organization.extended_object.get_title(),
Expand Down