from onegov.core.security import Private
from onegov.form import FormDefinition
from onegov.form import FormRegistrationWindow
from onegov.org.forms.form_registration import FormRegistrationMessageForm
from onegov.org.views.form_registration_window import (
handle_new_registration_form, view_registration_window,
handle_edit_registration_form, view_send_form_registration_message)
from onegov.town6 import TownApp
from onegov.org.forms import FormRegistrationWindowForm
from onegov.town6.layout import FormSubmissionLayout
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from onegov.core.types import RenderData
from onegov.town6.request import TownRequest
from webob import Response
@TownApp.form(
model=FormDefinition,
name='new-registration-window',
permission=Private,
form=FormRegistrationWindowForm,
template='form.pt'
)
@TownApp.form(
model=FormRegistrationWindow,
permission=Private,
name='send-message',
template='form.pt',
form=FormRegistrationMessageForm
)
@TownApp.html(
model=FormRegistrationWindow,
permission=Private,
template='registration_window.pt'
)
[docs]
def town_view_registration_window(
self: FormRegistrationWindow,
request: 'TownRequest'
) -> 'RenderData':
return view_registration_window(
self, request, FormSubmissionLayout(self.form, request))
@TownApp.form(
model=FormRegistrationWindow,
permission=Private,
form=FormRegistrationWindowForm,
template='form.pt',
name='edit'
)