-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update long-running buttons in import listing template
- Loading branch information
Showing
1 changed file
with
30 additions
and
27 deletions.
There are no files selected for viewing
57 changes: 30 additions & 27 deletions
57
wagtail_airtable/templates/wagtail_airtable/airtable_import_listing.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
{% extends "wagtailadmin/base.html" %} | ||
{% load wagtailadmin_tags %} | ||
{% load i18n wagtailadmin_tags %} | ||
|
||
{% block titletag %}Import Airtable Sheets{% endblock %} | ||
|
||
{% block content %} | ||
{% include "wagtailadmin/shared/header.html" with title="Airtable Import" %} | ||
{% include "wagtailadmin/shared/header.html" with title="Airtable Import" %} | ||
|
||
<div class="nice-padding"> | ||
<h2>Models you can import from Airtable</h2> | ||
{% for model_name, model_path, is_airtable_enabled, grouped_models in models %} | ||
<h3>{{ model_name }}</h3> | ||
{% if grouped_models %} | ||
<div class="help-block help-info"> | ||
<p>When you import {{ model_name }} you'll also be importing these ({{ grouped_models|length }}) as well: {% for model_name in grouped_models %}{{ model_name }}{% if not forloop.last %}, {% endif %} {% endfor %}</p> | ||
</div> | ||
{% endif %} | ||
{% if is_airtable_enabled %} | ||
<form method="POST" action="{% url 'airtable_import_listing' %}"> | ||
{% csrf_token %} | ||
<input type="hidden" name="model" value="{{ model_path }}" /> | ||
|
||
<div class="nice-padding"> | ||
<h2>Models you can import from Airtable</h2> | ||
{% for model_name, model_path, is_airtable_enabled, grouped_models in models %} | ||
<h3>{{ model_name }}</h3> | ||
{% if grouped_models %} | ||
<div class="help-block help-info"> | ||
<p>When you import {{ model_name }} you'll also be importing these ({{ grouped_models|length }}) as well: {% for model_name in grouped_models %}{{ model_name }}{% if not forloop.last %}, {% endif %} {% endfor %}</p> | ||
</div> | ||
{% endif %} | ||
{% if is_airtable_enabled %} | ||
<form method="POST" action="{% url 'airtable_import_listing' %}"> | ||
{% csrf_token %} | ||
<input type="hidden" name="model" value="{{ model_path }}" /> | ||
<button type="submit" class="button button-longrunning" data-clicked-text="Importing..."> | ||
{% icon name="spinner" %} | ||
<em>Import {{ model_name }}</em> | ||
</button> | ||
</form> | ||
{% else %} | ||
<em>{{ model_name }} is not setup with the correct Airtable settings</em> | ||
{% endif %} | ||
{% empty %} | ||
<em>There are no models configured yet</em> | ||
{% endfor %} | ||
</div> | ||
<button type="submit" class="button button-longrunning" data-controller="w-progress" data-action="w-progress#activate" data-w-progress-active-value="{% trans "Importing..." %}"> | ||
{% icon name="spinner" %} | ||
<em data-w-progress-target="label">{% blocktrans %}Import {{ model_name }}{% endblocktrans %}</em> | ||
</button> | ||
</form> | ||
{% else %} | ||
<em>{{ model_name }} is not setup with the correct Airtable settings</em> | ||
{% endif %} | ||
{% empty %} | ||
<em>There are no models configured yet</em> | ||
{% endfor %} | ||
</div> | ||
{% endblock %} |