donation fixes master
authorRadek Czajka <rczajka@rczajka.pl>
Fri, 12 Dec 2025 14:55:21 +0000 (15:55 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Fri, 12 Dec 2025 14:55:21 +0000 (15:55 +0100)
src/annoy/models.py
src/annoy/templates/annoy/banner.html
src/club/templates/club/donation_step_base.html
src/wolnelektury/static/2022/styles/layout/_checkout.scss

index 097872b..6af1cc0 100644 (file)
@@ -66,7 +66,13 @@ class Banner(models.Model):
             return self.campaign.image
         else:
             return self.image
-    
+
+    def is_external(self):
+        return (self.url and
+                not self.url.startswith('/') and
+                not self.url.startswith('https://wolnelektury.pl/')
+                )
+
     @classmethod
     def choice(cls, place, request, exemptions=True, book=None):
         Membership = apps.get_model('club', 'Membership')
index bfecd9d..9a67fcd 100644 (file)
@@ -20,7 +20,9 @@
            {% if banner.background_color %}background-color: {{ banner.background_color }};{% endif %}
         ">
     {% if not banner.action_label %}
-      <a href="{{ banner.url }}">
+    <a
+      {% if banner.is_external %}target="_blank"{% endif %}
+      href="{{ banner.url }}">
     {% endif %}
     <div class="annoy-banner-inner">
 
@@ -34,7 +36,9 @@
       </div>
 
       {% if banner.action_label %}
-        <a class="action" href="{{ banner.url }}">
+      <a class="action"
+        {% if banner.is_external %}target="_blank"{% endif %}
+        href="{{ banner.url }}">
           {{ banner.action_label }}
         </a>
       {% endif %}
index 804ace3..3889324 100644 (file)
@@ -29,7 +29,9 @@
 
     <div class="l-checkout__box">
       <div class="l-checkout__box__header">
-        <img src="{% block donation-jumbo-image %}{% static '2022/images/checkout-img-1.jpg' %}{% endblock %}" alt="Wspieraj Wolne Lektury">
+        <div class="l-checkout__box__header__img"
+             style="background-image: url({% block donation-jumbo-image %}{% static '2022/images/checkout-img-1.jpg' %}{% endblock %}">
+          </div>
         <div class="l-checkout__box__header__content">
           {% chunk "donate-top" %}
         </div>
index 28fd1ce..6bc86d0 100644 (file)
   display: flex;
   background: #083F4D;
 
-  img {
+  .l-checkout__box__header__img {
       display: none;
+      background-position: center;
+      background-size: cover;
       @include rwd($break-flow) {
           display: block;
+          width: 50%;
       }
   }
 }
     }
   }
   .l-checkout__payments__box__btn-wrp {
-    padding: 0 20px 20px 20px;
+      padding: 20px;
     margin-bottom: 0;
     margin-top: auto;
-    @include rwd($break-flow) {
-        padding-top: 20px;
-    }
   }
   p {
     margin-top: 0;
       font-family: "Source Sans Pro",sans-serif;
     font-weight: bold;
     font-size: 44px;
-    line-height: 130%;
     letter-spacing: -0.01em;
     height: 90px;
     display: flex;
     text-align: center;
     color: #083F4D;
 
+    flex-direction: column;
+    @include rwd($break-flow) {
+        flex-direction: row;
+        line-height: 130%;
+    }
+
     span {
       font-weight: 600;
       font-size: 25px;
-      line-height: 200%;
       letter-spacing: -0.01em;
       color: #92BD39;
       margin-left: 10px;