You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1.5 KiB

{# Copyright (c) 2018 Tildes contributors <code@tildes.net> #}
{# SPDX-License-Identifier: AGPL-3.0-or-later #}
{% from 'utils.jinja2' import pluralize %}
{% macro render_group_subscription_box(group) %}
<div class="group-subscription">
<span class="group-subscription-count">{{ pluralize(group.num_subscriptions, "subscriber") }}</span>
{% if request.has_permission('subscribe', group) %}
{% if group.user_subscribed %}
<button class="btn btn-sm btn-used"
data-ic-delete-from="{{ request.route_url(
'ic_group_subscribe',
path=group.path,
) }}"
data-ic-target="closest .group-subscription"
data-ic-replace-target="true"
>Unsubscribe</button>
{% else %}
<button class="btn btn-sm"
data-ic-put-to="{{ request.route_url(
'ic_group_subscribe',
path=group.path,
) }}"
data-ic-target="closest .group-subscription"
data-ic-replace-target="true"
>Subscribe</button>
{% endif %}
{% endif %}
</div>
{% endmacro %}
{% macro group_segmented_link(group, class=None) -%}
{# Split the link out for each "segment" of the group path #}
<a href="/~{{ group.path[0:1] }}"
{% if class %}class="{{ class }}"{% endif %}
>~{{ group.path[0:1] }}</a>
{%- for i in range(1, group.path|length) -%}
.<a href="/~{{ group.path[0:i+1] }}"
{% if class %}class="{{ class }}"{% endif %}
>{{ group.path[i:i+1] }}</a>
{% endfor %}
{%- endmacro %}