Skip to content

Conversation

Saksham-Sirohi
Copy link
Contributor

@Saksham-Sirohi Saksham-Sirohi commented Jun 9, 2025

Fixes fossasia/eventyay-tickets#1001

Summary by Sourcery

Refactor header image handling by centralizing markup in a template include and adding CSS for consistent styling, fixing display issues (#134).

Bug Fixes:

  • Fix header image display issues (#134)

Enhancements:

  • Extract header image markup into common/includes/header.html and update base and invitation templates to include it
  • Add CSS styling for #header-img wrapper and header-image element for consistent sizing, border-radius, and object-fit behavior

Copy link

sourcery-ai bot commented Jun 9, 2025

Reviewer's Guide

Consolidate header image rendering by extracting its markup into a reusable include, updating the base and invitation templates to leverage it, and adding corresponding CSS for consistent styling.

Class diagram for header image template refactor

classDiagram
    class base.html {
        - (removed) header image markup
        + includes header.html
    }
    class invitation.html {
        + includes header.html
    }
    class header.html {
        + renders header image if present
    }
    base.html --> header.html : includes
    invitation.html --> header.html : includes
Loading

File-Level Changes

Change Details Files
Create shared header image include
  • Added include template with conditional header-image markup
src/pretalx/common/templates/common/includes/header.html
Apply shared header include in base layout
  • Removed inline header-image conditional and img tag
  • Inserted include call in base.html header container
src/pretalx/common/templates/common/base.html
Apply shared header include in invitation page
  • Wrapped include call in a #header-img div in invitation.html
src/pretalx/cfp/templates/cfp/event/invitation.html
Add styling for header image container and img
  • Defined #header-img padding and image block display
  • Set img dimensions, border-radius, and object-fit properties
src/pretalx/static/cfp/css/_layout.css

Assessment against linked issues

Issue Objective Addressed Explanation
fossasia/eventyay-tickets#1001 The 'Accept Invitation' screen should display the header image.

Possibly linked issues

  • #134: The PR refactors header image display and applies the fix to the invitation screen, resolving the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Saksham-Sirohi - I've reviewed your changes - here's some feedback:

  • Consider extracting the header block into a reusable include or template tag so you don’t duplicate the same markup in multiple views.
  • Add loading="lazy" (or another lazy-loading mechanism) to the <img> to prevent blocking render on large header images.
  • Double-check that all header_pattern classes you’re applying in display_settings exist in the stylesheet to avoid unexpected styling.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Saksham-Sirohi Saksham-Sirohi force-pushed the invitation-header-fix branch 2 times, most recently from 0efde7a to 1ac3d8b Compare June 17, 2025 12:28
@Saksham-Sirohi Saksham-Sirohi requested a review from norbusan June 17, 2025 12:30
@mariobehling mariobehling requested a review from hongquan June 17, 2025 14:52
@Gagan-Ram
Copy link
Member

@Saksham-Sirohi Could you please add screenshots

@hpdang
Copy link
Member

hpdang commented Jun 19, 2025

@Saksham-Sirohi please respond to reviewer's request, thanks

@Saksham-Sirohi
Copy link
Contributor Author

image (1)

@Saksham-Sirohi Saksham-Sirohi force-pushed the invitation-header-fix branch from 1ac3d8b to 1d7e54d Compare June 19, 2025 11:17
@Saksham-Sirohi Saksham-Sirohi marked this pull request as draft June 19, 2025 13:45
@Saksham-Sirohi Saksham-Sirohi marked this pull request as ready for review June 19, 2025 18:27
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Saksham-Sirohi - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Gagan-Ram
Copy link
Member

@Saksham-Sirohi Please share full page screenshot (with url) as this would help reviewers to get more context on what pages to look (for UI changes).
I got an error page when I tried to reproduce the page. I wonder whether we are properly aligned with the issue.

@Saksham-Sirohi Saksham-Sirohi marked this pull request as draft June 20, 2025 10:59
@Saksham-Sirohi
Copy link
Contributor Author

Screenshot 2025-06-20 at 5 43 33 PM

hi @Gagan-Ram in order to test, you will need a public event to test it on or edit your user.py file in cfp/views to allow non-public events

@Saksham-Sirohi Saksham-Sirohi marked this pull request as ready for review June 20, 2025 12:17
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Saksham-Sirohi - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/pretalx/static/cfp/css/_layout.css:22` </location>
<code_context>
 }
+#header-img{
+  padding: 10px;
+  img{
+  width: 100%;
+  height: 240px;
</code_context>

<issue_to_address>
Nesting CSS selectors is not standard in plain CSS.

The nested 'img' selector will not work in plain CSS. Use '#header-img img { ... }' instead for compatibility.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Saksham-Sirohi Saksham-Sirohi force-pushed the invitation-header-fix branch from 8ca6266 to 93eacb0 Compare June 20, 2025 12:20
@Saksham-Sirohi Saksham-Sirohi force-pushed the invitation-header-fix branch from 93eacb0 to 4acbb0f Compare June 20, 2025 12:25
@Saksham-Sirohi
Copy link
Contributor Author

2025-06-28.19-05-04.mov

@Saksham-Sirohi
Copy link
Contributor Author

rebase successful please take a look

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.

Acceptance screen not showing header image

4 participants