diff --git a/home/templates/pages/moderate_parsing.html b/home/templates/pages/moderate_parsing.html index ff7d5f1..94acfdb 100644 --- a/home/templates/pages/moderate_parsing.html +++ b/home/templates/pages/moderate_parsing.html @@ -33,7 +33,7 @@

Church description by id :
{{ church_desc_by_id_json }}

Truncated html : -
+
  • Nice display
  • Raw HTML
  • diff --git a/home/templates/partials/schedules_display.html b/home/templates/partials/schedules_display.html index 10370f0..3d19306 100644 --- a/home/templates/partials/schedules_display.html +++ b/home/templates/partials/schedules_display.html @@ -1,23 +1,32 @@ {% load custom_tags %} {% load display_tags %} -
    - {% for schedule in schedules_list.schedules %} - church_id: {{ schedule.church_id }}
    - rrule: {{ schedule.rrule }}
    - duration_in_minutes: {{ schedule.duration_in_minutes }}
    - include_periods: {{ schedule.include_periods }}
    - exclude_periods: {{ schedule.exclude_periods }}
    - {% with events=schedule|get_schedule_item_events %} - {% for event in events %} -

    {% display_event event %}

    - {% endfor %} - {% endwith %} -
    - {% endfor %} - possible_by_appointment: {{ schedules_list.possible_by_appointment }}
    - is_related_to_mass: {{ schedules_list.is_related_to_mass }}
    - is_related_to_adoration: {{ schedules_list.is_related_to_adoration }}
    - is_related_to_permanence: {{ schedules_list.is_related_to_permanence }}
    - will_be_seasonal_events: {{ schedules_list.will_be_seasonal_events }}
    -
    +
    + +
    + {% for schedule in schedules_list.schedules %} + church_id: {{ schedule.church_id }}
    + rrule: {{ schedule.rrule }}
    + duration_in_minutes: {{ schedule.duration_in_minutes }}
    + include_periods: {{ schedule.include_periods }}
    + exclude_periods: {{ schedule.exclude_periods }}
    + {% with events=schedule|get_schedule_item_events %} + {% for event in events %} +

    {% display_event event %}

    + {% endfor %} + {% endwith %} +
    + {% endfor %} + possible_by_appointment: {{ schedules_list.possible_by_appointment }}
    + is_related_to_mass: {{ schedules_list.is_related_to_mass }}
    + is_related_to_adoration: {{ schedules_list.is_related_to_adoration }}
    + is_related_to_permanence: {{ schedules_list.is_related_to_permanence }}
    + will_be_seasonal_events: {{ schedules_list.will_be_seasonal_events }}
    +
    +
    +
    {{ schedules_list_json }}
    +
    +
    \ No newline at end of file diff --git a/home/templatetags/display_tags.py b/home/templatetags/display_tags.py index f532727..8dd14cc 100644 --- a/home/templatetags/display_tags.py +++ b/home/templatetags/display_tags.py @@ -61,4 +61,7 @@ def display_similar_churches_location(church: Church, sorted_similar_churches: l @register.simple_tag def display_schedules_list(schedules_list: SchedulesList): - return render_to_string('partials/schedules_display.html', {'schedules_list': schedules_list}) + return render_to_string('partials/schedules_display.html', { + 'schedules_list': schedules_list, + 'schedules_list_json': schedules_list.model_dump_json(), + }) diff --git a/scraping/parse/parse_with_llm.py b/scraping/parse/parse_with_llm.py index 32fac64..f9ac491 100644 --- a/scraping/parse/parse_with_llm.py +++ b/scraping/parse/parse_with_llm.py @@ -68,6 +68,7 @@ def get_prompt_template(): or "avant Pâques") or a precise time (e.g. "dans la matinée" or "dans la soirée"), do not return a schedule item dictionary for this event. Usually, it means some of the booleans for mass, adoration, permanence or seasonal events should be set to True. +- If the church is not explicit in the text, the church_id must be null. Here is the HTML extract to parse: {truncated_html} diff --git a/scraping/tests/fixtures/parse/llm_cache.cache b/scraping/tests/fixtures/parse/llm_cache.cache index 0b57025..26556de 100644 Binary files a/scraping/tests/fixtures/parse/llm_cache.cache and b/scraping/tests/fixtures/parse/llm_cache.cache differ diff --git a/scraping/tests/fixtures/parse/stnomdejesus.html b/scraping/tests/fixtures/parse/stnomdejesus.html new file mode 100644 index 0000000..09eed24 --- /dev/null +++ b/scraping/tests/fixtures/parse/stnomdejesus.html @@ -0,0 +1,5 @@ +Rencontrer un prêtre - Se confesser
    +Mardi
    +Samedi
    +18:00 - 19:00
    +10:00 - 12:00 \ No newline at end of file diff --git a/scraping/tests/fixtures/parse/stnomdejesus.json b/scraping/tests/fixtures/parse/stnomdejesus.json new file mode 100644 index 0000000..d95067f --- /dev/null +++ b/scraping/tests/fixtures/parse/stnomdejesus.json @@ -0,0 +1,34 @@ +{ + "input": { + "church_desc_by_id": { + "1": "Chapelle du Saint-Nom-de-J\u00e9sus Lyon", + "2": "\u00c9glise du Saint-Nom-de-J\u00e9sus Lyon" + }, + "year": 2024 + }, + "output": { + "schedules_list": { + "schedules": [ + { + "church_id": null, + "rrule": "DTSTART:20240102T180000\nRRULE:FREQ=WEEKLY;BYDAY=TU", + "duration_in_minutes": 60, + "include_periods": [], + "exclude_periods": [] + }, + { + "church_id": null, + "rrule": "DTSTART:20240106T100000\nRRULE:FREQ=WEEKLY;BYDAY=SA", + "duration_in_minutes": 120, + "include_periods": [], + "exclude_periods": [] + } + ], + "possible_by_appointment": false, + "is_related_to_mass": false, + "is_related_to_adoration": false, + "is_related_to_permanence": false, + "will_be_seasonal_events": false + } + } +} \ No newline at end of file diff --git a/scraping/tests/tests_llm_parsing.py b/scraping/tests/tests_llm_parsing.py index 74b08be..53ae068 100644 --- a/scraping/tests/tests_llm_parsing.py +++ b/scraping/tests/tests_llm_parsing.py @@ -50,6 +50,7 @@ def get_paragraphs_fixtures(): 'azergues', 'garches', 'houilles', + 'stnomdejesus', ] def test_llm_parsing(self): diff --git a/static/js/moderation.js b/static/js/moderation.js index 9aa0c0a..c1115a9 100644 --- a/static/js/moderation.js +++ b/static/js/moderation.js @@ -4,5 +4,5 @@ * Requires JQuery UI Tabs. */ $( function() { - $( ".truncated-html-tabs" ).tabs(); + $( ".moderation-tabs" ).tabs(); } ); \ No newline at end of file