From 6c81c82481a5407bc6e4f3c5cdd16baedbc2a523 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 29 Jun 2023 16:24:19 +0200 Subject: [PATCH 1/1] Connecting WL + publishing author. --- src/apiclient/views.py | 2 +- src/catalogue/views.py | 7 ++++++ .../templates/documents/my_page.html | 24 ++++++++++++------- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/apiclient/views.py b/src/apiclient/views.py index b2f3aac2..e43ae0ca 100644 --- a/src/apiclient/views.py +++ b/src/apiclient/views.py @@ -61,7 +61,7 @@ def oauth_callback(request, beta=False): conn.token_secret = access_token['oauth_token_secret'] conn.save() - return HttpResponseRedirect('/') + return HttpResponseRedirect(reverse('documents_user')) @login_required diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 635af5fd..5ea1bbea 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -221,6 +221,13 @@ def publish_author(request, pk): data = { "name_pl": author.name, "description_pl": author.generate_description(), + "genitive": author.genitive, + "gazeta_link": author.gazeta_link, + "culturepl_link": author.culturepl_link, + "wiki_link_pl": author.plwiki, + "photo": request.build_absolute_uri(author.photo.url), + "photo_source": author.photo_source, + "photo_attribution": author.photo_attribution, } apiclient.api_call(request.user, f"authors/{author.slug}/", data) return redirect(reverse('admin:catalogue_author_change', args=[author.pk])) diff --git a/src/documents/templates/documents/my_page.html b/src/documents/templates/documents/my_page.html index 68c458e3..0768ab9c 100644 --- a/src/documents/templates/documents/my_page.html +++ b/src/documents/templates/documents/my_page.html @@ -22,12 +22,12 @@ {% endblock leftcolumn %} {% block rightcolumn %} - {% if wllogin %} -
-
-

Konto WL

-
-
+
+
+

Konto WL

+
+
+ {% if wllogin %}

Podłączone konto na Wolnych Lekturach: {{ wllogin }} @@ -38,10 +38,16 @@ Odłącz -

- + {% else %} +
+ {% csrf_token %} + +
+ {% endif %}
- {% endif %} +
-- 2.20.1