Skip to content

Commit aabfd28

Browse files
authored
Merge branch 'enext' into 1079_unify_event_page
2 parents d423e24 + 0e51f13 commit aabfd28

File tree

28 files changed

+643
-142
lines changed

28 files changed

+643
-142
lines changed

app/Dockerfile.prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ RUN mkdir $APP_HOME/static
6262
WORKDIR $APP_HOME
6363

6464
# install dependencies
65-
RUN apt-get update && apt-get install -y --no-install-recommends netcat-traditional nodejs
65+
RUN apt-get update && apt-get install -y --no-install-recommends netcat-traditional nodejs gettext
6666

6767
# copy entrypoint.prod.sh
6868
COPY ./entrypoint.prod.sh .

app/entrypoint.prod.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ done
88

99
echo "PostgreSQL started"
1010

11+
echo "============== compiling translation messages ================"
12+
python manage.py compilemessages
1113
echo "============== running collectstatic ================"
1214
python manage.py collectstatic --noinput
1315
echo "============== running compress ====================="

app/eventyay/api/serializers/waitinglist.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Meta:
1515
'email',
1616
'phone',
1717
'voucher',
18-
'item',
18+
'product',
1919
'variation',
2020
'locale',
2121
'subevent',
@@ -32,19 +32,19 @@ def validate(self, data):
3232

3333
WaitingListEntry.clean_duplicate(
3434
full_data.get('email'),
35-
full_data.get('item'),
35+
full_data.get('product'),
3636
full_data.get('variation'),
3737
full_data.get('subevent'),
3838
self.instance.pk if self.instance else None,
3939
)
40-
WaitingListEntry.clean_itemvar(event, full_data.get('item'), full_data.get('variation'))
40+
WaitingListEntry.clean_productvar(event, full_data.get('product'), full_data.get('variation'))
4141
WaitingListEntry.clean_subevent(event, full_data.get('subevent'))
4242

43-
if 'item' in data or 'variation' in data:
43+
if 'product' in data or 'variation' in data:
4444
availability = (
4545
full_data.get('variation').check_quotas(count_waitinglist=True, subevent=full_data.get('subevent'))
4646
if full_data.get('variation')
47-
else full_data.get('item').check_quotas(count_waitinglist=True, subevent=full_data.get('subevent'))
47+
else full_data.get('product').check_quotas(count_waitinglist=True, subevent=full_data.get('subevent'))
4848
)
4949
if availability[0] == 100:
5050
raise ValidationError('This product is currently available.')

app/eventyay/base/models/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@
161161
"InvoiceAddress",
162162
"InvoiceLine",
163163
"InvoiceVoucher",
164-
"Item",
165-
"ItemAddOn",
166-
"ItemBundle",
167-
"ItemCategory",
168-
"ItemMetaProperty",
169-
"ItemMetaValue",
170-
"ItemVariation",
164+
"Product",
165+
"ProductAddOn",
166+
"ProductBundle",
167+
"ProductCategory",
168+
"ProductMetaProperty",
169+
"ProductMetaValue",
170+
"ProductVariation",
171171
"JanusServer",
172172
"LogEntry",
173173
"LogMixin",
@@ -220,8 +220,8 @@
220220
"SpeakerProfile",
221221
"StreamingServer",
222222
"SubEvent",
223-
"SubEventItem",
224-
"SubEventItemVariation",
223+
"SubEventProduct",
224+
"SubEventProductVariation",
225225
"SubEventMetaValue",
226226
"Submission",
227227
"SubmissionComment",

app/eventyay/base/models/product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def save(self, *args, **kwargs):
170170

171171
def filter_available(qs, channel='web', voucher=None, allow_addons=False):
172172
q = (
173-
# IMPORTANT: If this is updated, also update the ItemVariation query
173+
# IMPORTANT: If this is updated, also update the ProductVariation query
174174
# in models/event.py: EventMixin.annotated()
175175
Q(active=True)
176176
& Q(Q(available_from__isnull=True) | Q(available_from__lte=now()))

app/eventyay/base/pdf.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@
7676
},
7777
),
7878
(
79-
'item',
79+
'product',
8080
{
8181
'label': _('Product name'),
8282
'editor_sample': _('Sample product'),
83-
'evaluate': lambda orderposition, order, event: str(orderposition.item.name),
83+
'evaluate': lambda orderposition, order, event: str(orderposition.product.name),
8484
},
8585
),
8686
(
@@ -92,44 +92,44 @@
9292
},
9393
),
9494
(
95-
'item_description',
95+
'product_description',
9696
{
9797
'label': _('Product description'),
9898
'editor_sample': _('Sample product description'),
99-
'evaluate': lambda orderposition, order, event: str(orderposition.item.description),
99+
'evaluate': lambda orderposition, order, event: str(orderposition.product.description),
100100
},
101101
),
102102
(
103-
'itemvar',
103+
'productvar',
104104
{
105105
'label': _('Product name and variation'),
106106
'editor_sample': _('Sample product – sample variation'),
107107
'evaluate': lambda orderposition, order, event: (
108-
'{} - {}'.format(orderposition.item.name, orderposition.variation)
108+
'{} - {}'.format(orderposition.product.name, orderposition.variation)
109109
if orderposition.variation
110-
else str(orderposition.item.name)
110+
else str(orderposition.product.name)
111111
),
112112
},
113113
),
114114
(
115-
'itemvar_description',
115+
'productvar_description',
116116
{
117117
'label': _('Product variation description'),
118118
'editor_sample': _('Sample product variation description'),
119119
'evaluate': lambda orderposition, order, event: (
120120
str(orderposition.variation.description)
121121
if orderposition.variation
122-
else str(orderposition.item.description)
122+
else str(orderposition.product.description)
123123
),
124124
},
125125
),
126126
(
127-
'item_category',
127+
'product_category',
128128
{
129129
'label': _('Product category'),
130130
'editor_sample': _('Ticket category'),
131131
'evaluate': lambda orderposition, order, event: (
132-
str(orderposition.item.category.name) if orderposition.item.category else ''
132+
str(orderposition.product.category.name) if orderposition.product.category else ''
133133
),
134134
},
135135
),
@@ -466,11 +466,11 @@
466466
'editor_sample': _('Add-on 1\nAdd-on 2'),
467467
'evaluate': lambda op, order, ev: '\n'.join(
468468
[
469-
'{} - {}'.format(p.item, p.variation) if p.variation else str(p.item)
469+
'{} - {}'.format(p.product, p.variation) if p.variation else str(p.product)
470470
for p in (
471471
op.addons.all()
472472
if 'addons' in getattr(op, '_prefetched_objects_cache', {})
473-
else op.addons.select_related('item', 'variation')
473+
else op.addons.select_related('product', 'variation')
474474
)
475475
if not p.canceled
476476
]
@@ -800,8 +800,8 @@ def _get_text_content(self, op: OrderPosition, order: Order, o: dict, inner=Fals
800800
return '(error)'
801801
if o['content'] == 'other':
802802
return o['text']
803-
elif o['content'].startswith('itemmeta:'):
804-
return op.item.meta_data.get(o['content'][9:]) or ''
803+
elif o['content'].startswith('productmeta:'):
804+
return op.product.meta_data.get(o['content'][12:]) or ''
805805
elif o['content'].startswith('meta:'):
806806
return ev.meta_data.get(o['content'][5:]) or ''
807807
elif o['content'] in self.variables:

app/eventyay/control/templates/pretixcontrol/base.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,14 @@
9191
data-payment-weekdays-disabled="{{ js_payment_weekdays_disabled }}"
9292
{% if request.organizer %}data-organizer="{{ request.organizer.slug }}"{% endif %}
9393
{% if request.event %}data-event="{{ request.event.slug }}"{% endif %}
94-
data-select2-locale="{{ select2locale }}" data-longdateformat="{{ js_long_date_format }}" class="nojs">
94+
data-select2-locale="{{ select2locale }}" data-longdateformat="{{ js_long_date_format }}" class="nojs sidebar-minimized">
9595
<div id="wrapper">
9696
<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
97+
<button type="button" class="navbar-toggle-sidebar navbar-toggle" id="sidebar-toggle" data-toggle="sidebar">
98+
<span class="sr-only">{% trans "Toggle sidebar" %}</span>
99+
<i class="fa fa-bars fa-lg"></i>
100+
</button>
97101
<div class="navbar-header">
98-
<button type="button" class="navbar-toggle"
99-
data-toggle="collapse" data-target=".navbar-nav-collapse">
100-
<span class="sr-only">{% trans "Toggle navigation" %}</span>
101-
<span class="icon-bar"></span>
102-
<span class="icon-bar"></span>
103-
<span class="icon-bar"></span>
104-
</button>
105102
{% if request.event %}
106103
{% if has_domain and not request.event.live %}
107104
<form action="{% eventurl request.event "presale:event.auth" %}" method="post"

app/eventyay/control/templates/pretixcontrol/item/delete.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>{% trans "Delete product" %}</h1>
77
{% if not possible and not item.active %}
88
<p>{% blocktrans %}You cannot delete the product <strong>{{ item }}</strong> because it already has been ordered.{% endblocktrans %}</p>
99
<div class="form-group submit-group">
10-
<a href="{% url "control:event.items" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default btn-cancel">
10+
<a href="{% url "control:event.products" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default btn-cancel">
1111
{% trans "Cancel" %}
1212
</a>
1313
<div class="clearfix"></div>
@@ -24,17 +24,17 @@ <h1>{% trans "Delete product" %}</h1>
2424
{% plural %}
2525
That will cause {{ count }} voucher to be unusable.
2626
{% endblocktrans %}
27-
<a href="{% url "control:event.vouchers" organizer=request.organizer.slug event=request.event.slug %}?itemvar={{ item.pk }}"
27+
<a href="{% url "control:event.vouchers" organizer=request.organizer.slug event=request.event.slug %}?productvar={{ product.pk }}"
2828
class="btn btn-default">
2929
{% trans "Show affected vouchers" %}
3030
</a>
3131
</div>
3232
{% endif %}
3333
{% else %}
34-
<p>{% blocktrans %}You cannot delete the product <strong>{{ item }}</strong> because it already has been ordered, but you can deactivate it.{% endblocktrans %}</p>
34+
<p>{% blocktrans %}You cannot delete the product <strong>{{ product }}</strong> because it already has been ordered, but you can deactivate it.{% endblocktrans %}</p>
3535
{% endif %}
3636
<div class="form-group submit-group">
37-
<a href="{% url "control:event.items" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default btn-cancel">
37+
<a href="{% url "control:event.products" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default btn-cancel">
3838
{% trans "Cancel" %}
3939
</a>
4040
<button type="submit" class="btn btn-delete btn-danger btn-save">

app/eventyay/control/templates/pretixcontrol/items/quota_delete.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1>{% trans "Delete quota" %}</h1>
2626
{% plural %}
2727
That will cause {{ count }} voucher to be unusable.
2828
{% endblocktrans %}
29-
<a href="{% url "control:event.vouchers" organizer=request.organizer.slug event=request.event.slug %}?itemvar=q-{{ quota.pk }}"
29+
<a href="{% url "control:event.vouchers" organizer=request.organizer.slug event=request.event.slug %}?productvar=q-{{ quota.pk }}"
3030
class="btn btn-default">
3131
{% trans "Show affected vouchers" %}
3232
</a>

app/eventyay/control/templates/pretixcontrol/order/change.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ <h3 class="panel-title">
136136
{% endif %}
137137
</div>
138138
<div class="col-sm-4">
139-
{% bootstrap_field position.form.itemvar layout='inline' %}
139+
{% bootstrap_field position.form.productvar layout='inline' %}
140140
</div>
141141
</div>
142142

@@ -224,7 +224,7 @@ <h3 class="panel-title">
224224
{{ add_form.custom_error }}
225225
</div>
226226
{% endif %}
227-
{% bootstrap_field add_form.itemvar layout="control" %}
227+
{% bootstrap_field add_form.productvar layout="control" %}
228228
{% bootstrap_field add_form.price addon_after=request.event.currency layout="control" %}
229229
{% if add_form.addon_to %}
230230
{% bootstrap_field add_form.addon_to layout="control" %}
@@ -256,7 +256,7 @@ <h3 class="panel-title">
256256
</div>
257257
<div class="panel-body">
258258
<div class="form-horizontal">
259-
{% bootstrap_field add_formset.empty_form.itemvar layout="control" %}
259+
{% bootstrap_field add_formset.empty_form.productvar layout="control" %}
260260
{% bootstrap_field add_formset.empty_form.price addon_after=request.event.currency layout="control" %}
261261
{% if add_formset.empty_form.addon_to %}
262262
{% bootstrap_field add_formset.empty_form.addon_to layout="control" %}

0 commit comments

Comments
 (0)