Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pretix public registrations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIF
Pretix public registrations
Commits
7a00f9cd
Commit
7a00f9cd
authored
5 years ago
by
Felix Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
Make showing name and product optional
parent
36ca2426
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pretix_public_registrations/forms.py
+8
-0
8 additions, 0 deletions
pretix_public_registrations/forms.py
pretix_public_registrations/signals.py
+12
-2
12 additions, 2 deletions
pretix_public_registrations/signals.py
with
20 additions
and
2 deletions
pretix_public_registrations/forms.py
+
8
−
0
View file @
7a00f9cd
...
@@ -20,6 +20,14 @@ class PublicRegistrationsForm(SettingsForm):
...
@@ -20,6 +20,14 @@ class PublicRegistrationsForm(SettingsForm):
required
=
True
,
required
=
True
,
choices
=
[],
choices
=
[],
)
)
public_registrations_show_attendee_name
=
forms
.
BooleanField
(
label
=
_
(
'
Show attendee name
'
),
required
=
False
,
)
public_registrations_show_item_name
=
forms
.
BooleanField
(
label
=
_
(
'
Show product name
'
),
required
=
False
,
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
pretix_public_registrations/signals.py
+
12
−
2
View file @
7a00f9cd
...
@@ -13,6 +13,8 @@ from pretix.base.settings import settings_hierarkey
...
@@ -13,6 +13,8 @@ from pretix.base.settings import settings_hierarkey
settings_hierarkey
.
add_default
(
'
public_registrations_items
'
,
None
,
list
)
settings_hierarkey
.
add_default
(
'
public_registrations_items
'
,
None
,
list
)
settings_hierarkey
.
add_default
(
'
public_registrations_questions
'
,
None
,
list
)
settings_hierarkey
.
add_default
(
'
public_registrations_questions
'
,
None
,
list
)
settings_hierarkey
.
add_default
(
'
public_registrations_show_attendee_name
'
,
False
,
bool
)
settings_hierarkey
.
add_default
(
'
public_registrations_show_item_name
'
,
False
,
bool
)
@receiver
(
html_head
,
dispatch_uid
=
"
public_registrations_html_head
"
)
@receiver
(
html_head
,
dispatch_uid
=
"
public_registrations_html_head
"
)
...
@@ -49,7 +51,11 @@ def add_public_registrations_table(sender, **kwargs):
...
@@ -49,7 +51,11 @@ def add_public_registrations_table(sender, **kwargs):
if
cached
is
None
:
if
cached
is
None
:
cached
=
""
cached
=
""
public_questions
=
sender
.
questions
.
filter
(
pk__in
=
sender
.
settings
.
get
(
'
public_registrations_questions
'
))
public_questions
=
sender
.
questions
.
filter
(
pk__in
=
sender
.
settings
.
get
(
'
public_registrations_questions
'
))
headers
=
[
_
(
"
Name
"
)]
+
[
headers
=
(
[
_
(
"
Product
"
)]
if
sender
.
settings
.
get
(
'
public_registrations_show_item_name
'
)
else
[]
)
+
(
[
_
(
"
Name
"
)]
if
sender
.
settings
.
get
(
'
public_registrations_show_attendee_name
'
)
else
[]
)
+
[
q
.
question
for
q
in
public_questions
q
.
question
for
q
in
public_questions
]
]
order_positions
=
OrderPosition
.
objects
.
filter
(
order__event
=
sender
,
item__pk__in
=
sender
.
settings
.
get
(
'
public_registrations_items
'
))
order_positions
=
OrderPosition
.
objects
.
filter
(
order__event
=
sender
,
item__pk__in
=
sender
.
settings
.
get
(
'
public_registrations_items
'
))
...
@@ -67,7 +73,11 @@ def add_public_registrations_table(sender, **kwargs):
...
@@ -67,7 +73,11 @@ def add_public_registrations_table(sender, **kwargs):
public_registrations
=
[
public_registrations
=
[
{
{
'
gr_url
'
:
get_gravatar_url
(
pop
.
attendee_email
,
size
=
24
,
default
=
"
wavatar
"
),
'
gr_url
'
:
get_gravatar_url
(
pop
.
attendee_email
,
size
=
24
,
default
=
"
wavatar
"
),
'
fields
'
:
[
pop
.
attendee_name_cached
]
+
[
'
fields
'
:
(
[
pop
.
item
.
name
]
if
sender
.
settings
.
get
(
'
public_registrations_show_item_name
'
)
else
[]
)
+
(
[
pop
.
attendee_name_cached
]
if
sender
.
settings
.
get
(
'
public_registrations_show_attendee_name
'
)
else
[]
)
+
[
public_answers
[
pop
.
pk
][
pq
.
pk
].
answer
if
public_answers
.
get
(
pop
.
pk
,
None
)
and
public_answers
[
pop
.
pk
].
get
(
pq
.
pk
,
None
)
else
''
public_answers
[
pop
.
pk
][
pq
.
pk
].
answer
if
public_answers
.
get
(
pop
.
pk
,
None
)
and
public_answers
[
pop
.
pk
].
get
(
pq
.
pk
,
None
)
else
''
for
pq
in
public_questions
for
pq
in
public_questions
]
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment