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

Update texts

parent 5498dc97
No related branches found
No related tags found
1 merge request!1Reformat and cleanup
......@@ -54,7 +54,7 @@
</div>
</div>
<div class="card-action">
<a href="{% url "register_event_by_name" event.linked_group.name %}">{% trans "Register now" %}</a>
<a href="{% url "register_event_by_slug_start" event.linked_group.short_name %}">{% trans "Register now" %}</a>
</div>
</div>
......
......@@ -17,6 +17,7 @@
<i class="material-icons left">clear</i>
{% trans "Clear" %}
</button>
<a class="btn colour-primary waves-effect waves-light" href="{% url 'create_event' %}">{% trans "Create event" %}</a>
</form>
<h5>{% trans "Selected events" %}</h5>
......
......@@ -17,7 +17,39 @@
{{ event.display_name }}
</span>
<p>
Hier könnte Ihr Erklärungstext stehen…
{% blocktrans %}
Welcome to the registration for this event! Please make sure to fill in
the registration yourself, as the child who wants to participate.
You should fill in the registration together with a parent (or other legal
guardian).
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
We ask parents to not fill in the registration on behalf of their child.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
Every participant needs a personal e-mail address. This address must be one
that you, the participating child, check and read yourself, not one owned by your
parents. Of course, we will always send important information to your parents as well.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
If you do not have a personal e-mail address yet, and do not want or cannot register
one with one of the "big" providers (keep in mind that Google, Outlook, etc. are
allowed from 16 years only, and often collect and analyse your private mail), you can
register an e-mail address with us.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
If you already have a user account with Teckids, do not register a new one. Login
with your existing username and password. If you have forgotten your password, please
send us an e-mail (pelase do this yourself, with the help of your parents, if needed).
{% endblocktrans %}
</p>
</div>
</div>
......@@ -32,12 +64,12 @@
</li>
<li class="tab">
<a href="#without_email">
{% trans "I have an email address" %}
{% trans "I have a personal email address" %}
</a>
</li>
<li class="tab">
<a href="#with_email">
{% trans "I don't have an email address" %}
{% trans "I don't have a personal email address" %}
</a>
</li>
{% else %}
......@@ -49,16 +81,31 @@
<div class="card-content grey lighten-4">
{% if can_register %}
<div id="already_registered">
<p>Ick hab schon nen Account, hier einloggen, blafoo und so</p>
<a href="{% url "login" %}?next=/app/paweljong/event/{{ event.id }}/register">{% trans "Login" %}</a>
</div>
<div id="without_email">
<p>Lorem Ipsum dolor sit amet (Braucht keine Mail)</p>
<a href="{% url "register_event_by_id" event.id %}">{% trans "Register now" %}</a>
<p>
{% blocktrans %}
If you already have a Teckids account, please login here. If you forgot your password,
or have problems logging in, please send us an e-mail.
{% endblocktrans %}
</p>
<a href="{% url "login" %}?next=/app/paweljong/event/{{ event.linked_group.short_name }}/register">{% trans "Login" %}</a>
</div>
<div id="with_email">
<p>Lorem Ipsum dolor sit amet (Braucht Mail)</p>
<a href="{% url "set_email_needed" event.id %}">{% trans "Register now" %}</a>
<p>
{% blocktrans %}
You can now choose a personal e-mail address hosted on our servers.
{% endblocktrans %}
</p>
<a href="{% url "set_email_needed" event.linked_group.short_name %}">{% trans "Register now" %}</a>
</div>
<div id="without_email">
<p>
{% blocktrans %}
You will be asked for your existing, personal e-mail address. Please remember
that you should not use an address owned by your parents. If you do not have
a personal e-mail address, please choose the respective option instead!
{% endblocktrans %}
</p>
<a href="{% url "register_event_by_slug" event.linked_group.short_name %}">{% trans "Register now" %}</a>
</div>
{% else %}
<div id="not_possible">
......
......@@ -98,6 +98,15 @@
<td colspan="3">{{ registration.person.date_of_birth|date }}</td>
</tr>
{% endif %}
<tr>
<td></td>
<td>
<i class="material-icons small">school</i>
</td>
<td>{{ registration.school_class }}</td>
<td>{{ registration.school }}</td>
<td>{{ registration.school_place }}</td>
</tr>
</table>
</div>
<div class="col s12 m12">
......@@ -107,7 +116,7 @@
<td>
<i class="material-icons small">local_activity</a>
</td>
<td colspan="3"><a href="{% url 'edit_event_by_pk' registration.event.pk %}">{{ registration.event }}</a></td>
<td colspan="3"><a href="{% url 'edit_event_by_slug' registration.event.linked_group.short_name %}">{{ registration.event }}</a></td>
</tr>
<tr>
<td>
......@@ -142,7 +151,7 @@
<i class="material-icons small">medical_services</i>
</td>
<td>
{{ medical_information }}
{{ registration.medical_information }}
</td>
</tr>
</tr>
......@@ -152,7 +161,7 @@
<i class="material-icons small">question_answer</i>
</td>
<td>
{{ comment }}
{{ registration.comment }}
</td>
</tr>
</tr>
......
......@@ -8,19 +8,7 @@
{% 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 %}
{% render_table table %}
{% endblock %}
......@@ -25,7 +25,7 @@ from aleksis.core.models import Activity, Person
from aleksis.core.util import messages
from aleksis.core.util.core_helpers import lazy_preference, objectgetter_optional
from .filters import EventFilter, EventRegistrationFilter, VoucherFilter
from .filters import EventFilter, EventRegistrationFilter, VoucherFilter, TermsFilter
from .forms import (
EditEventForm,
EditEventRegistrationForm,
......@@ -33,20 +33,21 @@ from .forms import (
EditVoucherForm,
EventFeedbackForm,
GenerateListForm,
EditTermForm,
)
from .models import Event, EventRegistration, FeedbackAspect, Voucher
from .tables import EventRegistrationsTable, FeedbackAspectsTable, ManageEventsTable, VouchersTable
from .models import Event, EventRegistration, FeedbackAspect, Voucher, Terms
from .tables import EventRegistrationsTable, FeedbackAspectsTable, ManageEventsTable, VouchersTable, TermsTable
User = get_user_model()
@login_required
def feedback_event(request, pk):
def feedback_event(request, slug):
context = {}
# Get current person and event
current_person = Person.objects.get(user__username=request.user.username)
event = Event.objects.get(id=pk)
current_person = request.user.person
event = Event.objects.get(linked_group__short_name=slug)
context["event"] = event
# Prepare the form
......@@ -111,6 +112,7 @@ class CreateEventView(PermissionRequiredMixin, AdvancedCreateView):
class EditEventView(PermissionRequiredMixin, RevisionMixin, AdvancedEditView):
form_class = EditEventForm
model = Event
slug_field = "linked_group__short_name"
permission_required = "paweljong.change_event"
context_object_name = "manage_events"
template_name = "paweljong/event/edit.html"
......@@ -361,10 +363,10 @@ def is_person_anonymous(wizard):
return wizard.request.user.is_anonymous
def set_email_needed(request, pk):
def set_email_needed(request, slug):
request.session["email_needed"] = "true"
return redirect("register_event_by_id", pk)
return redirect("register_event_by_slug", slug)
def is_email_needed(wizard):
......@@ -379,7 +381,7 @@ class RegisterEventWizardView(SessionWizardView):
def get_context_data(self, form, **kwargs):
context = super().get_context_data(form, **kwargs)
context["event"] = Event.objects.get(id=self.kwargs["pk"])
context["event"] = Event.objects.get(linked_group__short_name=self.kwargs["slug"])
if self.steps.current == "email":
context["page_title"] = ""
......@@ -399,7 +401,7 @@ class RegisterEventWizardView(SessionWizardView):
context["browser_title"] = ""
context["info_title"] = _("Contact information")
context["info_text"] = _("Tell us how we can contact you. You will receive information about "
"the event by e-mail. Please use your personal e-mail address ",
"the event by e-mail. Please use your personal e-mail address "
"where you will read mails yourself, not an address of your parents. "
"We will always send all important information to your parents as well, "
"and you will enter their e-mail address on the next page.")
......@@ -438,8 +440,8 @@ class RegisterEventWizardView(SessionWizardView):
kwargs = super().get_form_kwargs()
if step == "email":
kwargs["request"] = self.request
if step == "additional":
event = Event.objects.get(id=self.kwargs["pk"])
if step == "additional" or step == "consent":
event = Event.objects.get(linked_group__short_name=self.kwargs["slug"])
kwargs["event"] = event
return kwargs
......@@ -509,7 +511,7 @@ class RegisterEventWizardView(SessionWizardView):
def done(self, form_list, **kwargs):
event = Event.objects.get(id=self.kwargs["pk"])
event = Event.objects.get(linked_group__short_name=self.kwargs["slug"])
cleaned_data_email = self.get_cleaned_data_for_step("email")
cleaned_data_contact_details = self.get_cleaned_data_for_step("contact_details")
cleaned_data_guardians = self.get_cleaned_data_for_step("guardians")
......@@ -536,7 +538,7 @@ class RegisterEventWizardView(SessionWizardView):
else:
user = self.request.user
person = Person.objects.get_or_create(
person, created = Person.objects.get_or_create(
user=user,
defaults={
"email": cleaned_data_contact_details["email"],
......@@ -546,17 +548,10 @@ class RegisterEventWizardView(SessionWizardView):
)
if (
"school" in cleaned_data_contact_details
or "school_class" in cleaned_data_contact_details
or "school_place" in cleaned_data_contact_details
or "mobile_number" in cleaned_data_contact_details
"mobile_number" in cleaned_data_contact_details
or "sex" in cleaned_data_contact_details
or "date_of_birth" in cleaned_data_contact_details
):
person = Person.objects.get(email=cleaned_data_contact_details["email"])
person.school = cleaned_data_contact_details["school"]
person.school_class = cleaned_data_contact_details["school_class"]
person.school_place = cleaned_data_contact_details["school_place"]
person.mobile_number = cleaned_data_contact_details["mobile_number"]
person.sex = cleaned_data_contact_details["sex"]
person.date_of_birth = cleaned_data_contact_details["date_of_birth"]
......@@ -610,14 +605,18 @@ class RegisterEventWizardView(SessionWizardView):
donation=cleaned_data_financial["donation"],
accept_sepa=cleaned_data_financial["accept_sepa"],
iban=cleaned_data_financial["iban"],
accept_terms=cleaned_data_consent["accept_terms"],
accept_data=cleaned_data_consent["accept_data"],
accept_general_terms=cleaned_data_consent["accept_general_terms"],
school = cleaned_data_contact_details["school"],
school_class = cleaned_data_contact_details["school_class"],
school_place = cleaned_data_contact_details["school_place"],
)
for field in event.linked_group.additional_fields.all():
registration.extended_data[
slugify(field.title).replace("-", "_")
] = cleaned_data_additional[field.title]
for field in event.terms.all():
registration.extended_data[slugify(field.title).replace("-", "_")] = cleaned_data_consent[field.title]
registration.save()
if cleaned_data_financial["voucher_code"] != "":
......@@ -671,7 +670,7 @@ class RegisterEventWizardView(SessionWizardView):
class EventFullView(DetailView):
model = Event
slug_field = "linked_group__name"
slug_field = "linked_group__short_name"
template_name = "paweljong/event/full.html"
object_context_name = "event"
......@@ -684,7 +683,7 @@ class EventFullView(DetailView):
class RegisterEventStart(DetailView):
model = Event
slug_field = "linked_group__name"
slug_field = "linked_group__short_name"
template_name = "paweljong/event/register_start.html"
object_context_name = "event"
......@@ -693,3 +692,35 @@ class RegisterEventStart(DetailView):
context["can_register"] = context["event"].can_register(request=self.request)
return context
class TermListView(PermissionRequiredMixin, SingleTableView):
"""Table of all terms."""
model = Terms
table_class = TermsTable
permission_required = "paweljong.view_terms"
template_name = "paweljong/term/list.html"
@method_decorator(never_cache, name="dispatch")
class TermCreateView(PermissionRequiredMixin, AdvancedCreateView):
"""Create view for terms."""
model = Terms
form_class = EditTermForm
permission_required = "paweljong.add_terms"
template_name = "paweljong/term/create.html"
success_url = reverse_lazy("terms")
success_message = _("The term has been created.")
@method_decorator(never_cache, name="dispatch")
class TermEditView(PermissionRequiredMixin, AdvancedEditView):
"""Edit view for terms."""
model = Terms
form_class = EditTermForm
permission_required = "paweljong.edit_terms"
template_name = "paweljong/term/edit.html"
success_url = reverse_lazy("terms")
success_message = _("The term has been saved.")
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