mirror of
https://github.com/pretix/pretix.git
synced 2026-09-14 16:24:43 +00:00
New signals to add content to the front page
This commit is contained in:
@@ -25,7 +25,7 @@ Frontend
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
.. automodule:: pretix.presale.signals
|
.. automodule:: pretix.presale.signals
|
||||||
:members: html_head, footer_links
|
:members: html_head, footer_links, front_page_top, front_page_bottom
|
||||||
|
|
||||||
|
|
||||||
.. automodule:: pretix.presale.signals
|
.. automodule:: pretix.presale.signals
|
||||||
|
|||||||
@@ -78,3 +78,25 @@ easy to cause serious performance problems.
|
|||||||
|
|
||||||
As with all plugin signals, the ``sender`` keyword argument will contain the event.
|
As with all plugin signals, the ``sender`` keyword argument will contain the event.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
front_page_top = EventPluginSignal(
|
||||||
|
providing_args=[]
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
This signal is sent out to display additional information on the frontpage above the list
|
||||||
|
of products and but below a custom frontpage text.
|
||||||
|
|
||||||
|
As with all plugin signals, the ``sender`` keyword argument will contain the event. The
|
||||||
|
receivers are expected to return HTML.
|
||||||
|
"""
|
||||||
|
|
||||||
|
front_page_bottom = EventPluginSignal(
|
||||||
|
providing_args=[]
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
This signal is sent out to display additional information on the frontpage below the list
|
||||||
|
of products.
|
||||||
|
|
||||||
|
As with all plugin signals, the ``sender`` keyword argument will contain the event. The
|
||||||
|
receivers are expected to return HTML.
|
||||||
|
"""
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
{% load l10n %}
|
{% load l10n %}
|
||||||
{% load eventurl %}
|
{% load eventurl %}
|
||||||
{% load thumbnail %}
|
{% load thumbnail %}
|
||||||
|
{% load eventsignal %}
|
||||||
{% load markup_tags %}
|
{% load markup_tags %}
|
||||||
{% block title %}{% trans "Presale" %}{% endblock %}
|
{% block title %}{% trans "Presale" %}{% endblock %}
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
{% if frontpage_text %}
|
{% if frontpage_text %}
|
||||||
{{ frontpage_text|apply_markup:"markdown"|linebreaks }}
|
{{ frontpage_text|apply_markup:"markdown"|linebreaks }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% eventsignal event "pretix.presale.signals.front_page_top" %}
|
||||||
{% if event.presale_is_running or event.settings.show_items_outside_presale_period %}
|
{% if event.presale_is_running or event.settings.show_items_outside_presale_period %}
|
||||||
<form method="post" data-asynctask
|
<form method="post" data-asynctask
|
||||||
action="{% eventurl request.event "presale:event.cart.add" %}?next={{ request.path|urlencode }}">
|
action="{% eventurl request.event "presale:event.cart.add" %}?next={{ request.path|urlencode }}">
|
||||||
@@ -213,23 +215,26 @@
|
|||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if vouchers_exist %}
|
{% if vouchers_exist %}
|
||||||
<h2>{% trans "Redeem a voucher" %}</h2>
|
<section class="front-page">
|
||||||
<form method="get" action="{% eventurl event "presale:event.redeem" %}">
|
<h2>{% trans "Redeem a voucher" %}</h2>
|
||||||
<div class="row-fluid">
|
<form method="get" action="{% eventurl event "presale:event.redeem" %}">
|
||||||
<div class="col-md-8 col-sm-6 col-xs-12">
|
<div class="row-fluid">
|
||||||
<div class="input-group">
|
<div class="col-md-8 col-sm-6 col-xs-12">
|
||||||
<span class="input-group-addon"><i class="fa fa-ticket fa-fw"></i></span>
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" name="voucher" id="voucher"
|
<span class="input-group-addon"><i class="fa fa-ticket fa-fw"></i></span>
|
||||||
placeholder="{% trans "Voucher code" %}">
|
<input type="text" class="form-control" name="voucher" id="voucher"
|
||||||
|
placeholder="{% trans "Voucher code" %}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||||
|
<button class="btn btn-block btn-primary" type="submit">
|
||||||
|
{% trans "Redeem voucher" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
</form>
|
||||||
<button class="btn btn-block btn-primary" type="submit">
|
</section>
|
||||||
{% trans "Redeem voucher" %}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% eventsignal event "pretix.presale.signals.front_page_bottom" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -96,7 +96,10 @@
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
.checkout-button-row {
|
.checkout-button-row {
|
||||||
padding: 15px 0;
|
padding-top: 15px;
|
||||||
|
}
|
||||||
|
section.front-page {
|
||||||
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
.offline-banner {
|
.offline-banner {
|
||||||
background: $brand-danger;
|
background: $brand-danger;
|
||||||
|
|||||||
Reference in New Issue
Block a user