Skip to content

Commit

Permalink
Allow extra attributes on LabsSchema pydantic model
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Dec 10, 2024
1 parent efa4973 commit 46d6d39
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/labs/lab_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ def validate_md(cls, value):
class LabSectionSchema(BaseModel):
"""Validate Galaxy Lab section."""
id: str
title: str
tabs: list[SectionTab]


class LabSchema(BaseModel):
class LabSchema(BaseModel, extra='allow'):
"""Validate Galaxy Lab content."""
site_name: str
lab_name: str
Expand Down
2 changes: 1 addition & 1 deletion app/labs/templates/labs/components/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 class="accordion-header" id="{{ section.id }}-{{ tab_id }}-{{ forloop.counte
<div class="col">
{{ item.description_md|markdown }}
{% if item.inputs %}
{% include 'labs//components/inputs.html' with inputs=item.inputs %}
{% include 'labs/components/inputs.html' with inputs=item.inputs %}
{% endif %}
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/labs/templates/labs/components/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ <h4 class="mb-3">{{ section.title }}</h4>
{% if tab.content.subsections %}
{% for subsection in tab.content.subsections %}
<p class="fw-bold my-3 mt-4 mx-3">{{ subsection.title }}</p>
{% include 'labs//components/accordion.html' with content=subsection.content tab_id=tab.id accordion_id=subsection.id %}
{% include 'labs/components/accordion.html' with content=subsection.content tab_id=tab.id accordion_id=subsection.id %}
{% endfor %}
{% else %}
{% include 'labs//components/accordion.html' with content=tab.content tab_id=tab.id %}
{% include 'labs/components/accordion.html' with content=tab.content tab_id=tab.id %}
{% endif %}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/labs/templates/labs/exported.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<main>

{% include 'labs//components/gtn-modal.html' %}
{% include 'labs/components/gtn-modal.html' %}

<section id="headerSection" class="lab-header d-flex align-items-center h-100">
{% if snippets.header_logo %}
Expand All @@ -41,22 +41,22 @@
{% endif %}

{% for section in sections %}
{% include 'labs//components/section.html' with section=section %}
{% include 'labs/components/section.html' with section=section %}
{% endfor %}

{% if snippets.conclusion_md %}
{{ snippets.conclusion_md|markdown }}
{% endif %}

{% if contributors %}
{% include 'labs//components/contributors.html' %}
{% include 'labs/components/contributors.html' %}
{% endif %}

</main>


{% if feedback_email %}
{% include 'labs//components/feedback-modal.html' %}
{% include 'labs/components/feedback-modal.html' %}
{% endif %}


Expand Down

0 comments on commit 46d6d39

Please sign in to comment.