Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion assets/styles/_screens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,28 @@
}

.ranking {
// caption and the link into the chart share one line: what the ranking sorts by on the left, the
// way to see it drawn on the right end of it
&__intro {
display: flex;
flex-wrap: wrap;
gap: var(--space-3) var(--space-5);
align-items: baseline;
justify-content: space-between;
margin: var(--space-4) 0 var(--space-5);
}

&__caption {
max-width: 70ch;
margin: var(--space-4) 0 var(--space-5);
margin: 0;
font-size: var(--text-sm);
color: var(--text-muted);
}

&__chart {
flex: 0 0 auto;
}

&[hidden] {
display: none;
}
Expand Down
18 changes: 14 additions & 4 deletions templates/start.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@
<div class="eyebrow">Rankings</div>
<h2 data-rankings-target="title">{{ rankings|first.ranking.title }}</h2>
</div>
{% if hasData %}
<a href="{{ path('chart') }}" class="btn btn--secondary">Open the chart</a>
{% endif %}
</div>

{% if hasData %}
Expand All @@ -246,7 +243,20 @@
<div class="ranking" role="tabpanel" id="ranking-{{ entry.ranking.value }}"
aria-labelledby="tab-{{ entry.ranking.value }}"
data-rankings-target="panel" {{ not loop.first ? 'hidden' }}>
<p class="ranking__caption">{{ entry.ranking.caption }}</p>
{#
# The chart opens on what is being read, so the link belongs to the ranking
# rather than to the section above it: every panel carries its own, drawn
# with its own top repositories, and only the visible one can be clicked.
#}
<div class="ranking__intro">
<p class="ranking__caption">{{ entry.ranking.caption }}</p>
{% if entry.repositories is not empty %}
<a class="btn btn--secondary ranking__chart"
href="{{ path('chart', {'repositories': entry.repositories|slice(0, chartLimit)|map(repository => repository.name)|join(',')}) }}">
Open the chart
</a>
{% endif %}
</div>
{#
# A ranking can come out empty although the report has data - nothing
# increased within the last twelve months is a result, not a broken page.
Expand Down