Skip to content

Commit

Permalink
ISSUE-187: Fix bug where eddington is rendered for non existing activ…
Browse files Browse the repository at this point in the history
…ity types
  • Loading branch information
robiningelbrecht committed Jan 24, 2025
1 parent 3886706 commit e73d8fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
12 changes: 7 additions & 5 deletions templates/html/eddington.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
<div class="mb-4 border-b border-gray-200">
<ul class="flex flex-wrap -mb-px text-sm font-medium text-center" id="activityTypeTab" data-tabs-toggle="#activityTypeTabContent" role="tablist">
{% for activityType in activityTypes %}
<li class="mr-2" role="presentation">
<a href="#eddington" data-tabs-target="#{{ activityType.value }}" role="tab" aria-controls="{{ activityType.value }}" class="inline-flex items-center justify-center p-2 border-b-2 rounded-t-lg hover:text-gray-600 hover:border-gray-300 aria-selected:text-strava-orange aria-selected:border-strava-orange group">
{{ activityType|trans }} ({{ eddingtons[activityType.value].getNumber() }})
</a>
</li>
{% if eddingtons[activityType.value] is defined %}
<li class="mr-2" role="presentation">
<a href="#eddington" data-tabs-target="#{{ activityType.value }}" role="tab" aria-controls="{{ activityType.value }}" class="inline-flex items-center justify-center p-2 border-b-2 rounded-t-lg hover:text-gray-600 hover:border-gray-300 aria-selected:text-strava-orange aria-selected:border-strava-orange group">
{{ activityType|trans }} ({{ eddingtons[activityType.value].getNumber() }})
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
<div class="p-4 bg-white border border-gray-200 rounded-lg shadow-sm sm:p-6">
<div class="mb-4 border-b border-gray-200">
<ul class="flex flex-wrap -mb-px text-sm font-medium text-center" id="activityTypeTab" data-tabs-toggle="#activityTypeTabContent" role="tablist">
<li class="mr-2" role="presentation">
<a href="#eddington" data-tabs-target="#Ride" role="tab" aria-controls="Ride" class="inline-flex items-center justify-center p-2 border-b-2 rounded-t-lg hover:text-gray-600 hover:border-gray-300 aria-selected:text-strava-orange aria-selected:border-strava-orange group">
Rides (6)
</a>
</li>
<li class="mr-2" role="presentation">
<a href="#eddington" data-tabs-target="#Run" role="tab" aria-controls="Run" class="inline-flex items-center justify-center p-2 border-b-2 rounded-t-lg hover:text-gray-600 hover:border-gray-300 aria-selected:text-strava-orange aria-selected:border-strava-orange group">
Runs (1)
</a>
</li>
</ul>
<li class="mr-2" role="presentation">
<a href="#eddington" data-tabs-target="#Ride" role="tab" aria-controls="Ride" class="inline-flex items-center justify-center p-2 border-b-2 rounded-t-lg hover:text-gray-600 hover:border-gray-300 aria-selected:text-strava-orange aria-selected:border-strava-orange group">
Rides (6)
</a>
</li>
<li class="mr-2" role="presentation">
<a href="#eddington" data-tabs-target="#Run" role="tab" aria-controls="Run" class="inline-flex items-center justify-center p-2 border-b-2 rounded-t-lg hover:text-gray-600 hover:border-gray-300 aria-selected:text-strava-orange aria-selected:border-strava-orange group">
Runs (1)
</a>
</li>
</ul>
</div>
<div id="activityTypeTabContent">
<div id="Ride" role="tabpanel" aria-labelledby="Ride-tab">
Expand Down
Binary file modified tests/strava.db
Binary file not shown.

0 comments on commit e73d8fb

Please sign in to comment.