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

News image description #401

Merged
merged 10 commits into from
Jan 7, 2022
Merged

News image description #401

merged 10 commits into from
Jan 7, 2022

Conversation

ddabble
Copy link
Member

@ddabble ddabble commented Jan 7, 2022

This adds an image_description field to articles and events (which is inserted into the alt attribute of the <img> tags), which is useful for people using screen readers. It's also useful if the images don't load (for whatever reason), in which case the image description will be displayed instead.

Additionally, a few minor changes:

This mainly happens when registering for an event while developing on a personal machine.
Previously, on the deployment server, the requests were always marked as insecure, resulting in e.g. `request.scheme` being "http".

This was motivated by Facebook not showing the image of an article that was embedded in a post
(https://www.facebook.com/MAKENTNU/posts/701447270512461), which was (most likely) caused by the `og:image` meta tag
(in the `<head>` tag of `base.html`) specifying an image URL with "http" instead of "https" (because of `request.scheme`, as mentioned above).
Copy link
Member

@Maisergodt Maisergodt left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@ddabble
Copy link
Member Author

ddabble commented Jan 7, 2022

(originally posted on #400 by mistake 😅)

These tests should also succeed after #400 has been merged 🤠

@codecov
Copy link

codecov bot commented Jan 7, 2022

Codecov Report

Merging #401 (272e5db) into dev (630d737) will decrease coverage by 0.02%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #401      +/-   ##
==========================================
- Coverage   82.74%   82.72%   -0.03%     
==========================================
  Files         117      117              
  Lines        4150     4161      +11     
==========================================
+ Hits         3434     3442       +8     
- Misses        716      719       +3     
Impacted Files Coverage Δ
news/admin.py 65.41% <0.00%> (ø)
news/views.py 87.54% <20.00%> (-0.94%) ⬇️
news/models.py 94.83% <80.00%> (+0.13%) ⬆️
util/templatetags/uri_tags.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 630d737...272e5db. Read the comment docs.

@ddabble ddabble merged commit 36be120 into dev Jan 7, 2022
@ddabble ddabble deleted the feature/news-image-description branch January 7, 2022 19:32
@ddabble ddabble mentioned this pull request Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants