From e500f5312589a9c6d1ce8fa8baefad1071a61152 Mon Sep 17 00:00:00 2001
From: Mouse Reeve
Date: Tue, 7 Dec 2021 12:41:11 -0800
Subject: [PATCH] Sync button for books
---
bookwyrm/templates/author/author.html | 2 +-
bookwyrm/templates/book/book.html | 17 +++++++-------
bookwyrm/templates/book/sync_modal.html | 30 +++++++++++++++++++++++++
3 files changed, 40 insertions(+), 9 deletions(-)
create mode 100644 bookwyrm/templates/book/sync_modal.html
diff --git a/bookwyrm/templates/author/author.html b/bookwyrm/templates/author/author.html
index 3fe4b7ab..66ecb062 100644
--- a/bookwyrm/templates/author/author.html
+++ b/bookwyrm/templates/author/author.html
@@ -94,7 +94,7 @@
{% 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="opnlibrary.org" source_name="OpenLibrary" %}
+ {% include "author/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" %}
{% endwith %}
{% endif %}
diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html
index 6d8ce72b..27d061a2 100644
--- a/bookwyrm/templates/book/book.html
+++ b/bookwyrm/templates/book/book.html
@@ -90,14 +90,15 @@
{% endwith %}
+ {% trans "Load data" as button_text %}
{% if book.openlibrary_key %}
{% trans "View on OpenLibrary" %}
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
-
+ {% with controls_text="ol_sync" controls_uid=book.id %}
+ {% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_ol_sync" class="is-small" icon_with_text="download" %}
+ {% include "book/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" %}
+ {% endwith %}
{% endif %}
{% endif %}
@@ -105,10 +106,10 @@
{% trans "View on Inventaire" %}
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
-
+ {% with controls_text="iv_sync" controls_uid=book.id %}
+ {% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_iv_sync" class="is-small" icon_with_text="download" %}
+ {% include "book/sync_modal.html" with source="inventaire.io" source_name="Inventaire" %}
+ {% endwith %}
{% endif %}
{% endif %}
diff --git a/bookwyrm/templates/book/sync_modal.html b/bookwyrm/templates/book/sync_modal.html
new file mode 100644
index 00000000..d80bf25f
--- /dev/null
+++ b/bookwyrm/templates/book/sync_modal.html
@@ -0,0 +1,30 @@
+{% extends 'components/modal.html' %}
+{% load i18n %}
+
+{% block modal-title %}
+{% trans "Load data" %}
+{% endblock %}
+
+{% block modal-form-open %}
+{% endblock %}