forked from gergely/calendar-social
WIP: Groups support
This commit is contained in:
17
calsocial/templates/group/create.html
Normal file
17
calsocial/templates/group/create.html
Normal 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 %}
|
33
calsocial/templates/group/display.html
Normal file
33
calsocial/templates/group/display.html
Normal 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 %}
|
11
calsocial/templates/group/list.html
Normal file
11
calsocial/templates/group/list.html
Normal 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 %}
|
Reference in New Issue
Block a user