mirror of
https://github.com/vinta/awesome-python.git
synced 2026-11-10 01:34:28 -06:00
On phones the label under each project name showed its subcategory, and names like "General", "Synchronous", or "Core" only make sense under their category heading, so the home and group tables showed vague labels. Co-Authored-By: Claude <noreply@anthropic.com>
134 lines
5.7 KiB
HTML
134 lines
5.7 KiB
HTML
{% macro entry_rows(entry, index, home=false) %}
|
|
{# On section and subcategory pages the group heading already names the row's use case #}
|
|
{% set grouped_page = entry_groups and not group_categories %}
|
|
{% set section_path = "/categories/" ~ parent_category.slug ~ "/" if parent_category else current_path %}
|
|
<tr
|
|
class="row"
|
|
{% if not home and not group_categories %}id="entry-{{ entry.name | slugify }}"{% endif %}
|
|
tabindex="0"
|
|
aria-expanded="false"
|
|
aria-controls="expand-{{ index }}"
|
|
>
|
|
<td class="col-num">{{ index }}</td>
|
|
<td class="col-name">
|
|
<a href="{{ entry.url }}" target="_blank" rel="noopener"
|
|
>{{ entry.name }}</a
|
|
>
|
|
<span class="mobile-cat{% if grouped_page and (not entry.subcategories or category_urls[entry.subcategories[0].value.split(' > ')[0]] == section_path) %} repeats-heading{% endif %}"
|
|
>{% if entry.subcategories %}{{ entry.subcategories[0].value.split(' > ')[0] }}{%
|
|
else %}{{ entry.categories[0] if home else category.name }}{% endif %}</span
|
|
>
|
|
</td>
|
|
<td class="col-downloads">
|
|
{% if entry.downloads is not none %}{{
|
|
"{:,}".format(entry.downloads) }}{% elif entry.source_type ==
|
|
'Stdlib' %}<span class="source-badge">Stdlib</span>{% elif
|
|
entry.bundled %}<span class="source-badge">Bundled</span>{% elif
|
|
entry.badge %}<span class="source-badge">{{ entry.badge }}</span>{%
|
|
else %}<span class="source-badge">Not on PyPI</span>{% endif %}
|
|
</td>
|
|
<td class="col-stars">
|
|
{% if entry.stars is not none %}{{ "{:,}".format(entry.stars) }}{%
|
|
elif entry.source_type %}<span class="source-badge"
|
|
>{{ entry.source_type }}</span
|
|
>{% else %}—{% endif %}
|
|
</td>
|
|
<td
|
|
class="col-commit"
|
|
{%
|
|
if
|
|
entry.last_commit_at
|
|
%}data-commit="{{ entry.last_commit_at }}"
|
|
{%
|
|
endif
|
|
%}
|
|
>
|
|
{% if entry.last_commit_at %}<time
|
|
datetime="{{ entry.last_commit_at }}"
|
|
>{{ entry.last_commit_at[:10] }}</time
|
|
>{% else %}—{% endif %}
|
|
</td>
|
|
<td class="col-cat">
|
|
{% for subcat in entry.subcategories %}
|
|
<a class="tag{% if subcat.url == current_path %} active{% endif %}{% if grouped_page and category_urls[subcat.value.split(' > ')[0]] == section_path %} repeats-heading{% endif %}" href="{{ category_urls[subcat.value.split(' > ')[0]] }}#{{ subcat.slug }}">
|
|
{{ subcat.name }}
|
|
</a>
|
|
{% endfor %}
|
|
{% for cat in entry.categories %}
|
|
<a
|
|
class="tag{% if category_urls[cat] == current_path %} active{% endif %}{% if grouped_page and category_urls[cat] == current_path %} repeats-heading{% endif %}"
|
|
href="{{ category_urls[cat] }}"
|
|
>{{ cat }}</a
|
|
>
|
|
{% endfor %}
|
|
{% if entry.groups %}
|
|
{% set group_url = filter_urls[entry.groups[0]] %}
|
|
<a
|
|
class="tag tag-group{% if group_url == current_path %} active{% endif %}"
|
|
href="{{ group_url }}"
|
|
>
|
|
{{ entry.groups[0] }}
|
|
</a>
|
|
{% endif %}
|
|
{% if entry.source_type == 'Stdlib' %}
|
|
<a
|
|
class="tag tag-source{% if '/categories/built-in/' == current_path %} active{% endif %}"
|
|
href="/categories/built-in/"
|
|
>
|
|
Stdlib
|
|
</a>
|
|
{% endif %}
|
|
</td>
|
|
<td class="col-arrow"><span class="arrow" aria-hidden="true">→</span></td>
|
|
</tr>
|
|
{% if entry.description %}
|
|
<tr class="desc-row"{% if home %} hidden{% endif %}>
|
|
<td class="col-num"></td>
|
|
<td colspan="6">
|
|
<div class="desc-text">{{ entry.description | safe }}</div>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
<tr class="expand-row" id="expand-{{ index }}">
|
|
<td></td>
|
|
<td colspan="5">
|
|
<div class="expand-content">
|
|
{% if entry.also_see %}
|
|
<div class="expand-also-see">
|
|
Also see: {% for see in entry.also_see %}<a
|
|
href="{{ see.url }}"
|
|
target="_blank"
|
|
rel="noopener"
|
|
>{{ see.name }}</a
|
|
>{% if not loop.last %}, {% endif %}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
<div class="expand-meta">
|
|
{% if entry.owner %}<a
|
|
href="https://github.com/{{ entry.owner }}"
|
|
target="_blank"
|
|
rel="noopener"
|
|
>{{ entry.owner }}</a
|
|
><span class="expand-sep">/</span>{% endif %}<a
|
|
href="{{ entry.url }}"
|
|
target="_blank"
|
|
rel="noopener"
|
|
>{{ entry.url | replace("https://", "") }}</a
|
|
>
|
|
{% if entry.stars is not none %}<span
|
|
class="expand-stars"
|
|
><span class="expand-sep">/</span>{{
|
|
"{:,}".format(entry.stars) }} stars</span
|
|
>{% endif %} {% if entry.last_commit_at %}<span class="expand-commit"
|
|
><span class="expand-sep">/</span
|
|
><time datetime="{{ entry.last_commit_at }}"
|
|
>{{ entry.last_commit_at[:10] }}</time
|
|
></span
|
|
>{% endif %}
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
{% endmacro %}
|