Fix/event date email - #273
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates report/email templates and related localization/fixtures to improve priority/TLP visual presentation, add dark-mode signaling, and clarify event timestamp display (event date vs creation date).
Changes:
- Updated priority fixture colors to distinct values for clearer differentiation.
- Added email dark-mode meta tags and CSS overrides, and adjusted header styling for priority/TLP pills.
- Updated the basic event report to display either “Event Date” or “Event creation date”, plus added the Spanish translation entry.
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 |
|---|---|
| ngen/templates/reports/email.css | Adds prefers-color-scheme handling for email rendering. |
| ngen/templates/reports/basic_event_report.html | Shows event date if present, otherwise creation date (with translated label). |
| ngen/templates/reports/base_header_right.html | Improves priority/TLP pill readability with a black background. |
| ngen/templates/reports/base_head.html | Adds color-scheme meta tags for better dark-mode behavior in email clients. |
| ngen/locale/es/LC_MESSAGES/django.po | Adds Spanish translation for “Event creation date”. |
| ngen/fixtures/priority.json | Updates priority color values to non-white, distinct colors. |
Suppressed comments (1)
ngen/templates/reports/basic_event_report.html:31
- The Notes section opens a tag but never closes it, and the
{% endif %}is currently placed inside the<small>block. This produces invalid HTML and can lead to inconsistent rendering in email clients.
{% if event.notes %}
<small class="lead"><strong>{% translate 'Notes' %}:</strong>
<div style="word-wrap: break-word;">{{ event.notes | render_report_content:event }}</div>
<br>
{% endif %}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements focused on visual consistency, accessibility, and localization in reports and notification templates. The main changes include updating priority color codes, enhancing support for dark mode, improving the display of priority and TLP levels, and refining event date handling and translations.
Visual and Theming Improvements:
colorvalues for different priority levels inpriority.jsonto use distinct, meaningful colors instead of white, improving clarity and visual differentiation. [1] [2] [3] [4]base_head.htmland CSS rules toemail.cssto support light/dark color schemes, ensuring better appearance in dark mode and consistent background for headers. [1] [2]Report Header and Display Enhancements:
base_header_right.htmlto display priority and TLP levels with a black background and the specified color for improved readability and emphasis.Localization and Event Date Handling: