Skip to content
Snippets Groups Projects
Verified Commit 2bbcbb26 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Implement frontend

parent 7f3164c1
No related branches found
No related tags found
No related merge requests found
Showing
with 1523 additions and 18 deletions
...@@ -7,7 +7,7 @@ class DefaultConfig(AppConfig): ...@@ -7,7 +7,7 @@ class DefaultConfig(AppConfig):
dist_name = "AlekSIS-App-Paweljong" dist_name = "AlekSIS-App-Paweljong"
urls = { urls = {
"Repository": "https://edugit.org/Teckids/hacknfun//AlekSIS-App-Paweljong", "Repository": "https://edugit.org//hacknfun//AlekSIS-App-Paweljong",
} }
licence = "EUPL-1.2+" licence = "EUPL-1.2+"
copyright_info = (([2021], "Dominik George", "dominik.george@teckids.org"),) copyright_info = (([2021], "Dominik George", "dominik.george@.org"),)
from django.utils.translation import gettext_lazy as _
from django_filters import FilterSet
from material import Layout, Row
from aleksis.core.filters import MultipleCharFilter
from .models import EventRegistration, FeedbackAspect, Voucher
class EventRegistrationFilter(FilterSet):
class Meta:
model = EventRegistration
fields = ["person", "event", "accept_sepa", "date_registred"]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.form.layout = Layout(
Row("person", "event"),
Row("accept_sepa", "date_registred"),
)
class VoucherFilter(FilterSet):
event = MultipleCharFilter(
[
"event__short_name__icontains",
],
label=_("Search by event"),
)
name = MultipleCharFilter(
[
"person__first_name__icontains",
"person__last_name__icontains",
],
label=_("Search by name"),
)
class Meta:
model = Voucher
fields = []
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.form.layout = Layout(Row("event", "name"))
class FeedbackAspectsFilter(FilterSet):
class Meta:
model = FeedbackAspect
fields = ["aspect"]
import re
from collections import OrderedDict
from django import forms
from django.utils.translation import ugettext_lazy as _
import phonenumbers
from django_select2.forms import ModelSelect2MultipleWidget, ModelSelect2Widget
from django_starfield import Stars
from material import Fieldset, Layout, Row
from aleksis.core.forms import AccountRegisterForm
from aleksis.core.mixins import ExtensibleForm
from aleksis.core.models import Group, Person
from aleksis.core.util.core_helpers import get_site_preferences
from .models import Event, EventRegistration, FeedbackAspect, Voucher
COMMENT_CHOICES = [
("first", _("Only first name")),
("first_age", _("First name and age")),
("first_last_age", _("First name, last name and age")),
]
TEMPLATE_CHOICES = [
("list_sign", _("Signature list")),
("list_participants", _("Participants list")),
("corona", _("Corona attendance list")),
]
LICENCE_CHOICES = [
("CC-BY-4.0+", _("Creative Commons with attribution, 4.0 or later")),
(
"CC-BY-SA-4.0+",
_(
"Creative Commons with attribution and distribution only"
"under the same conditions, 4.0 or later"
),
),
]
NEWSLETTER_CHOICES = get_site_preferences()["paweljong__newsletter_choices"].split(",")
def is_phonenumber(number):
try:
phonenumbers.parse(number, "DE")
except BaseException:
raise forms.ValidationError(_("%s is not a valid phone number") % number)
def is_valid_voucher_for(event_cn):
def _is_valid_voucher(code):
if Voucher.objects.filter(code=code, event_cn=event_cn, used=False).count() == 0:
raise forms.ValidationError(_("The voucher is invalid!"))
return _is_valid_voucher
def clean_phonenumber(field):
def _clean_phonenumber(obj):
value = obj.cleaned_data[field]
if value:
pn = phonenumbers.parse(value, "DE")
value = phonenumbers.format_number(pn, phonenumbers.PhoneNumberFormat.E164)
return value
return _clean_phonenumber
class EventAdditionalSurveyForm(forms.Form):
def __init__(self, event, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_fields_from_ldap(event)
def add_fields_from_ldap(self, event, before=None):
new_fields = OrderedDict()
for field in event.registration_fields:
label, help_text, *choices = field.split("|")
var = re.sub(r"[^A-Za-z0-9]|^(?=\d)", "_", label)
if choices:
choices_map = [
(re.sub(r"[^A-Za-z0-9]|^(?=\d)", "_", choice), choice) for choice in choices
]
field_attr = forms.ChoiceField(
label=label,
help_text=help_text,
choices=choices_map,
required=False,
)
else:
field_attr = forms.CharField(label=label, help_text=help_text, required=False)
new_fields[var] = field_attr
if before:
before_field_index = list(self.fields.keys()).index(before)
field_names = list(self.fields.keys())
new_field_order = (
field_names[: before_field_index - 1]
+ list(new_fields.keys())
+ field_names[before_field_index - 1 :]
)
self.fields.update(new_fields)
if before:
self.order_fields(new_field_order)
class EventFeedbackForm(ExtensibleForm):
class Meta:
model = FeedbackAspect
fields = []
layout = Layout(
Fieldset(
_("Comments"),
Row("comment_private", "comment_public", "comment_public_info"),
),
Fieldset(
_("Photos"),
Row("photos", "photos_licence"),
),
Fieldset(
_("Feedback aspects"),
),
)
comment_private = forms.CharField(
required=False,
label=_("Comment for the team"),
help_text=_(
"This comment is for the team only. You can write down everything you"
"would like to give us as feedback here."
),
widget=forms.Textarea,
)
comment_public = forms.CharField(
required=False,
label=_("Comment for the website"),
help_text=_(
"This comment is for the report on our website. Tell in detail about what"
"you experienced, what you liked, what you learned and everything else"
"you can think of."
),
widget=forms.Textarea,
)
comment_public_info = forms.ChoiceField(
label=_("Information in the comment"),
choices=COMMENT_CHOICES,
help_text=_("What information would you like to use to publish your comment?"),
)
photos = forms.ImageField(
label=_("Photos"),
widget=forms.ClearableFileInput(attrs={"multiple": True}),
required=False,
help_text=_(
"If you want to contribute photos to the report, you can upload them here. You can"
"select multiple files in most file selection dialogs with CTRL + click."
),
)
photos_licence = forms.ChoiceField(
label=_("Photo licence"),
choices=LICENCE_CHOICES,
required=False,
help_text=_("If you upload photos, choose a license here."),
)
def __init__(self, event, *args, **kwargs):
super(EventFeedbackForm, self).__init__(*args, **kwargs)
self._event = event
for aspect in event.feedback_aspects.all():
field = forms.IntegerField(
widget=Stars,
required=False,
)
self.fields[aspect.aspect] = field
node = Fieldset(f"{aspect.aspect}", f"{aspect.aspect}")
self.add_node_to_layout(node)
class EditEventForm(forms.ModelForm):
"""Form to create or edit an event."""
layout = Layout(
Fieldset(
_("Base data"),
"group",
Row("display_name", "description"),
Row("place", "published"),
Fieldset(_("Date data"), Row("date_event", "date_registration", "date_retraction")),
Fieldset(_("Event details"), Row("cost", "max_participants")),
Fieldset(_("Feedback aspects"), "feedback_aspects"),
),
)
class Meta:
model = Event
exclude = []
widgets = {
"group": ModelSelect2Widget(
search_fields=["name__icontains", "short_name__icontains"],
attrs={"data-minimum-input-length": 0, "class": "browser-default"},
),
"feedback_aspects": ModelSelect2MultipleWidget(
search_fields=["aspect__icontains"],
attrs={"data-minimum-input-length": 0, "class": "browser-default"},
),
}
class EditVoucherForm(forms.ModelForm):
"""Form to edit and create vouchers."""
class Meta:
model = Voucher
exclude = ["code", "used_person_uid", "used", "deleted"]
help_texts = {
"event": _("Event the voucher is valid for."),
"person": _("Person the voucher is valid for."),
"discount": _("Voucher discount."),
}
class GenerateListForm(forms.Form):
"""Form to create a list of participants of a group."""
group = forms.ModelChoiceField(
label=_("Group"),
queryset=Group.objects.all(),
help_text=_("Select group to generate list."),
)
template = forms.ChoiceField(
label=_("Template"),
choices=TEMPLATE_CHOICES,
help_text=_("Select template to generate list."),
)
landscape = forms.BooleanField(
label=_("Landscape"),
help_text=_("Select if output should be in landscape."),
)
class RegisterEventForm(forms.ModelForm):
"""Form to register for an event."""
layout = Layout(
Fieldset(
_("Address data"),
Row("street", "housenumber"),
Row("postal_code", "place"),
),
Fieldset(
_("Contact details"),
Row("mobile_number", "email"),
),
Fieldset(
_("Personal data"),
Row("date_of_birth", "sex"),
),
Fieldset(
_("School details"),
Row("school", "school_place", "school_class"),
),
Fieldset(
_("Guardians personal data"),
Row("guardian_first_name", "guardian_last_name"),
),
Fieldset(
_("Guardians contact details"),
Row("guardian_email", "guardian_mobile_number"),
),
Fieldset(
_("General event information"),
Row("event", "person"),
Row("comment", "channel"),
),
Fieldset(
_("Financial data"),
"voucher_code",
Row("iban", "donation", "accept_sepa"),
),
Fieldset(
_("Declaration of consent"),
Row("accept_terms", "accept_data", "accept_general_terms"),
),
)
class Meta:
model = EventRegistration
exclude = ["date_registred", "voucher"]
help_texts = {
"voucher": _(
"If you have a voucher for the event, enter the code here."
"It will be charged automatically."
),
"donation": (
"Our association would like to offer all children and young"
"people the opportunity to participate in our events. Often,"
"however, the family fee cannot be paid. We therefore have a"
"budget from which we can promote participation after we have"
"carefully examined the necessity and eligibility. We rely on"
"donations for this budget. If you would like to donate a voluntary"
"additional amount for this budget, please indicate this here. We do"
"not permanently save whether and if so in what amount donations are"
"made and also not within the association, e.g. passed on to leisure supervisors."
),
"accept_sepa": _(
"Parents: I authorize the creditor e.V., Rochusstr. 2-4, 53123 Bonn with"
"creditor ID DE70FZT00001497650, to collect the participant fee from my account"
"once using the SEPA core direct debit. At the same time, I instruct my bank to"
"redeem the SEPA core direct debit withdrawn from my account by e.V."
),
"iban": _(
"If your parents want to pay by SEPA direct debit,"
"please let them fill out this field."
),
"accept_terms": _(
"Parents: My child filled out the registration form together with me, but myself,"
"and I agree to the participation, the terms of use and the terms and conditions."
"I am aware that the registration is binding and that withdrawal is only possible"
"in exceptional cases with a valid reason. In addition, I agree to pay the"
"participation fee in advance and agree to the reimbursement guidelines"
"mentioned above."
),
"accept_data": _(
"I consent to the processing of my data as stated in the"
"terms of use and all the data provided is correct. If I am under the"
"age of 16, my parents also agree to this and I can prove this on request"
"(e.g. by making contact with my parents)."
),
"accept_general_terms": _("I agree with the" "AGB and have read them."),
"channel": _("How did you find out about the event?"),
}
guardian_first_name = forms.CharField(
label=_("Guardians first name"),
help_text=_(
"Please enter the first name of the legal guardian who will fill in the registration"
"with you and who can be reached during the event in an emergency."
),
)
guardian_last_name = forms.CharField(
label=_("Guardians last name"),
help_text=_(
"Please enter the last name of the legal guardian who will fill in the registration"
"with you and who can be reached during the event in an emergency."
),
)
guardian_mobile_number = forms.CharField(
label=_("Guardians mobile number"),
help_text=_(
"We need the mobile phone number for emergencies if we"
"urgently need to reach your parents during the event."
),
)
guardian_email = forms.EmailField(
label=_("Guardians email address"),
)
voucher_code = forms.CharField(
label=_("Voucher code"),
help_text=_("If you have a voucher code, type it in here."),
required=False,
)
street = forms.CharField(
label=_("Street"),
)
housenumber = forms.CharField(
label=_("Housenumber"),
)
postal_code = forms.CharField(
label=_("Postal code"),
)
place = forms.CharField(
label=_("Place"),
)
mobile_number = forms.CharField(
label=_("Mobile number"),
required=False,
help_text=_(
"Your mobile number helps us to reach you in an emergency during the event, e.g."
"if you are alone with your group at a conference or similar. If you don't have a"
"cell phone, you can leave the field blank."
),
validators=[is_phonenumber],
)
date_of_birth = forms.DateField(
label=_("Date of birth"),
)
sex = forms.ChoiceField(
label=_("Sex"),
help_text=_(
"For various reasons, e.g. because we have to keep gender segregation during the night"
"for legal reasons, we need to know if you are a boy or a girl. With some names this is"
"not always immediately recognizable, so we ask you to indicate it here."
),
choices=Person.SEX_CHOICES,
initial=None,
)
email = forms.EmailField(
label=_("Email address"),
)
school = forms.CharField(
label=_("School"),
help_text=_("Please enter the name of your school as exactly as it should be written."),
)
school_place = forms.CharField(
label=_("School place"),
help_text=_("Enter the place (city) where your school is located (without a district)."),
)
school_class = forms.CharField(
label=_("School class"),
help_text=_("Please enter the class you are going to (e.g. 8a)."),
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["event"].disabled = True
self.fields["person"].disabled = True
self.fields["accept_terms"].required = True
self.fields["accept_general_terms"].required = True
self.fields["accept_data"].required = True
class EditEventRegistrationForm(forms.ModelForm):
layout = Layout(
Fieldset(
_("General event information"),
Row("event", "person"),
Row("comment", "channel"),
),
Fieldset(
_("Financial data"),
"voucher_code",
Row("iban", "donation", "accept_sepa"),
),
Fieldset(
_("Declaration of consent"),
Row("accept_terms", "accept_data", "accept_general_terms"),
),
)
class Meta:
model = EventRegistration
help_texts = {
"voucher": _(
"If you have a voucher for the event, enter the code here."
"It will be charged automatically."
),
"donation": (
"Our association would like to offer all children and young"
"people the opportunity to participate in our events. Often,"
"however, the family fee cannot be paid. We therefore have a"
"budget from which we can promote participation after we have"
"carefully examined the necessity and eligibility. We rely on"
"donations for this budget. If you would like to donate a voluntary"
"additional amount for this budget, please indicate this here. We do not"
"permanently save whether and if so in what amount donations are made"
"and also not within the association, e.g. passed on to leisure supervisors."
),
"accept_sepa": _(
"Parents: I authorize the creditor e.V., Rochusstr. 2-4, 53123 Bonn with"
"creditor ID DE70FZT00001497650, to collect the participant fee from my account"
"once using the SEPA core direct debit. At the same time, I instruct my bank"
"to redeem the SEPA core direct debit withdrawn from my account by e.V."
),
"iban": _(
"If your parents want to pay by SEPA direct debit,"
"please let them fill out this field."
),
"accept_terms": _(
"Parents: My child filled out the registration form together with me, but myself,"
"and I agree to the participation, the terms of use and the terms and conditions."
"I am aware that the registration is binding and that withdrawal is only possible"
"in exceptional cases with a valid reason. In addition, I agree to pay the"
"participation fee in advance and agree to the reimbursement"
"guidelines mentioned above."
),
"accept_data": _(
"I consent to the processing of my data as stated in the"
"terms of use and all the data provided is correct. If I am under"
"the age of 16, my parents also agree to this and I can prove this on"
"request (e.g. by making contact with my parents)."
),
"accept_general_terms": _("I agree with the" "AGB and have read them."),
"channel": _("How did you find out about the event?"),
}
exclude = []
class EditFeedbackAspectForm(forms.ModelForm):
class Meta:
model = FeedbackAspect
exclude = []
date_of_birth = forms.DateField(label=_("Date of birth"))
extend_register_form = Fieldset(date_of_birth)
AccountRegisterForm.add_node_to_layout(extend_register_form)
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
MENUS = { MENUS = {
"NAV_MENU_CORE": [ "NAV_MENU_CORE": [
{ {
"name": _("Paweljong"), "name": _("Events"),
"url": "empty", "url": "events",
"icon": "event",
},
{
"name": _("Vouchers"),
"url": "#",
"icon": "confirmation_number",
"root": True, "root": True,
"validators": [ "validators": [
"menu_generator.validators.is_authenticated", (
"aleksis.core.util.core_helpers.has_person", "aleksis.core.util.predicates.permission_validator",
"paweljong.view_vouchers_rule",
)
],
"submenu": [
{
"name": _("Voucher overview"),
"url": "vouchers",
"icon": "confirmation_number",
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.change_vouchers_rule",
)
],
},
{
"name": _("Create voucher"),
"url": "create_vouchers",
"icon": "post_add",
"validator": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.create_vouchers_rule",
)
],
},
],
},
{
"name": _("Event management"),
"url": "#",
"icon": "event_note",
"root": True,
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.change_events_rule",
)
],
"submenu": [
{
"name": _("Create event"),
"url": "create_event",
"icon": "event_available",
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.create_events_rule",
)
],
},
{
"name": _("Manage feedback aspects"),
"url": "feedback_aspects",
"icon": "rate_review",
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.view_feedback_aspects_rule",
)
],
},
{
"name": _("Generate participant list"),
"url": "generate_lists",
"icon": "format_list_numbered",
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.generate_lists_rule",
)
],
},
{
"name": _("Manage upcoming events"),
"url": "manage_events",
"icon": "change",
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.change_events_rule",
)
],
},
{
"name": _("Manage registrations"),
"url": "registrations",
"icon": "how_to_reg",
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"paweljong.view_registrations_rule",
)
],
},
], ],
"submenu": [], },
} ],
]
} }
from django.utils.translation import gettext_lazy as _
from jsonstore import CharField
from aleksis.core.models import Person
# Additional fields for persons
Person.field(school=CharField(verbose_name=_("Name of school")))
Person.field(school_class=CharField(verbose_name=_("School class")))
Person.field(school_place=CharField(verbose_name=_("Place of the school")))
from django.contrib.auth import get_user_model
from rules import predicate
from aleksis.core.models import Group, Person
from aleksis.core.util.predicates import check_object_permission
from .models import EventRegistration, Voucher
User = get_user_model()
@predicate
def see_group_by_grouptype(user: User, group: Group) -> bool:
"""Predicate which checks if the user is allowed to see the groups GroupType."""
grouptype = group.group_type
return check_object_permission(user, "core.view_grouptype", grouptype)
@predicate
def see_owned_groups_members(user: User, person: Person) -> bool:
"""Owners of groups can see their members."""
groups_list = user.person.owner_of.all().values_list("id", flat=True)
return Person.member_of.filter(id__in=groups_list).exists()
@predicate
def is_own_voucher(user: User, voucher: Voucher) -> bool:
"""Predicate which checks if the voucher belongs to the user."""
return voucher.person == user.person
@predicate
def is_own_registration(user: User, registration: EventRegistration) -> bool:
"""Predicate which checks if the registration belongs to the user."""
return registration.person == user.person
from django.utils.translation import gettext_lazy as _
from dynamic_preferences.preferences import Section
from dynamic_preferences.types import StringPreference
from aleksis.core.registries import site_preferences_registry
paweljong = Section("paweljong")
@site_preferences_registry.register
class NewsletterChoices(StringPreference):
section = paweljong
name = "newsletter_choices"
default = ""
required = False
verbose_name = _("Newsletter choices (comma-seperated)")
@site_preferences_registry.register
class WWSPostUrl(StringPreference):
section = paweljong
name = "wws_post_url"
default = ""
required = False
verbose_name = _("POST url for Sympa")
@site_preferences_registry.register
class ChannelChoices(StringPreference):
section = paweljong
name = "channel_choices"
default = ""
requred = False
verbose_name = _("Channel choices")
import rules
from aleksis.core.models import Group
from aleksis.core.util.predicates import (
has_any_object,
has_global_perm,
has_object_perm,
has_person,
is_group_member,
)
from .models import Event, EventRegistration, FeedbackAspect, Voucher
from .predicates import (
is_own_registration,
is_own_voucher,
see_group_by_grouptype,
see_owned_groups_members,
)
# View vouchers
view_vouchers_predicate = has_person & (
has_global_perm("paweljong.view_voucher") | has_any_object("paweljong.view_voucher", Voucher)
)
rules.add_perm("paweljong.view_vouchers_rule", view_vouchers_predicate)
# Edit vouchers
change_vouchers_predicate = has_person & (
has_global_perm("paweljong.change_voucher")
| has_any_object("paweljong.change_voucher", Voucher)
)
rules.add_perm("paweljong.change_vouchers_rule", change_vouchers_predicate)
# Delete vouchers
delete_vouchers_predicate = has_person & (
has_global_perm("paweljong.delete_voucher")
| has_any_object("paweljong.delete_voucher", Voucher)
)
rules.add_perm("paweljong.delete_vouchers_rule", delete_vouchers_predicate)
# Create vouchers
create_vouchers_predicate = has_person & (
has_global_perm("paweljong.create_voucher")
| has_any_object("paweljong.create_voucher", Voucher)
)
rules.add_perm("paweljong.create_vouchers_rule", create_vouchers_predicate)
# Edit events
change_events_predicate = has_person & (
has_global_perm("paweljong.change_event") | has_any_object("paweljong.change_event", Event)
)
rules.add_perm("paweljong.change_events_rule", change_events_predicate)
# Delete events
delete_events_predicate = has_person & (
has_global_perm("paweljong.delete_event") | has_any_object("paweljong.delete_event", Event)
)
rules.add_perm("paweljong.delete_events_rule", delete_events_predicate)
# Create events
create_events_predicate = has_person & (
has_global_perm("paweljong.create_event") | has_any_object("paweljong.create_event", Event)
)
rules.add_perm("paweljong.create_events_rule", create_events_predicate)
# Allowed to see group
may_see_group_predicate = has_person & (
is_group_member | has_any_object("core.view_group", Group) | see_group_by_grouptype
)
rules.add_perm("paweljong.may_see_group_rule", may_see_group_predicate)
may_see_person_predicate = has_person & (
see_owned_groups_members | has_object_perm("core.view_person")
)
rules.add_perm("paweljong.see_person_rule", may_see_person_predicate)
# View registrations
view_registrations_predicate = has_person & (
has_global_perm("paweljong.view_eventregistration")
| has_any_object("paweljong.view_eventregistration", EventRegistration)
)
rules.add_perm("paweljong.view_registrations_rule", view_registrations_predicate)
# Manage registrations
manage_registrations_predicate = has_person & (
has_global_perm("paweljong.manage_registration")
| is_own_registration
| has_any_object("paweljong.manage_registration", EventRegistration)
)
rules.add_perm("paweljong.manage_registrations_rule", manage_registrations_predicate)
# Delete registrations
delete_registrations_predicate = has_person & (
has_global_perm("paweljong.delete_eventregistration")
| has_any_object("paweljong.delete_eventregistration", EventRegistration)
)
rules.add_perm("paweljong.delete_registrations_rule", delete_registrations_predicate)
# Is own voucher?
is_own_voucher_predicate = has_person & (is_own_voucher)
rules.add_perm("paweljong.is_own_voucher_rule", is_own_voucher_predicate)
# View feedback aspects
view_feedback_aspects_predicate = has_person & (
has_global_perm("paweljong.view_feedback_aspect")
| has_any_object("paweljong.view_feedback_aspect", FeedbackAspect)
)
rules.add_perm("paweljong.view_feedback_aspects_rule", view_feedback_aspects_predicate)
from django.utils.translation import ugettext_lazy as _
import django_tables2 as tables
from django_tables2.utils import A
class EventsTable(tables.Table):
class Meta:
attrs = {"class": "responsive-table highlight"}
display_name = tables.Column(verbose_name=_("Event"))
date_event = tables.Column(verbose_name=_("Date"))
max_participants = tables.Column(verbose_name=_("Max. participants"))
date_registration = tables.Column(verbose_name=_("Registration until"))
short_name = tables.LinkColumn(
"register_event_by_id",
args=[A("id")],
verbose_name=_("Register"),
text=_("Register"),
)
class ParticipatedEventsTable(tables.Table):
class Meta:
attrs = {"class": "responsive-table highlight"}
display_name = tables.Column(verbose_name=_("Event"))
date_event = tables.Column(verbose_name=_("Date"))
short_name = tables.LinkColumn(
"feedback_event_by_id",
args=[A("id")],
verbose_name=_("Feedback"),
text=_("Feedback"),
)
class ManageEventsTable(tables.Table):
class Meta:
attrs = {"class": "responsive-table highlight"}
display_name = tables.Column(verbose_name=_("Event"))
date_event = tables.Column(verbose_name=_("Date"))
max_participants = tables.Column(verbose_name=_("Max. participants"))
date_registration = tables.Column(verbose_name=_("Registration until"))
short_name = tables.LinkColumn(
"edit_event_by_id", args=[A("id")], verbose_name=_("Edit"), text=_("Edit")
)
class VouchersTable(tables.Table):
class Meta:
attrs = {"class": "responsive-table highlight"}
event = tables.Column(verbose_name=_("Event"))
discount = tables.Column(verbose_name=_("Amount"))
code = tables.Column(verbose_name=_("Code"))
person = tables.Column(verbose_name=_("Person"))
deleted = tables.LinkColumn(
"delete_voucher_by_id",
args=[A("id")],
verbose_name=_("Delete"),
text=_("Delete"),
)
edit = tables.LinkColumn(
"edit_voucher_by_id", args=[A("id")], verbose_name=_("Edit"), text=_("Edit")
)
print_voucher = tables.LinkColumn(
"print_voucher_by_id", args=[A("id")], verbose_name=_("Print"), text=_("Print")
)
class EventRegistrationsTable(tables.Table):
class Meta:
attrs = {"class": "responsive-table highlight"}
person = tables.Column()
event = tables.Column()
date_registred = tables.Column()
view = tables.LinkColumn(
"registration_by_id",
args=[A("id")],
verbose_name=_("View registration"),
text=_("View"),
)
class FeedbackAspectsTable(tables.Table):
class Meta:
attrs = {"class": "responsive-table highlight"}
aspect = tables.Column()
edit = tables.LinkColumn(
"edit_feedback_aspect_by_id",
args=[A("id")],
verbose_name=_("Edit"),
text=_("Edit"),
)
{% extends 'core/base.html' %}
{% load i18n %}
{% block content %}
<p class="flow-text">
{% blocktrans %}Paweljong (Camp/Event management){% endblocktrans %}
</p>
{% endblock %}
{% extends "core/base.html" %}
{% load material_form i18n any_js %}
{% block page_title %}{% blocktrans %}Edit event{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Edit event{% endblocktrans %}{% endblock %}
{% block extra_head %}
{{ edit_event_form.media.css }}
{% include_css "select2-materialize" %}
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{% form form=edit_event_form %}{% form %}
{% include "core/partials/save_button.html" %}
</form>
{% include_js "select2-materialize" %}
{{ edit_event_form.media.js }}
{% endblock %}
{% extends "core/base.html" %}
{% load material_form i18n %}
{% block page_title %}{% blocktrans %}Feedback on an event{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Feedback on an event{% endblocktrans %}{% endblock %}
{% block content %}
<h5>
{% blocktrans %}Feedback on{% endblocktrans %} {{ event.display_name }}
</h5>
<div class="row">
<div class="col s12 m12">
<div class="card info">
<div class="card-content">
<span class="card-title">{% blocktrans %}How does the feedback work?{% endblocktrans %}</span>
<p>
{% blocktrans %}
The feedback consists of three parts.
{% endblocktrans %}
</p>
<ul>
<li>
{% blocktrans %}Evaluation of the program points from 1 (not good) to 5 (very good){% endblocktrans %}
</li>
<li>
{% blocktrans %}Private commentary where you can tell us what you liked, what didn't, what we should do differently, etc.{% endblocktrans %}
</li>
<li>
{% blocktrans %}Comment for the report, which helps us and other children to learn as much as possible about the event. What you have experienced yourself is very interesting for the next participants!{% endblocktrans %}
</li>
</ul>
<p>
{% blocktrans %}Your feedback will be emailed to us. We may contact you again.{% endblocktrans %}
</p>
</div>
</div>
</div>
</div>
<form method="post" enctype="multiform/formdata">
{% csrf_token %}
{% form form=feedback_form %}{% endform %}
{% include "core/partials/save_button.html" %}
</form>
{% endblock %}
{% extends "core/base.html" %}
{% load i18n %}
{% load render_table from django_tables2 %}
{% block page_title %}{% blocktrans %}Events{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Events{% endblocktrans %}{% endblock %}
{% block content %}
<h5>
{% blocktrans %}Upcoming events{% endblocktrans %}
</h5>
{% render_table events_table %}
{% if participated_events_table %}
<h5>
{% blocktrans %}Events you've taken part{% endblocktrans %}
</h5>
{% render_table participated_events_table %}
{% endif %}
{% endblock %}
{% extends "core/base.html" %}
{% load i18n %}
{% load render_table from django_tables2 %}
{% block page_title %}{% blocktrans %}Manage events{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Manage events{% endblocktrans %}{% endblock %}
{% block content %}
<h5>
{% blocktrans %}Upcoming events{% endblocktrans %}
</h5>
{% render_table object_list %}
{% endblock %}
{% extends "core/base.html" %}
{% load material_form i18n %}
{% block page_title %}{% blocktrans %}Event registration{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Event registration{% endblocktrans %}{% endblock %}
{% block content %}
<h5>
{% blocktrans %}Registration for{% endblocktrans %} {{ event.display_name }}
</h5>
<div class="row">
<div class="col s12 m6">
<div class="card info">
<div class="card-content">
<span class="card-title">{% blocktrans %}Information for parents{% endblocktrans %}</span>
<p>
{% blocktrans %}
Please go through the registration with your child. It is important
to us to train important skills in dealing with the Internet and
responsibility in general with the registration.
{% endblocktrans %}
</p>
</div>
<div class="card-content">
<span class="card-title">{% blocktrans %}Information for children{% endblocktrans %}</span>
<p>
{% blocktrans %}
Please read everything carefully with your parents and then send your
registration together with them!
{% endblocktrans %}
</p>
</div>
</div>
</div>
<div class="col s12 m6">
<div class="card info">
<div class="card-content">
<span class="card-title">{% blocktrans %}Information about the event{% endblocktrans %}</span>
<p>
{% blocktrans %}
Please read the
{% endblocktrans %}
<a href="{{ event.website }}">
{% blocktrans %}
website of the event
{% endblocktrans %}
</a>
{% blocktrans %}
carefully together with your parents.
{% endblocktrans %}
</p>
<ul>
<li>
{% blocktrans %}
The event will take place from
{% endblocktrans %}
{{ event.date_event }}
{% blocktrans %}
at
{% endblocktrans %}
{{ event.l }}
</li>
<li>
{% blocktrans %}
Registration is possible until
{% endblocktrans %}
{{ event.date_registration }};
{% blocktrans %}
the number of participants is limited to
{% endblocktrans %}
{{ event.max_participants }}
{% blocktrans %}
participants
{% endblocktrans %}.
</li>
<li>
{% blocktrans %}
The participation fee is
{% endblocktrans %}
{{ event.cost }} €
{% blocktrans %}
and must be paid in advance and within 7 days after receipt of the
invoice. Cancellation with reimbursement is possible until
{% endblocktrans %}
{{ event.date_retraction }}
{% blocktrans %}
and only for good reason.
{% endblocktrans %}
</li>
</ul>
</div>
</div>
</div>
</div>
<form method="post">
{% csrf_token %}
{% form form=register_form %}{% endform %}
{% include "core/partials/save_button.html" %}
</form>
{% endblock %}
{% extends "ticdesk/base_with_info_sidebar.html" %}
{% load i18n %}
{% block page_title %}{% blocktrans %}Zusätzliche Angaben zur Veranstaltungsanmeldung{% endblocktrans %}{% endblock %}
{% block content_info_children %}
{% blocktrans %}
Bitte lies dir mit deinen Eltern gemeinsam alles genau durch und schicke
deine Anmeldung dann mit ihnen gemeinsam ab!
{% endblocktrans %}
{% endblock %}
{% block content_info_parents %}
{% blocktrans %}
Bitte gehen Sie die Anmeldung mit Ihrem Kind gemeinsam durch. Uns ist es
wichtig, schon mit der Anmeldung wichtige Kompetenzen im Umgang mit dem
Internet und Verantwortung im Allgemeinen zu trainieren.
{% endblocktrans %}
{% endblock %}
{% block content %}
<h5>
{% blocktrans %}Zusätzliche Angaben zu{% endblocktrans %} {{ event.display_name }}
</h5>
{% if error %}
<div class="alert alert-danger">
<div class="alert-heading">
{% blocktrans %}Fehler{% endblocktrans %}
</div>
<hr>
<p>
{{ error }}
</p>
</div>
{% elif success %}
<div class="alert alert-success">
<div class="alert-heading">
{% blocktrans %}Anmeldung erfolgreich{% endblocktrans %}
</div>
<hr>
<p>
{% blocktrans %}
Du hast deien Angaben erfolgreich eingesendet.
{% endblocktrans %}
</p>
</div>
{% else %}
<form method="post">
{% csrf_token %}
{% bootstrap_form register_form %}
<input type="submit" value="{% blocktrans %}Absenden{% endblocktrans %}" />
</form>
{% endif %}
{% endblock %}
{# -*- engine:django -*- #}
{% extends "core/base.html" %}
{% load i18n static rules material_form %}
{% load render_table from django_tables2 %}
{% block browser_title %}Event registration {{ registration }}{% endblock %}
{% block content %}
<h4>{{ registration }} </h4>
{% has_perm 'ticdesk.manage_registration' user registration as can_manage_registration %}
{% has_perm 'ticdesk.delete_registration' user registration as can_delete_registration %}
{% if can_manage_registration or can_manage_registration_preferences or can_delete_registration %}
<p>
{% if can_manage_registration %}
<a href="{% url 'edit_registration_by_id' registration.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
{% endif %}
{% if can_delete_registration %}
<a href="{% url 'delete_registration_by_id' registration.id %}" class="btn waves-effect waves-light red">
<i class="material-icons left">delete</i>
{% trans "Delete" %}
</a>
{% endif %}
</p>
{% endif %}
<h5>{% blocktrans %}Contact details{% endblocktrans %}</h5>
<div class="row">
<div class="col s12 m4">
{% has_perm 'core.view_photo' user registration.person as can_view_photo %}
{% if registration.person.photo and can_view_photo %}
<img class="person-img" src="{{ registration.person.photo.url }}"
alt="{{ registration.person.first_name }} {{ registration.person.last_name }}"/>
{% else %}
<img class="person-img" src="{% static 'img/fallback.png' %}"
alt="{{ registration.person.first_name }} {{ registration.person.last_name }}"/>
{% endif %}
</div>
<div class="col s12 m8">
<table class="responsive-table highlight">
<tr>
<td rowspan="6">
</td>
<td>
<i class="material-icons small">person</i>
</td>
<td>{{ registration.person.first_name }}</td>
<td>{{ registration.person.additional_name }}</td>
<td>{{ registration.person.last_name }}</td>
</tr>
<tr>
<td>
<i class="material-icons small">face</i>
</td>
<td colspan="3">{{ registration.person.get_sex_display }}</td>
</tr>
{% has_perm 'core.view_address' user registration.person as can_view_address %}
{% if can_view_address %}
<tr>
<td>
<i class="material-icons small">home</i>
</td>
<td colspan="2">{{ registration.person.street }} {{ registration.person.housenumber }}</td>
<td colspan="2">{{ registration.person.postal_code }} {{ registration.person.place }}</td>
</tr>
{% endif %}
{% has_perm 'core.view_contact_details' user registration.person as can_view_contact_details %}
{% if can_view_contact_details %}
<tr>
<td>
<i class="material-icons small">phone</i>
</td>
<td>{{ registration.person.phone_number }}</td>
<td>{{ registration.person.mobile_number }}</td>
</tr>
<tr>
<td>
<i class="material-icons small">email</i>
</td>
<td colspan="3">{{ registration.person.email }}</td>
</tr>
{% endif %}
{% has_perm 'core.view_personal_details' user registration.person as can_view_personal_details %}
{% if can_view_personal_details %}
<tr>
<td>
<i class="material-icons small">cake</i>
</td>
<td colspan="3">{{ registration.person.date_of_birth|date }}</td>
</tr>
{% endif %}
</table>
</div>
<div class="col s12 m12">
<h5>{% trans "Registration information" %}</h5>
<table>
<tr>
<td>
<i class="material-icons small">local_activity</a>
</td>
<td colspan="3"><a href="{% url 'edit_event_by_id' registration.event.id %}">{{ registration.event }}</a></td>
</tr>
<tr>
<td>
<i class="material-icons small">redeem</a>
</td>
<td colspan="3">{{ registration.donation }}</td>
</tr>
<tr>
<td>
<i class="material-icons small">payment</a>
</td>
<td>{% trans "SEPA direct debit" %}: {{ registration.accept_sepa }}</td>
{% if registration.accept_sepa %}
<td>{% trans "IBAN" %}: {{ registration.iban }}</td>
{% endif %}
</tr>
</table>
</p>
</div>
</div>
{% if registration.person.guardians.all and can_view_personal_details %}
<h5>{% trans "Guardians / Parents "%}</h5>
{% for person in registration.person.guardians.all %}
<div class="col s12 m8">
<table class="responsive-table highlight">
<tr>
<td rowspan="6">
</td>
<td>
<i class="material-icons small">person</i>
</td>
<td>{{ person.first_name }}</td>
<td>{{ person.additional_name }}</td>
<td>{{ person.last_name }}</td>
</tr>
<tr>
<td>
<i class="material-icons small">face</i>
</td>
<td colspan="3">{{ person.get_sex_display }}</td>
</tr>
{% has_perm 'core.view_address' user person as can_view_address %}
{% if can_view_address %}
<tr>
<td>
<i class="material-icons small">home</i>
</td>
<td colspan="2">{{ person.street }} {{ person.housenumber }}</td>
<td colspan="2">{{ person.postal_code }} {{ person.place }}</td>
</tr>
{% endif %}
{% has_perm 'core.view_contact_details' user person as can_view_contact_details %}
{% if can_view_contact_details %}
<tr>
<td>
<i class="material-icons small">phone</i>
</td>
<td>{{ person.phone_number }}</td>
<td>{{ person.mobile_number }}</td>
</tr>
<tr>
<td>
<i class="material-icons small">email</i>
</td>
<td colspan="3">{{ person.email }}</td>
</tr>
{% endif %}
{% has_perm 'core.view_personal_details' user person as can_view_personal_details %}
{% if can_view_personal_details %}
<tr>
<td>
<i class="material-icons small">cake</i>
</td>
<td colspan="3">{{ person.date_of_birth|date }}</td>
</tr>
{% endif %}
</table>
</div>
{% endfor %}
{% endif %}
{% endblock %}
{% extends "core/base.html" %}
{% load material_form i18n %}
{% load render_table from django_tables2 %}
{% block page_title %}{% blocktrans %}Registrations{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Registrations{% endblocktrans %}{% endblock %}
{% block content %}
<h5>{% trans "Filter registrations" %}</h5>
<form method="get">
{% form form=registrations_filter.form %}{% endform %}
{% trans "Search" as caption %}
{% include "core/partials/save_button.html" with caption=caption icon="search" %}
<button type="reset" class="btn red waves-effect waves-light">
<i class="material-icons left">clear</i>
{% trans "Clear" %}
</button>
</form>
<h5>{% trans "Selected registrations" %}</h5>
{% render_table registrations_table %}
{% endblock %}
{% extends "core/base.html" %}
{% load material_form i18n %}
{% block page_title %}{% blocktrans %}Edit feedback aspect{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Edit feedback aspect{% endblocktrans %}{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{% form form=edit_feedback_aspect_form %}{% endform %}
{% include "core/partials/save_button.html" %}
</form>
{% endblock %}
{% extends "core/base.html" %}
{% load material_form i18n %}
{% load render_table from django_tables2 %}
{% block page_title %}{% blocktrans %}Feedback aspects{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}Feedback aspects{% endblocktrans %}{% endblock %}
{% block content %}
<h5>{% trans "Filter feedback_aspects" %}</h5>
<form method="get">
{% form form=feedback_aspects_filter.form %}{% endform %}
{% trans "Search" as caption %}
{% include "core/partials/save_button.html" with caption=caption icon="search" %}
<button type="reset" class="btn red waves-effect waves-light">
<i class="material-icons left">clear</i>
{% trans "Clear" %}
</button>
<a class="btn colour-primary waves-effect waves-light" href="{% url 'create_feedback_aspect' %}">{% trans "Create feedback aspect" %}</a>
</form>
<h5>{% blocktrans %}Selected feedback aspects{% endblocktrans %}</h5>
{% render_table feedback_aspects_table %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment