Skip to content

Commit 41b59dd

Browse files
authored
patch data explorer entries context 🪡 (#1023)
1 parent 1d8e153 commit 41b59dd

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/simmate/website/data_explorer/components/table_component.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ def get_submission_redirect(self):
362362

363363
# -------------------------------------------------------------------------
364364

365+
def get_context(self):
366+
context = super().get_context()
367+
if self.entries is not None:
368+
context["entries"] = self.entries
369+
return context
370+
365371
@classmethod
366372
def get_extra_table_context(cls, request) -> dict:
367373
return {} # default to nothing extra

src/simmate/website/data_explorer/templates/data_explorer/entries.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "htmx/form_base.html" %}
22
{% block form %}
3-
{% if component.entries %}
3+
{% if entries %}
44
{% block search_results_table %}
55
{% if component.report %}
66
<div id="search_results_report">
@@ -58,7 +58,7 @@
5858
</tr>
5959
</thead>
6060
<tbody>
61-
{% for entry in component.entries %}
61+
{% for entry in entries %}
6262
<tr>
6363
{% if component.enable_select %}
6464
<td>
@@ -87,7 +87,9 @@
8787
</div>
8888
</form>
8989
{% endblock %}
90-
{% include "data_explorer/pagination.html" with page=component.page pagination_urls=component.pagination_urls %}
90+
{% if component.page %}
91+
{% include "data_explorer/pagination.html" with page=component.page pagination_urls=component.pagination_urls %}
92+
{% endif %}
9193
{% else %}
9294
<div class="alert alert-danger d-flex align-items-center p-2" role="alert">
9395
<div>

0 commit comments

Comments
 (0)