Compare commits
2 Commits
7108f9418d
...
d9ae263da0
Author | SHA1 | Date | |
---|---|---|---|
d9ae263da0 | |||
1e09ebf24b |
@ -0,0 +1,10 @@
|
|||||||
|
<a class="btn btn-sm btn-primary"
|
||||||
|
hx-boost="true"
|
||||||
|
hx-push-url="false"
|
||||||
|
hx-indicator=".htmx-indicator"
|
||||||
|
href="{% querystring refresh=1 %}">
|
||||||
|
<div class="spinner-border spinner-border-sm htmx-indicator" role="status">
|
||||||
|
<span class="visually-hidden">Loading...</span>
|
||||||
|
</div>
|
||||||
|
Refresh Data
|
||||||
|
</a>
|
@ -13,10 +13,16 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% if event.registrations is not None %}
|
<div class="row justify-content-center d-print-none">
|
||||||
{% url 'membershipworks:event-registrations' event.pk as registrations_url %}
|
<div class="col-auto">
|
||||||
{% bootstrap_button href=registrations_url content="Show Registrations" %}
|
{% if event.registrations is not None %}
|
||||||
{% endif %}
|
{% url 'membershipworks:event-registrations' event.pk as registrations_url %}
|
||||||
|
{% bootstrap_button extra_classes="btn-sm" href=registrations_url content="Show Registrations" %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">{% include "membershipworks/components/refresh_data_button.dj.html" %}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% include "membershipworks/event_invoice.dj.html" %}
|
{% include "membershipworks/event_invoice.dj.html" %}
|
||||||
|
|
||||||
<div class="card w-auto mt-5">
|
<div class="card w-auto mt-5">
|
||||||
|
@ -22,18 +22,7 @@
|
|||||||
{% bootstrap_button extra_classes="btn-sm" href=email_link target="_blank" content="Email all attendees" %}
|
{% bootstrap_button extra_classes="btn-sm" href=email_link target="_blank" content="Email all attendees" %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">{% include "cmsmanage/components/download_table.dj.html" %}</div>
|
<div class="col-auto">{% include "cmsmanage/components/download_table.dj.html" %}</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">{% include "membershipworks/components/refresh_data_button.dj.html" %}</div>
|
||||||
<a class="btn btn-sm btn-primary"
|
|
||||||
hx-boost="true"
|
|
||||||
hx-push-url="false"
|
|
||||||
hx-indicator=".htmx-indicator"
|
|
||||||
href="{% querystring refresh=1 %}">
|
|
||||||
<div class="spinner-border spinner-border-sm htmx-indicator" role="status">
|
|
||||||
<span class="visually-hidden">Loading...</span>
|
|
||||||
</div>
|
|
||||||
Refresh Data
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<h2 class="d-none d-print-block">Registrations for {{ event.details.ttl|nh3 }}</h2>
|
<h2 class="d-none d-print-block">Registrations for {{ event.details.ttl|nh3 }}</h2>
|
||||||
{% render_table table %}
|
{% render_table table %}
|
||||||
|
@ -41,7 +41,7 @@ from django_weasyprint import WeasyTemplateResponseMixin
|
|||||||
from django_weasyprint.utils import django_url_fetcher
|
from django_weasyprint.utils import django_url_fetcher
|
||||||
|
|
||||||
from membershipworks.membershipworks_api import MembershipWorks
|
from membershipworks.membershipworks_api import MembershipWorks
|
||||||
from membershipworks.tasks.scrape import scrape_event_details
|
from membershipworks.tasks.scrape import scrape_event_details, scrape_events
|
||||||
|
|
||||||
from .forms import EventInvoiceForm
|
from .forms import EventInvoiceForm
|
||||||
from .invoice_email import make_invoice_emails
|
from .invoice_email import make_invoice_emails
|
||||||
@ -311,6 +311,10 @@ class EventDetailView(
|
|||||||
if self.request.user.has_perm(
|
if self.request.user.has_perm(
|
||||||
self.permission_required
|
self.permission_required
|
||||||
) or self.object.user_is_instructor(self.request.user):
|
) or self.object.user_is_instructor(self.request.user):
|
||||||
|
if "refresh" in self.request.GET:
|
||||||
|
scrape_events()
|
||||||
|
scrape_event_details([self.object])
|
||||||
|
|
||||||
return super().render_to_response(context, **response_kwargs)
|
return super().render_to_response(context, **response_kwargs)
|
||||||
else:
|
else:
|
||||||
return self.handle_no_permission()
|
return self.handle_no_permission()
|
||||||
|
Loading…
Reference in New Issue
Block a user