Skip to content

Commit

Permalink
Let AlgorithmImage provide the build status url
Browse files Browse the repository at this point in the history
  • Loading branch information
koopmant committed Nov 5, 2024
1 parent 72fa0f3 commit 4e636a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 7 additions & 0 deletions app/grandchallenge/algorithms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,13 @@ def import_status_url(self) -> str:
kwargs={"slug": self.algorithm.slug, "pk": self.pk},
)

@property
def build_status_url(self) -> str:
return reverse(
"algorithms:image-build-status-detail",
kwargs={"slug": self.algorithm.slug, "pk": self.pk},
)

@property
def api_url(self) -> str:
return reverse("api:algorithms-image-detail", kwargs={"pk": self.pk})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load url %}

<span class="badge badge-{{ object.build.status_context }}" {% if not object.build.finished %}hx-get="{% url 'algorithms:image-build-status-detail' slug=object.algorithm.slug pk=object.pk %}" hx-trigger="load delay:30s" hx-swap="outerHTML"{% endif %}>
<span class="badge badge-{{ object.build.status_context }}" {% if not object.build.finished %}hx-get="{{ object.build_status_url }}" hx-trigger="load delay:30s" hx-swap="outerHTML"{% endif %}>
{% if object.build.animate %}
<span class="spinner-border spinner-border-sm" role="status"
aria-hidden="true"></span>
Expand Down

0 comments on commit 4e636a8

Please sign in to comment.