Uses new modals for author sync

This commit is contained in:
Mouse Reeve 2021-12-30 13:37:07 -08:00
parent d60684e08e
commit 82ea04f247
3 changed files with 12 additions and 8 deletions

View file

@ -92,10 +92,11 @@
{% trans "View on OpenLibrary" %}
</a>
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
{% with controls_text="ol_sync" controls_uid=author.id %}
{% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_ol_sync" class="is-small" icon_with_text="download" %}
{% include "author/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" %}
{% endwith %}
<button class="button is-small" type="button" data-modal-open="openlibrary_sync">
<span class="icon icon-download" title="{{ button_text }}"></span>
<span class="is-sr-only-mobile">{{ button_text }}</span>
</button>
{% include "author/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" id="openlibrary_sync" %}
{% endif %}
</div>
{% endif %}

View file

@ -1,4 +1,4 @@
{% extends 'components/modal.html' %}
{% extends 'components/new_modal.html' %}
{% load i18n %}
{% block modal-title %}
@ -23,8 +23,9 @@
<span>{% trans "Confirm" %}</span>
</button>
{% trans "Cancel" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with text=button_text %}
<button type="button" class="button" data-modal-close>
{% trans "Cancel" %}
</button>
{% endblock %}
{% block modal-form-close %}</form>{% endblock %}

View file

@ -2,7 +2,7 @@
<div class="modal" id="{{ id }}">
<div class="modal-background" data-modal-close></div>
<div class="modal-card is-thin" role="dialog" aria-modal="true" tabindex="-1">
<div class="modal-card" role="dialog" aria-modal="true" tabindex="-1">
<header class="modal-card-head">
<h2 class="modal-card-title mb-0">
{% block modal-title %}{% endblock %}
@ -15,12 +15,14 @@
></button>
</header>
{% block modal-form-open %}{% endblock %}
<section class="modal-card-body">
{% block modal-body %}{% endblock %}
</section>
<footer class="modal-card-foot">
{% block modal-footer %}{% endblock %}
</footer>
{% block modal-form-close %}{% endblock %}
</div>
<button
type="button"