Skip to content

Commit

Permalink
Fix image alignment issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelmdLow committed Oct 29, 2024
1 parent 202ccb2 commit dac38cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion images/templates/images/stream_blocks/image_block.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}

{% if self.click_to_enlarge %}
{% if self.click_to_enlarge or self.style == 'default' %}
<div class="image-attachment attachment {{ self.style }} {{ self.width }} setup-modal image-modal" >
{% image self.image width-1000 format-webp as image %}
{% image self.image original as ogImage %}
<img class="article-attachment" width="{{image.width}}" height="{{image.height}}" decoding="async" data-id="{{ image.id }}" data-caption="{{ self.caption }}" data-credit="{{ self.credit }}" data-url="{{ image.url }}" src="{{ image.url }}" alt="{% if self.alt_text %}{{ self.alt_text }}{% else %}{{self.caption}}{% endif %}" />

{% if self.click_to_enlarge %}
<a class="open-modal" aria-label="Enlarge image"></a>
<dialog class="modal close-modal hide js-dropdown-container">
<div class="u-container u-container--large modal-contents">
<div class="image-modal-image" style="background-image: url('{{ogImage.url}}')"></div>
<button class="close-modal focus-on" aria-label="Minimize image"><ion-icon name="close-circle"></ion-icon></button>
</div>
</dialog>
{% endif %}

{% if self.caption or self.credit %}
<div class="caption">
Expand Down
1 change: 1 addition & 0 deletions ubyssey/static_src/src/styles/modules/article/_embeds.scss
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ div.article-content {
}

img.image-attachment {
height: auto;
shape-image-threshold: 0.7;
shape-margin: 2em;
}
Expand Down

0 comments on commit dac38cb

Please sign in to comment.