Commit ba5fa057 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch...

Merge branch '478-add-booleanfield-that-toggles-public-display-of-membergroup-members' into 'master'

Add 'Display members' field for MemberGroup

Closes #478

See merge request !1150
parents 3488d043 97ba3353
......@@ -51,7 +51,8 @@ class CommitteeAdmin(TranslatedModelAdmin):
filter_horizontal = ('permissions',)
fields = ('name', 'description', 'photo', 'permissions', 'since',
'until', 'contact_mailinglist', 'contact_email', 'active')
'until', 'contact_mailinglist', 'contact_email', 'active',
'display_members')
def email(self, instance):
if instance.contact_email:
......@@ -72,7 +73,8 @@ class SocietyAdmin(TranslatedModelAdmin):
filter_horizontal = ('permissions',)
fields = ('name', 'description', 'photo', 'permissions', 'since',
'until', 'contact_mailinglist', 'contact_email', 'active')
'until', 'contact_mailinglist', 'contact_email', 'active',
'display_members')
def email(self, instance):
if instance.contact_email:
......@@ -91,7 +93,8 @@ class BoardAdmin(TranslatedModelAdmin):
filter_horizontal = ('permissions',)
fields = ('name', 'description', 'photo', 'permissions',
'contact_mailinglist', 'contact_email', 'since', 'until',)
'contact_mailinglist', 'contact_email', 'since', 'until',
'display_members')
class TypeFilter(admin.SimpleListFilter):
......
# Generated by Django 2.1.5 on 2019-02-06 19:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('activemembers', '0036_auto_20181024_1939'),
]
operations = [
migrations.AddField(
model_name='membergroup',
name='display_members',
field=models.BooleanField(default=False),
),
]
......@@ -95,6 +95,10 @@ class MemberGroup(models.Model, metaclass=ModelTranslateMeta):
on_delete=models.SET_NULL,
)
display_members = models.BooleanField(
default=False,
)
@property
def contact_address(self):
if self.contact_mailinglist:
......
......@@ -34,22 +34,24 @@
</section>
{% endif %}
<section id="activemembers-membergroup-members" class="page-section">
<div class="container">
<h1 class="text-center section-title">
{% trans 'Members' %}
</h1>
{% if membergroup.display_members %}
<section id="activemembers-membergroup-members" class="page-section">
<div class="container">
<h1 class="text-center section-title">
{% trans 'Members' %}
</h1>
<div class="row">
{% for member in members %}
<div class="col-4 col-md-3 my-3">
{% membergroup_member_card member %}
</div>
{% empty %}
{% trans "This group doesn't have any members?" as empty %}
{% alert 'danger' empty extra_classes='col-10 offset-1' %}
{% endfor %}
</div>
</div>
</section>
<div class="row">
{% for member in members %}
<div class="col-4 col-md-3 my-3">
{% membergroup_member_card member %}
</div>
{% empty %}
{% trans "This group doesn't have any members?" as empty %}
{% alert 'danger' empty extra_classes='col-10 offset-1' %}
{% endfor %}
</div>
</div>
</section>
{% endif %}
{% endblock %}
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