From 4973e0a0103b652e26cc9fcad6271c8f8cadc72f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 7 Dec 2021 12:30:21 -0800 Subject: [PATCH] Adds confirm modal for loading data --- bookwyrm/static/css/fonts/icomoon.eot | Bin 10404 -> 10460 bytes bookwyrm/static/css/fonts/icomoon.svg | 1 + bookwyrm/static/css/fonts/icomoon.ttf | Bin 10240 -> 10296 bytes bookwyrm/static/css/fonts/icomoon.woff | Bin 10316 -> 10372 bytes bookwyrm/static/css/vendor/icons.css | 13 +++--- bookwyrm/templates/author/author.html | 46 +++++++++++----------- bookwyrm/templates/author/sync_modal.html | 30 ++++++++++++++ 7 files changed, 63 insertions(+), 27 deletions(-) create mode 100644 bookwyrm/templates/author/sync_modal.html diff --git a/bookwyrm/static/css/fonts/icomoon.eot b/bookwyrm/static/css/fonts/icomoon.eot index 8eba8692fa04b6c1de810e316dadb480c17c633a..7b1f2d9d9f9d3ff8805e56d83c6c2ceba7654a8f 100644 GIT binary patch delta 407 zcmZ1ycqfqcjs^pR#Y9$fmO$O7Hzzuj*BdY}FzjJqU`R;LO)R*)cH$Za21XeM28NdO z#Nq-51_l8J2F3*p3=ACUIhAR87vgs?FfguQU{FrTNKH(U7m{DYz@W;(z`$UZk&&9n z!OddEz@X~Dz`&rAky}!+z>d?Ifk8Eefq`K|PJVLY{#`q!F)*l!FfcGgBae*fkABo0|R4QL4I)w12Y2y1A~SH0|SEs12gl5$tjHXjAoOU zFj|{tFfcHPF$gd)Gq5o*GAO(heW~!W>Sf!@Td%lYnf?F!|3644gThOOm*QaY>mc#T z0!$)oqF))985k!|)DWJ$K!atoEt8Y7r^5dS%nz6kFt9N&urewNDhetxF)%*(_uyZ{ zzXuA8511JKfsA7W5ey7BpXvt2^V@u7;AQ~}+`XDR2gCr;lNYF(GwMvfp}K~Jg@Hj~ ha*JAoh~NeW1_qE`9VRITP+&1IFoCS!{9kP;BLEs*ZpQ!s delta 349 zcmcZ;xFnEui3S4$!$ekdmd95FnN_PGPiXTO~GM%wJ4_fti7E@<9#J&8|#N%8Fn;&4O1R$Mf5KW#DE3^Y13AyaX{o^yCYw c=8W2tIn>rn-k}!3#=ywHz@WWZO8pQc09f8%)c^nh diff --git a/bookwyrm/static/css/fonts/icomoon.svg b/bookwyrm/static/css/fonts/icomoon.svg index 82e413294..7dbbe0dc5 100644 --- a/bookwyrm/static/css/fonts/icomoon.svg +++ b/bookwyrm/static/css/fonts/icomoon.svg @@ -46,4 +46,5 @@ + \ No newline at end of file diff --git a/bookwyrm/static/css/fonts/icomoon.ttf b/bookwyrm/static/css/fonts/icomoon.ttf index 5bf90a0a7ee19d304097a5d19cec297eb296e1fa..151f2b782e011873be7120240fc65777f3771917 100644 GIT binary patch delta 400 zcmZn&*bz|Az{tSBz|GLWz|3IaAFOZ0FT`%Zz`(GFfq@|*IXAK3^4f`O7#J937#J8@ z(i4jd7#J7?7#J8AFfcH1q~}zo>0OB5!N9<{f`LIfAtN<0MP5jL4FiKJ2Ll6xSw==` zA_q5%83Ti=0|NttN=9x;#R5A{X9fn<6b1%{4LSMAj*0ts?U=^EpeDk=zz~(2SW&=W z$|S?Upa!x?AulmEb*2~RZw3an2@DL3Z3X$oB@E0A3=9k!5)2Fs3JlE57bYICXEd9{ zXziWBz`!8JAi%)Pz{bGHpzu=krNYaqmu)X^z2bUh_W$qy{~&z~3NIO6ii5?k!^Ii@ zKNe>ZXBJx}HebwNOhNSP{V0^&D@DF4vC=3}G7;Zk*4UFfv`O3h}0up7odo_0shykJ}|4}h#)R}Cex`u^? Zfk9#N1JwvF!3_)y;PBVkY^QdJ5da5$Zngjb delta 348 zcmdlH&=641z{tSBz|GLWz|3IaAFOZ0FT~Eoz`(GFfq@|*IXAIjuhZTY3=E7i3=9l4 z>50V!3=9kc3=E7j7#J8h(sL@)+U<%O85kHBFfb@vWTYmh$Z7VuF)*myU|?V{%g9Jg z(!oa|=CMQ4HF>xK&j%f@Gst*_#7$R~LD+(A) zm}D3j)GQbn7!>jnb5mz}asFmtP>Wz-U~DVMFD_wVW?*1oPzR}3U|?oGH}QZyBiAHG zYr_Nv1_luZ0S0CU76wKJg_oi)6<$`oY9ikbzlJdWqL`O3h}0_NXMRCx(vfau9Os^*N^lT%dJOcqg# b5CDgsHj@+s2S@<}(_}>r;mwoPmNEhWQ{PoF diff --git a/bookwyrm/static/css/fonts/icomoon.woff b/bookwyrm/static/css/fonts/icomoon.woff index 6ce6834d5addfd8b1a478d05ec802eded9a45b33..bc08184133a6ada4b7b8e59d5290d6019c817132 100644 GIT binary patch delta 447 zcmX>T&=M$8?(gQtz{tSBz@X8>zzwD?CL3xzBy)IVGeEW(UIgx?EPc4CgfguWn_wU*b&GrZO<7-C!tHkDu`HLxteq~^0V4Q5IA-?%3qm#0y!v6=%510=yurV;OGAarx z3Mw)&Fh2PA;9tYP2MUZ2m>B+nOa=!x1H;Xyx`FZhHeVUISwNx;cdzEo0Wm=IWDiwy gMxDtGs%uzS7#I{L>!?L=34+20q*rHim)apl0NgKiQUCw| delta 409 zcmZn(JQE;X?(gQtz{tSBz@Xv7zzwD+7itJkZqQ(vs3ls@l$@Jbz`($m!N9;!1HyZq z_O3`zECz`^VPIh3fMS94oXRu?2F5oG49XTD+-_IYn30;8!oZ-a!oa{_2EuZheQp^U zsfi2>sxb@<3?Ok84sI6HjNFn61_spz1_p*TAUwy8Q#mI;Igx?EPfdq`fgu8f*KzHb zmYY~nz`&r^!oa|w0LCUvGI@!)sSFHiOBfg!+dz1x7w7MS{NfS@1`Uv2h&pBl1_oy4 zbCY=(?HRcy`!HI2CNMBCh%g8+Ff*_)Ffu5-6n&}ivg&2q%UiFw{{Q{|9~2M_3NIO6 zii1V3Lq!??KNe>ZXBJx}HebwNOo4%!fe{p1n_n}!C@X^XGz(sN9M5m_m4TZD%)gtc q@)E=V(UU7w%^9^PZ%|z`IYBK#037VvOj6)LWME(dn{;1oDI)+#_hWwm diff --git a/bookwyrm/static/css/vendor/icons.css b/bookwyrm/static/css/vendor/icons.css index b43224e34..9c35b1be7 100644 --- a/bookwyrm/static/css/vendor/icons.css +++ b/bookwyrm/static/css/vendor/icons.css @@ -1,10 +1,10 @@ @font-face { font-family: 'icomoon'; - src: url('../fonts/icomoon.eot?36x4a3'); - src: url('../fonts/icomoon.eot?36x4a3#iefix') format('embedded-opentype'), - url('../fonts/icomoon.ttf?36x4a3') format('truetype'), - url('../fonts/icomoon.woff?36x4a3') format('woff'), - url('../fonts/icomoon.svg?36x4a3#icomoon') format('svg'); + src: url('../fonts/icomoon.eot?r7jc98'); + src: url('../fonts/icomoon.eot?r7jc98#iefix') format('embedded-opentype'), + url('../fonts/icomoon.ttf?r7jc98') format('truetype'), + url('../fonts/icomoon.woff?r7jc98') format('woff'), + url('../fonts/icomoon.svg?r7jc98#icomoon') format('svg'); font-weight: normal; font-style: normal; font-display: block; @@ -142,3 +142,6 @@ .icon-spinner:before { content: "\e97a"; } +.icon-download:before { + content: "\ea36"; +} diff --git a/bookwyrm/templates/author/author.html b/bookwyrm/templates/author/author.html index 0d7d102d0..3fe4b7abc 100644 --- a/bookwyrm/templates/author/author.html +++ b/bookwyrm/templates/author/author.html @@ -70,63 +70,65 @@

{% trans "External links" %}

{% if author.wikipedia_link %} -

+

{% endif %} {% if author.isni %} -

+

{% endif %} + {% trans "Load data" as button_text %} {% if author.openlibrary_key %} -

- +

+ {% trans "View on OpenLibrary" %} {% if request.user.is_authenticated and perms.bookwyrm.edit_book %} -
- {% csrf_token %} - -
+ {% 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" %} + {% endwith %} {% endif %} -

+
{% endif %} {% if author.inventaire_id %} -

- +

+ {% trans "View on Inventaire" %} + {% if request.user.is_authenticated and perms.bookwyrm.edit_book %} -
- {% csrf_token %} - -
+ {% with controls_text="iv_sync" controls_uid=author.id %} + {% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_iv_sync" class="is-small" icon_with_text="download" %} + {% include "author/sync_modal.html" with source="inventaire.io" source_name="Inventaire" %} + {% endwith %} {% endif %} -

+
{% endif %} {% if author.librarything_key %} -

+

{% endif %} {% if author.goodreads_key %} -

+

{% endif %}
diff --git a/bookwyrm/templates/author/sync_modal.html b/bookwyrm/templates/author/sync_modal.html new file mode 100644 index 000000000..a061ada80 --- /dev/null +++ b/bookwyrm/templates/author/sync_modal.html @@ -0,0 +1,30 @@ +{% extends 'components/modal.html' %} +{% load i18n %} + +{% block modal-title %} +{% trans "Load data" %} +{% endblock %} + +{% block modal-form-open %} +
+ {% csrf_token %} +{% endblock %} + +{% block modal-body %} +

+ {% blocktrans trimmed %} + Loading data will connect to {{ source_name }} and check for any metadata about this author which aren't present here. Existing metadata will not be overwritten. + {% endblocktrans %} +

+{% endblock %} + +{% block modal-footer %} + + +{% trans "Cancel" as button_text %} +{% include 'snippets/toggle/toggle_button.html' with text=button_text %} +{% endblock %} + +{% block modal-form-close %}
{% endblock %}