Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onderwijsmailing #95

Merged
merged 3 commits into from
Sep 7, 2015
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ldb/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class PersonAdmin(CompareVersionAdmin):
(_('Other'), {'fields': ['gender', 'birthdate', 'deceased', 'comment']}),
(_('Subscriptions'), {'fields': ['machazine', 'board_invites', 'constitution_card',
'christmas_card', 'yearbook',
'mail_announcements', 'mail_company']}),
'mail_announcements', 'mail_company', 'mail_educational']}),
]
inlines = [MemberInline, CommitteeMembershipInline, StudentInline, AlumnusInline, EmployeeInline]

Expand Down
2 changes: 1 addition & 1 deletion ldb/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def set_querysets(self, query):
allowed_filters = {
'entity': ['country', 'machazine', 'board_invites', 'constitution_card', 'christmas_card', 'yearbook'],
'organization': [],
'person': ['mail_announcements', 'mail_company'],
'person': ['mail_announcements', 'mail_company', 'mail_educational'],
'person__member': ['associate_member', 'donating_member', 'merit_invitations'],
'person__student': ['first_year', 'enrolled', 'yearbook_permission'],
'person__alumnus': [],
Expand Down
19 changes: 19 additions & 0 deletions ldb/migrations/0008_person_mail_educational.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('ldb', '0007_person_membership_status'),
]

operations = [
migrations.AddField(
model_name='person',
name='mail_educational',
field=models.BooleanField(default=True, verbose_name='educational mailing'),
),
]
3 changes: 2 additions & 1 deletion ldb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class Meta:
# Subscriptions
mail_announcements = models.BooleanField(_('announcements mailing'), default=True)
mail_company = models.BooleanField(_('company mailing'), default=True)
mail_educational = models.BooleanField(_('educational mailing'), default=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zou het niet 'education mailing' moeten zijn? Nu zou je educatieve mails moeten gaan versturen, lijkt me ook wel leerzaam


ldap_username = CharNullField(_('LDAP username'), max_length=64, blank=True, null=True, unique=True)

Expand Down Expand Up @@ -213,7 +214,7 @@ def formatted_name(self):
def subscriptions(self):
return get_attributes(self, ['machazine', 'constitution_card',
'christmas_card', 'board_invites',
'mail_announcements', 'mail_company'])
'mail_announcements', 'mail_company', 'mail_educational'])

@property
def gender_symbol(self):
Expand Down
16 changes: 16 additions & 0 deletions ldb/static/partials/ldb/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,22 @@ <h1>2. Filters</h1>
<span class="help-block">Is aangemeld voor Bedrijvenmailing.</span>
</div>
</div>

<div class="control-group">
<div class="control-label">Onderwijsmailing:</div>
<div class="controls">
<label class="radio inline">
<input type="radio" ng-model="export.filters.person__mail_educational" value="true"> Ja
</label>
<label class="radio inline">
<input type="radio" ng-model="export.filters.person__mail_educational" value="false"> Nee
</label>
<label class="radio inline">
<input type="radio" ng-model="export.filters.person__mail_educational" value="undefined"> Maakt niet uit
</label>
<span class="help-block">Is aangemeld voor Onderwijsmailing.</span>
</div>
</div>
</fieldset>

<fieldset ng-show="export.queryset.members || export.queryset.merit || export.queryset.honorary">
Expand Down
1 change: 1 addition & 0 deletions ldb/static/partials/ldb/person.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ <h2>Aanmeldingen</h2>

<span ch-editable ch-model="person.mail_announcements" ch-template="check"></span> Algemene mailing<br />
<span ch-editable ch-model="person.mail_company" ch-template="check"></span> Bedrijvenmailing<br />
<span ch-editable ch-model="person.mail_educational" ch-template="check"></span> Onderwijsmailing<br />

</section>

Expand Down
4 changes: 4 additions & 0 deletions ldb/templates/ldb/export_lists.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ <h2>Mailinglijsten</h2>

<a href="{% url 'ldb_export_list' type='mailing' list='company' %}">Bedrijvenmailing</a>

<br/>

<a href="{% url 'ldb_export_list' type='mailing' list='educational' %}">Onderwijsmailing</a>

<h2>Adreslijsten</h2>

<a href="{% url 'ldb_export_list' type='address' list='machazine' %}">MaCHazine</a>
Expand Down
1 change: 1 addition & 0 deletions ldb/templates/ldb/person_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ <h2 class="page-header">
{% stcontrol_janee person 'yearbook' %}
{% stcontrol_janee person 'mail_announcements' %}
{% stcontrol_janee person 'mail_company' %}
{% stcontrol_janee person 'mail_educational' %}
{% if person.member.merit_date_from %}
{% stcontrol_janee person.member 'merit_invitations' %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion ldb/templates/ldb/person_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h2 class="page-header">Persoon aanmaken</h2>
<div class="col-md-6">
<fieldset>
<legend>Aanmeldingen</legend>
{% get_fieldset machazine,board_invites,constitution_card,christmas_card,yearbook,mail_announcements,mail_company as subscription_fields from form %}
{% get_fieldset machazine,board_invites,constitution_card,christmas_card,yearbook,mail_announcements,mail_company,mail_educational as subscription_fields from form %}
{% bootstrap_form subscription_fields layout='horizontal' horizontal_label_class='col-md-4 visible-md-block visible-lg-block' %}
</fieldset>

Expand Down