Skip to content

Commit

Permalink
Merge pull request #1007 from dimagi/cs/more_chips
Browse files Browse the repository at this point in the history
More chips 🥔
  • Loading branch information
SmittieC authored Dec 19, 2024
2 parents b147fcc + 1501ace commit 6900fbe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/experiments/views/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
from apps.files.forms import get_file_formset
from apps.files.models import File
from apps.files.views import BaseAddFileHtmxView, BaseDeleteFileView
from apps.generics.chips import Chip
from apps.service_providers.utils import get_llm_provider_choices
from apps.teams.decorators import login_and_team_required
from apps.teams.mixins import LoginAndTeamRequiredMixin
Expand Down Expand Up @@ -680,11 +681,20 @@ def single_experiment_home(request, team_slug: str, experiment_id: int):
if experiment != experiment.default_version:
deployed_version = experiment.default_version.version_number

pipeline_chip = None
assistant_chip = None
if pipeline := experiment.pipeline:
pipeline_chip = Chip(label=f"Pipeline: {pipeline.name}", url=pipeline.get_absolute_url())
elif assistant := experiment.assistant:
assistant_chip = Chip(label=f"Assistant: {assistant.name}", url=assistant.get_absolute_url())

return TemplateResponse(
request,
"experiments/single_experiment_home.html",
{
"active_tab": "experiments",
"pipeline_chip": pipeline_chip,
"assistant_chip": assistant_chip,
"experiment": experiment,
"user_sessions": user_sessions,
"platforms": available_platforms,
Expand Down
5 changes: 5 additions & 0 deletions templates/experiments/single_experiment_home.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ <h3 class="font-bold text-lg">Link with {{ platform.label }}</h3>
{% endif %}
</div>
{% endif %}
{% if pipeline_chip %}
{% include 'generic/chip.html' with chip=pipeline_chip %}
{% elif assistant_chip %}
{% include 'generic/chip.html' with chip=assistant_chip %}
{% endif %}

{% if not can_make_child_routes %}
<div class="my-4">
Expand Down

0 comments on commit 6900fbe

Please sign in to comment.