Skip to content

Commit

Permalink
Add child interests to the rendering process
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Dec 12, 2024
1 parent 5105e99 commit fd4cdf4
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions pyscraper/regmem/commons/api_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,34 @@ def multi_to_camel(value: str) -> AliasChoices:

interest_template = Template(
"""
<p class="interest-summary">{{ interest.summary|e }}</p>
<ul class="interest-details-list">
{% for field in interest.present_fields() %}
{{field.to_html()}}
{% endfor %}
{% if interest.registration_date %}
<li class="registration-date">Registration Date: {{ interest.registration_date.strftime('%d %B %Y') }}</li>
{% endif %}
{% if interest.published_date %}
<li class="published-date">Published Date: {{ interest.published_date.strftime('%d %B %Y') }}</li>
{% endif %}
{% if interest.last_updated_date %}
<li class="last-updated-date">Last Updated Date: {{ interest.last_updated_date.strftime('%d %B %Y') }}</li>
<div class="interest-item" id="{{ interest.id }}">
<p class="interest-summary parent-interest-item">{{ interest.summary|e }}</p>
<ul class="interest-details-list">
{% for field in interest.present_fields() %}
{{field.to_html()}}
{% endfor %}
{% if interest.registration_date %}
<li class="registration-date">Registration Date: {{ interest.registration_date.strftime('%d %B %Y') }}</li>
{% endif %}
{% if interest.published_date %}
<li class="published-date">Published Date: {{ interest.published_date.strftime('%d %B %Y') }}</li>
{% endif %}
{% if interest.last_updated_date %}
<li class="last-updated-date">Last Updated Date: {{ interest.last_updated_date.strftime('%d %B %Y') }}</li>
{% endif %}
</ul>
{% if interest.child_items %}
<p class="child-item-header">Specific work or payments</p>
<div class="interest-child-items" id="parent-{{ interest.id }}">
{% for child in interest.child_items %}
{{child.to_html()}}
{% endfor %}
</div>
{% endif %}
</ul>
</div>
"""
)
Expand Down

0 comments on commit fd4cdf4

Please sign in to comment.