pyfedi/app/templates/topic/topic_create_post.html
2024-05-30 22:05:34 +12:00

52 lines
4.2 KiB
HTML

{% extends 'base.html' %}
{% from 'bootstrap/form.html' import render_form %}
{% block app_content %}
<div class="row">
<div class="col col-login mx-auto">
<div class="card mt-5" id="choose_communities_in_topic_card">
<div class="card-body p-6">
<div class="card-title text-center">{{ _('Which community within %(topic)s to post in?', topic=topic.name) }}</div>
<form method="post" id="choose_community">
<input type="hidden" name="community_id" id="community_id" />
<table class="communities_table table table-hover w-100">
<tbody>
{% for community in communities %}
{% if not community.user_is_banned(current_user) %}
{% if not community.restricted_to_mods or (community.restricted_to_mods and community_membership(current_user, community) in [SUBSCRIPTION_MODERATOR, SUBSCRIPTION_OWNER]) %}
<tr>
<th class="pl-2"><a class="choose_topic_for_post" data-id="{{ community.id }}" href="/community/{{ community.link() }}/submit" rel="nofollow" aria-label="{{ _('Post in %(name)s', name=community.display_name()) }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" alt="" />
{{ community.display_name() }}</a></th><th></th>
</tr>
{% else %}
<tr>
<th class="pl-2"><a class="choose_topic" data-id="{{ community.id }}" href="/c/{{ community.link() }}" rel="nofollow" aria-label="{{ _('View %(name)s', name=community.display_name()) }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" alt="" />
{{ community.display_name() }}</a></th><th>(Posts are restricted to Mods)</th>
</tr>
{% endif %}
{% endif %}
{% endfor %}
{% for community in sub_communities %}
{% if not community.user_is_banned(current_user) %}
{% if not community.restricted_to_mods or (community.restricted_to_mods and community_membership(current_user, community) in [SUBSCRIPTION_MODERATOR, SUBSCRIPTION_OWNER]) %}
<tr>
<th class="pl-2"><a class="choose_topic_for_post" data-id="{{ community.id }}" href="/community/{{ community.link() }}/submit" rel="nofollow" aria-label="{{ _('Post in %(name)s', name=community.display_name()) }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" alt="" />
{{ community.display_name() }}</a></th><th></th>
</tr>
{% else %}
<tr>
<th class="pl-2"><a class="choose_topic" data-id="{{ community.id }}" href="/c/{{ community.link() }}" rel="nofollow" aria-label="{{ _('View %(name)s', name=community.display_name()) }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" alt="" />
{{ community.display_name() }}</a></th><th>(Posts are restricted to Mods)</th>
</tr>
{% endif %}
{% endif %}
{% endfor %}
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
{% endblock %}