mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
cleanup, add macro render_communityname
This commit is contained in:
parent
e153b177a0
commit
4c0eb87c25
11 changed files with 23 additions and 27 deletions
|
@ -31,9 +31,7 @@
|
|||
{% for community in communities.items %}
|
||||
<tr>
|
||||
<td><a href="/c/{{ community.link() }}">{{ community.name }}</a></td>
|
||||
<td><a href="/c/{{ community.link() }}">
|
||||
<img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ community.display_name() }}{% if community.banned %} (banned){% endif %}</a></td>
|
||||
<td>{{ render_communityname(community) }}{% if community.banned %} (banned){% endif %}</td>
|
||||
<td>{{ community.topic.name }}</td>
|
||||
<td>{{ community.post_count }}</td>
|
||||
<th>{{ '✓'|safe if community.show_home else '✗'|safe }}</th>
|
||||
|
@ -67,4 +65,4 @@
|
|||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -26,6 +26,16 @@
|
|||
{% endif -%}
|
||||
</span>
|
||||
{% endmacro -%}
|
||||
{% macro render_communityname(community) -%}
|
||||
<span class="render_community">
|
||||
<a href="/c/{{ community.link() }}" aria-label="{{ _('Go to community %(name)s', name=community.name) }}">
|
||||
{% if community.icon_id and not low_bandwidth and not collapsed -%}
|
||||
<img src="{{ community.icon_image() }}" class="community_icon rounded-circle" alt="" loading="lazy" />
|
||||
{% endif -%}
|
||||
c/{{ community.display_name() }}
|
||||
</a>
|
||||
</span>
|
||||
{% endmacro -%}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
<div class="card-title">{{ _('Found a community:') }}</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
<a href="/c/{{ new_community.link() }}"><img src="{{ new_community.icon_image()}}" class="community_icon rounded-circle" style="width: 30px; vertical-align: middle;" /></a>
|
||||
<a href="/c/{{ new_community.link() }}">{{ new_community.title }}@{{ new_community.ap_domain }}</a>
|
||||
{{ render_communityname(new_community) }}
|
||||
</p>
|
||||
<p> {% if subscribed %}
|
||||
<a class="btn btn-primary mt-4" href="/community/{{ new_community.link() }}/unsubscribe">{{ _('Leave') }}</a>
|
||||
|
|
|
@ -170,9 +170,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
{% for community in related_communities -%}
|
||||
<li class="list-group-item">
|
||||
<a href="/c/{{ community.link() }}" aria-label="{{ _('Go to community') }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
|
||||
{{ community.display_name() }}
|
||||
</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor -%}
|
||||
</ul>
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
<div class="card-title">{{ _('Found a community:') }}</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
<a href="/c/{{ new_community.link() }}"><img src="{{ new_community.icon_image()}}" class="community_icon rounded-circle" style="width: 30px; vertical-align: middle;" /></a>
|
||||
<a href="/c/{{ new_community.link() }}">{{ new_community.title }}@{{ new_community.ap_domain }}</a>
|
||||
{{ render_communityname(new_community) }}
|
||||
</p>
|
||||
<p> {% if subscribed %}
|
||||
<a class="btn btn-primary mt-4" href="/community/{{ new_community.link() }}/unsubscribe">{{ _('Leave') }}</a>
|
||||
|
|
|
@ -53,9 +53,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
{% for community in active_communities %}
|
||||
<li class="list-group-item">
|
||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
|
||||
{{ community.display_name() }}
|
||||
</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -193,9 +193,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
{% for community in related_communities -%}
|
||||
<li class="list-group-item">
|
||||
<a href="/c/{{ community.link() }}" aria-label="{{ _('Go to community') }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
|
||||
{{ community.display_name() }}
|
||||
</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor -%}
|
||||
</ul>
|
||||
|
|
|
@ -51,9 +51,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
{% for community in active_communities %}
|
||||
<li class="list-group-item">
|
||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
|
||||
{{ community.display_name() }}
|
||||
</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -92,9 +92,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
{% for community in topic_communities %}
|
||||
<li class="list-group-item">
|
||||
<a href="/c/{{ community.link() }}" aria-label="{{ _('Go to community') }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
|
||||
{{ community.display_name() }}
|
||||
</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<ul>
|
||||
{% for community in subscribed %}
|
||||
<li>
|
||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" />{{ community.display_name() }}</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@ -81,7 +81,7 @@
|
|||
<ul>
|
||||
{% for community in moderates %}
|
||||
<li>
|
||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" />{{ community.display_name() }}</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
{% for community in subscribed %}
|
||||
<li class="list-group-item">
|
||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" />{{ community.display_name() }}</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@ -181,7 +181,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
{% for community in moderates %}
|
||||
<li class="list-group-item">
|
||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" />{{ community.display_name() }}</a>
|
||||
{{ render_communityname(community) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue