WIP: Groups support

This commit is contained in:
2018-07-26 10:44:47 +02:00
parent eaf71d4ce6
commit 74530347e2
8 changed files with 411 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% from '_macros.html' import field %}
{% block content %}
<h2>{% trans %}Create a group{% endtrans %}</h2>
<form method="post" class="ui form">
{{ form.hidden_tag() }}
{{ field(form.handle) }}
{{ field(form.display_name) }}
{{ field(form.visibility) }}
<button class="ui primary button">{% trans %}Create{% endtrans %}</button>
<a href="{{ url_for('group.list_groups') }}" class="ui button">{% trans %}Cancel{% endtrans %}</a>
</form>
{% endblock content %}

View File

@@ -0,0 +1,33 @@
{% extends 'base.html' %}
{% from '_macros.html' import profile_link %}
{% block content %}
<h2 class="ui header">
{% if group.visibility == 'secret' %}
[secret]
{% elif group.visibility == 'closed' %}
[closed]
{% elif group.visibility == 'public' %}
[public]
{% endif %}
{{group.display_name }}
<small>{{ group.fqn }}</small>
</h2>
{% if not current_user.profile or not current_user.profile.is_member_of(group) %}
{% if group.visibility == 'public' %}
Join
{% else %}
Request membership
{% endif %}
{% else %}
Invitation form
{% endif %}<br>
{% if group.details_visible_to(current_user.profile) %}
<h2>{% trans %}Members{% endtrans %}</h2>
{% for member in group.members %}
{{ profile_link(member) }}
{% endfor %}
{% else %}
The details of this grop are not visible to you.
{% endif %}
{% endblock content %}

View File

@@ -0,0 +1,11 @@
{% extends 'base.html' %}
{% block content %}
<h2>{% trans %}Groups{% endtrans %}</h2>
{% for group in groups %}
<a href="{{ group.url }}">{{ group }}</a>
{% else %}
{% trans %}No groups.{% endtrans %}
<a href="{{ url_for('group.create') }}">{% trans %}Do you want to create one?{% endtrans %}
{% endfor %}
{% endblock content %}