Fixes for payment form on book page.
authorRadek Czajka <rczajka@rczajka.pl>
Mon, 7 Dec 2020 13:15:17 +0000 (14:15 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Mon, 7 Dec 2020 13:15:17 +0000 (14:15 +0100)
src/catalogue/templates/catalogue/book_wide.html
src/catalogue/views.py

index 84eb9dd..d7c2a09 100644 (file)
@@ -25,8 +25,6 @@
   <p class="book-box-tools book-box-tools-warn">
     {% chunk "book-preview-warn" %}
   </p>
-
-  {% include "club/payment_info.html" %}
 {% endblock %}
 
 
           {% chunk 'club_form_bottom' %}
         </form>
       {% endwith %}
+
+      {% include "club/payment_info.html" %}
     {% endif %}
 
+
   </div>
 {% endblock %}
 
index 9a36b73..398c61c 100644 (file)
@@ -18,7 +18,7 @@ from django.views.decorators.cache import never_cache
 
 from ajaxable.utils import AjaxableFormView
 from club.forms import ScheduleForm
-from club.models import Membership
+from club.models import Club, Membership
 from annoy.models import DynamicTextInsert
 from pdcounter import views as pdcounter_views
 from picture.models import Picture, PictureArea
@@ -291,6 +291,7 @@ def book_detail(request, slug):
             'book_children': book.children.all().order_by('parent_number', 'sort_key'),
             'active_menu_item': 'books',
             'club_form': ScheduleForm() if book.preview else None,
+            'club': Club.objects.first() if book.preview else None,
         })