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

Single Image Block #50

Merged
merged 7 commits into from
Nov 23, 2022
Merged

Single Image Block #50

merged 7 commits into from
Nov 23, 2022

Conversation

conatus
Copy link
Collaborator

@conatus conatus commented Nov 21, 2022

Add a simple single image block, as found in the Figma designs.

Description

Implements a block with a single image and a caption. As seen on the Disasters and Climate Resilence Impact Area page.

How Can It Be Tested?

  1. Create an article page.
  2. Add the image block to the mix.
  3. Add your image, caption and credit.
  4. Save and publish the page.

Screenshots (if appropriate):

Sizzy-Desktop localhost 21Nov 16 33

Sizzy-iPhone 8 localhost 21Nov 16 36

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I've checked the spec (e.g. Figma file) and documented any divergences.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I've updated the documentation accordingly.
  • Replace unused checkboxes with bullet points.

@linear
Copy link

linear bot commented Nov 21, 2022

HOT-222

@conatus conatus changed the title Feature/hot 222 single image block Single Image Block Nov 21, 2022
@conatus conatus self-assigned this Nov 21, 2022
@conatus conatus marked this pull request as ready for review November 21, 2022 16:39
@conatus conatus mentioned this pull request Nov 22, 2022
3 tasks
@conatus conatus requested a review from janbaykara November 22, 2022 09:19
app/templates/app/blocks/image_block.html Show resolved Hide resolved
icon = "fa fa-picture-o"

image = ImageChooserBlock(required=True)
caption = blocks.CharBlock(required=False)
credit = blocks.CharBlock(required=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We already have an attribution property on the image model. It seems fitting to use the database-level credits, rather than have to re-input credit each time an image is used. The editor may not know, and in any case will have to enter credits when they upload the image.

So delete this line, and then use value.image.attribution in the template below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool. I didn't know that. Thanks.

@janbaykara
Copy link
Collaborator

janbaykara commented Nov 23, 2022

@conatus I think we should fix the attribution thing, then merge this in and revisit the comments later.

@conatus
Copy link
Collaborator Author

conatus commented Nov 23, 2022

@janbaykara

Fixed. Merge if you check and all good.

@conatus conatus merged commit d1a3993 into main Nov 23, 2022
@conatus conatus deleted the feature/hot-222-single-image-block branch November 23, 2022 16:08
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.

3 participants