mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -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 %}
|
{% for community in communities.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/c/{{ community.link() }}">{{ community.name }}</a></td>
|
<td><a href="/c/{{ community.link() }}">{{ community.name }}</a></td>
|
||||||
<td><a href="/c/{{ community.link() }}">
|
<td>{{ render_communityname(community) }}{% if community.banned %} (banned){% endif %}</td>
|
||||||
<img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" />
|
|
||||||
{{ community.display_name() }}{% if community.banned %} (banned){% endif %}</a></td>
|
|
||||||
<td>{{ community.topic.name }}</td>
|
<td>{{ community.topic.name }}</td>
|
||||||
<td>{{ community.post_count }}</td>
|
<td>{{ community.post_count }}</td>
|
||||||
<th>{{ '✓'|safe if community.show_home else '✗'|safe }}</th>
|
<th>{{ '✓'|safe if community.show_home else '✗'|safe }}</th>
|
||||||
|
@ -67,4 +65,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -26,6 +26,16 @@
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
</span>
|
</span>
|
||||||
{% endmacro -%}
|
{% 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>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
<div class="card-title">{{ _('Found a community:') }}</div>
|
<div class="card-title">{{ _('Found a community:') }}</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>
|
<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>
|
{{ render_communityname(new_community) }}
|
||||||
<a href="/c/{{ new_community.link() }}">{{ new_community.title }}@{{ new_community.ap_domain }}</a>
|
|
||||||
</p>
|
</p>
|
||||||
<p> {% if subscribed %}
|
<p> {% if subscribed %}
|
||||||
<a class="btn btn-primary mt-4" href="/community/{{ new_community.link() }}/unsubscribe">{{ _('Leave') }}</a>
|
<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">
|
<ul class="list-group list-group-flush">
|
||||||
{% for community in related_communities -%}
|
{% for community in related_communities -%}
|
||||||
<li class="list-group-item">
|
<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="" />
|
{{ render_communityname(community) }}
|
||||||
{{ community.display_name() }}
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
<div class="card-title">{{ _('Found a community:') }}</div>
|
<div class="card-title">{{ _('Found a community:') }}</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>
|
<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>
|
{{ render_communityname(new_community) }}
|
||||||
<a href="/c/{{ new_community.link() }}">{{ new_community.title }}@{{ new_community.ap_domain }}</a>
|
|
||||||
</p>
|
</p>
|
||||||
<p> {% if subscribed %}
|
<p> {% if subscribed %}
|
||||||
<a class="btn btn-primary mt-4" href="/community/{{ new_community.link() }}/unsubscribe">{{ _('Leave') }}</a>
|
<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">
|
<ul class="list-group list-group-flush">
|
||||||
{% for community in active_communities %}
|
{% for community in active_communities %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
|
{{ render_communityname(community) }}
|
||||||
{{ community.display_name() }}
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -193,9 +193,7 @@
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% for community in related_communities -%}
|
{% for community in related_communities -%}
|
||||||
<li class="list-group-item">
|
<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="" />
|
{{ render_communityname(community) }}
|
||||||
{{ community.display_name() }}
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -51,9 +51,7 @@
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% for community in active_communities %}
|
{% for community in active_communities %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
|
{{ render_communityname(community) }}
|
||||||
{{ community.display_name() }}
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -92,9 +92,7 @@
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% for community in topic_communities %}
|
{% for community in topic_communities %}
|
||||||
<li class="list-group-item">
|
<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="" />
|
{{ render_communityname(community) }}
|
||||||
{{ community.display_name() }}
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% for community in subscribed %}
|
{% for community in subscribed %}
|
||||||
<li>
|
<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>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% for community in moderates %}
|
{% for community in moderates %}
|
||||||
<li>
|
<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>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% for community in subscribed %}
|
{% for community in subscribed %}
|
||||||
<li class="list-group-item">
|
<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>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
{% for community in moderates %}
|
{% for community in moderates %}
|
||||||
<li class="list-group-item">
|
<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>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Add table
Reference in a new issue