conn.token_secret = access_token['oauth_token_secret']
conn.save()
- return HttpResponseRedirect('/')
+ return HttpResponseRedirect(reverse('documents_user'))
@login_required
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]))
{% endblock leftcolumn %}
{% block rightcolumn %}
- {% if wllogin %}
- <div class="card">
- <div class="card-header">
- <h2>Konto WL</h2>
- </div>
- <div class="card-body">
+ <div class="card mb-4">
+ <div class="card-header">
+ <h2>Konto WL</h2>
+ </div>
+ <div class="card-body">
+ {% if wllogin %}
<p>
Podłączone konto na Wolnych Lekturach:
<strong>{{ wllogin }}</strong>
Odłącz
</button>
</form>
- </div>
-
+ {% else %}
+ <form method="post" action="{% url 'apiclient_oauth' %}">
+ {% csrf_token %}
+ <button class="btn btn-primary">
+ Podłącz konto
+ </button>
+ </form>
+ {% endif %}
</div>
- {% endif %}
+ </div>
<div class="card">
<div class="card-header">