Commit 4141dc4a authored by Robert's avatar Robert Committed by Lars Kruse
Browse files

feat(matrix_chat): add links to chat rooms to group page

parent e0a3fbd1
......@@ -141,6 +141,26 @@
</a>
</dd>
{% endif %}
{% if public_chat_room %}
<dt>
<i class="sg sg-public-chat"></i>
</dt>
<dd>
<a href="{{ public_chat_room.get_client_url }}"><strong>Öffentlicher Chatraum der Gruppe</strong></a>
</dd>
{% endif %}
{% load rules %}
{% has_perm 'groups.change' user group as can_view_details %}
{% if private_chat_room and can_view_details %}
<dt>
<i class="sg sg-private-chat"></i>
</dt>
<dd>
<a href="{{ private_chat_room.get_client_url }}"><strong>Interner Chatraum der Gruppe</strong></a>
</dd>
{% endif %}
</dl>
</div>
......
......@@ -21,6 +21,7 @@ from grouprise.features.groups import filters, forms, models
from grouprise.features.groups.forms import RecommendForm
from grouprise.features.groups.models import Group
from grouprise.features.groups.notifications import RecommendNotification
from grouprise.features.matrix_chat.settings import MATRIX_SETTINGS
class Create(PermissionMixin, CreateView):
......@@ -54,6 +55,10 @@ class Detail(PermissionMixin, TemplateFilterMixin, MultipleObjectMixin, DetailVi
intro_associations = intro_associations.exclude(pk=intro_gallery.pk)
kwargs['feed_url'] = self.request.build_absolute_uri(
reverse('group-feed', args=(self.object.pk,)))
if MATRIX_SETTINGS.ENABLED:
all_rooms = self.object.matrix_rooms
kwargs['public_chat_room'] = all_rooms.filter(is_private=False).first()
kwargs['private_chat_room'] = all_rooms.filter(is_private=True).first()
return super().get_context_data(
GROUPRISE_MAILINGLIST_ENABLED=CORE_SETTINGS.MAILINGLIST_ENABLED,
associations=associations,
......
......@@ -105,6 +105,8 @@
.sg-icon(more, @fa-var-ellipsis-h);
.sg-icon(imprint, @fa-var-gavel);
.sg-icon(mailinglist, @fa-var-envelope);
.sg-icon(public-chat, @fa-var-comments);
.sg-icon(private-chat, @fa-var-user-secret);
// utility icons
.sg-icon(increase, @fa-var-plus);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment