Skip to content

Conversation

@0is1
Copy link
Collaborator

@0is1 0is1 commented Oct 6, 2025

feat(lupaus): group agenda items by category and expose grouped rendering

enrich_related.py:

* Add get_category_from_agenda_item() to extract category (scheme 'categories')
* Add _group_agenda_items_by_category() to build category -> [items] mapping
* Extend (renamed) _set_stt_fields() to attach grouped_items per agenda
* Rename public helper set_stt_fields -> _set_stt_fields (now internal)
* Update enrich_planning_agendas() to call _set_stt_fields() in all paths

lupaus_events_template.html:

* Introduce render_planning_item macro to DRY per-item rendering
* Refactor loop to use agenda.grouped_items and render each category with <h2>
* Preserve existing item formatting (priority, events, coverages)
* Remove previous ungrouped inline rendering code

Result: Templates now support category-based grouping via agenda.grouped_items populated in enrichment.

===

feat(lupaus): surface main-topic priorities and show category/main sections

* Add _get_items_with_highest_priority() and attach main_topic_items to each agenda (highest numeric priority = 3300)
* Continue grouping agenda items by category via _group_agenda_items_by_category(), now stored under agenda['grouped_items']
* Template updates:
        * Introduce render_planning_item_category() and render_main_topic_item() helpers
        * Prepend each item line with a dash (“- …”) for bullet-style formatting
        * Render a new “Kärkiaiheitamme” section listing main_topic_items
        * Keep category sections (<h2>{{ category }}</h2>) with existing per-item layout

===

feat(lupaus): enrich planning with coverage status and render grouped sections

* enrich_related.py
        * Add _get_planning_item_coverage_status_from_mongo() helper to pull coverages[*].news_coverage_status (limited to g2_content_type == "teksti") from Mongo.
        * During agenda enrichment, attach the retrieved news_coverage_status dict to each planning item before priority filtering.

* lupaus_events_template.html
        * Normalize headings to uppercase (KÄRKIAIHEITAMME, category names).
        * Within each category section, group items by news_coverage_status:
                * “coverage intended” → rendered first with no extra heading.
                * “coverage not decided yet” → rendered under <h2>JOS AIHETTA</h2>.
                * Empty/other statuses → rendered under <h2>EI</h2>.

Result: Lupaus agendas now carry coverage intent metadata and surface it in the template, highlighting intended coverages and separating undecided/other items.

0is1 and others added 8 commits September 29, 2025 15:48
* Rename extraction helpers:
    * get_stturgency_from_agenda_item -> get_priority_from_agenda_item
    * get_numeric_value_from_stturgency -> get_numeric_value_from_priority
* Introduce set_stt_fields() to compute and filter planning items (centralizes related_events expansion)
* Replace _set_stt_urgency_fields with _set_priority_fields
* Agenda enrichment now calls set_stt_fields() instead of inline loops
* Rename item fields:
    * stturgency -> stt_priority
    * stturgency_numeric -> stt_priority_numeric
* Update template macro (stt_urgency_text -> stt_priority_text) and usage
…ring

enrich_related.py:

* Add get_category_from_agenda_item() to extract category (scheme 'categories')
* Add _group_agenda_items_by_category() to build category -> [items] mapping
* Extend (renamed) _set_stt_fields() to attach grouped_items per agenda
* Rename public helper set_stt_fields -> _set_stt_fields (now internal)
* Update enrich_planning_agendas() to call _set_stt_fields() in all paths

lupaus_events_template.html:

* Introduce render_planning_item macro to DRY per-item rendering
* Refactor loop to use agenda.grouped_items and render each category with <h2>
* Preserve existing item formatting (priority, events, coverages)
* Remove previous ungrouped inline rendering code

Result: Templates now support category-based grouping via agenda.grouped_items populated in enrichment.
…ctions

* Add _get_items_with_highest_priority() and attach main_topic_items to each agenda (highest numeric priority = 3300)
* Continue grouping agenda items by category via _group_agenda_items_by_category(), now stored under agenda['grouped_items']
* Template updates:
	* Introduce render_planning_item_category() and render_main_topic_item() helpers
	* Prepend each item line with a dash (“- …”) for bullet-style formatting
	* Render a new “Kärkiaiheitamme” section listing main_topic_items
	* Keep category sections (<h2>{{ category }}</h2>) with existing per-item layout
… sections

* enrich_related.py
	* Add _get_planning_item_coverage_status_from_mongo() helper to pull coverages[*].news_coverage_status (limited to g2_content_type == "teksti") from Mongo.
	* During agenda enrichment, attach the retrieved news_coverage_status dict to each planning item before priority filtering.

* lupaus_events_template.html
	* Normalize headings to uppercase (KÄRKIAIHEITAMME, category names).
	* Within each category section, group items by news_coverage_status:
		* “coverage intended” → rendered first with no extra heading.
		* “coverage not decided yet” → rendered under <h2>JOS AIHETTA</h2>.
		* Empty/other statuses → rendered under <h2>EI</h2>.

Result: Lupaus agendas now carry coverage intent metadata and surface it in the template, highlighting intended coverages and separating undecided/other items.
@petrjasek
Copy link
Member

petrjasek commented Oct 8, 2025

merged develop here to fix the tests, fyi we're switching to async version now

@petrjasek petrjasek merged commit 0a446de into develop Oct 9, 2025
25 checks passed
@petrjasek petrjasek deleted the feature/group_lupaus_agenda_items_by_category branch October 9, 2025 08:44
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