feat: add gravatar configuration to cfp settings#2128
feat: add gravatar configuration to cfp settings#2128sarafarajnasardi wants to merge 13 commits intofossasia:devfrom
Conversation
There was a problem hiding this comment.
Sorry @sarafarajnasardi, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
There was a problem hiding this comment.
Pull request overview
This PR introduces an event-level setting to enable or disable Gravatar usage for speaker profile pictures in the CfP flow, and wires it through the admin UI, forms, and templates so organisers can control whether Gravatar is offered.
Changes:
- Added a
cfp_enable_gravatarsetting onCfP(with anenable_gravatarproperty) and surfaced it viaCfPSettingsFormand the organiser “Speaker Information” settings table, including a dedicated toggle in the “Profile picture” row. - Updated
SpeakerProfileFormand the avatar template to respect the new setting by conditionally showing the Gravatar checkbox, adjusting the “required avatar” validation message, and fixing avatar preview visibility and fallbacksrclogic when only Gravatar is used. - Tightened the question toggle JavaScript to only attach AJAX handlers to elements that carry
data-question-id, and added a defensive guard in the form-page toggle handler to avoid errors when related elements are missing.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
app/eventyay/base/models/cfp.py |
Adds cfp_enable_gravatar to the default CfP settings and a new enable_gravatar property that drives the rest of the Gravatar feature, defaulting to enabled for existing and new events. |
app/eventyay/orga/forms/cfp.py |
Extends CfPSettingsForm with a cfp_enable_gravatar BooleanField, initialised from CfP.enable_gravatar, and persists it into cfp.settings during save. |
app/eventyay/orga/templates/orga/cfp/forms.html |
Adds a “Settings” column to proposal and speaker information tables and inserts a toggle-style checkbox for cfp_enable_gravatar in the “Profile picture” row. |
app/eventyay/person/forms/profile.py |
Makes the speaker profile form drop the get_gravatar field when Gravatar is disabled and adjusts the avatar-required validation message based on cfp.enable_gravatar. |
app/eventyay/common/templates/common/avatar.html |
Conditionally renders the Gravatar checkbox and preview based on request.event.cfp.enable_gravatar, and updates the preview visibility and img src fallback logic for Gravatar-only avatars. |
app/eventyay/static/orga/js/questionToggles.js |
Restricts AJAX toggle handlers to elements with data-question-id and adds a null-check guard in the form-page toggle logic to avoid accessing missing hidden inputs or dropdowns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mariobehling
left a comment
There was a problem hiding this comment.
Looks good, but we also need a description text in front of the toggle. Please add "Enable Gravatar".
6c40edc to
822d883
Compare
|
@mariobehling Test coverage added for enable_gravatar property. |
Replace direct user.avatar.url access with avatar_url property for cleaner code while preserving gravatar functionality. Signed-off-by: Sara Faraj <sarafaraj@users.noreply.github.com>
9ec3600 to
7fc0439
Compare
mariobehling
left a comment
There was a problem hiding this comment.
Please resolve conflicts.
105164f to
9e756f1
Compare
|
@mariobehling I have resolved all the conflicts... |
| <td class="text-center"> | ||
| <span class="mr-1">{% translate "Enable Gravatar" %}</span> | ||
| <label class="toggle-switch" aria-label="{% translate "Enable Gravatar" %}"> | ||
| {{ sform.cfp_enable_gravatar }} | ||
| <span class="toggle-slider"></span> |
ArnavBallinCode
left a comment
There was a problem hiding this comment.
Please address the above requested changes.
mariobehling
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I reviewed the diff in detail. The overall feature makes sense, and the main Gravatar setting flow across model, organiser form, speaker form, and avatar template looks good.
Before merge, please tighten the scope of this PR. The changes in questionToggles.js and the broader tests/talk/conftest.py refactor do not appear to be directly related to the Gravatar feature and make the review harder. Please move those into separate PRs unless they are strictly required here.
In addition, please help us keep the contribution process efficient:
- Avoid long running PRs. They become harder to review and manage over time and slow down the overall PR queue.
- Focus on finishing and getting existing PRs merged before opening new ones.
- As a guideline, contributors should typically not have more than 3 open PRs at the same time.
Signed-off-by: Sarafaraj Nasardi <sarafarajnasardi786@gmail.com>
|
Thank you for review and giving feedback. I have done the changes which you told and also made PR more clean. I will keep in mind to not add extra things in PR next time. Please tell if anything more is needed from my side... |
- Implemented professional 9-column layout for Speaker Information table - Added explicit column widths for robust alignment - Restored 'Enable Gravatar' label text for better clarity - Refactored fav-button.js to replace unsafe innerHTML with safe DOM manipulation Signed-off-by: Sarafaraj Nasardi <sarafarajnasardi786@gmail.com>

Description
Implemented a new setting to enable/disable Gravatar support for speaker profile pictures in the Call for Participation (CfP) flow. This allows organizers to control whether speakers can retrieve their avatars via Gravatar.
Changes
Backend: Added
cfp_enable_gravatarsetting to theCfPmodel and updated the speaker profile form to respect it.Organizer UI: Added a
Settingscolumn to theCfPconfiguration table with a toggle to enable/disable Gravatar.Speaker UI: Updated the avatar template to conditionally render Gravatar options and fixed the preview visibility logic.
fixes #2119
Screencast.From.2026-01-26.18-07-12.mp4