Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/275742

Change subject: Distingush debit cards with text under logo
......................................................................

Distingush debit cards with text under logo

Not the most beautiful solution, but it translates.

Bug: T124320
Change-Id: I319f41c393bab37982d7baa2704a2ceb9576a6c9
---
M astropay_gateway/astropay.adapter.php
M gateway_common/i18n/interface/en.json
M gateway_common/i18n/interface/es.json
M gateway_common/i18n/interface/qqq.json
M gateway_forms/Mustache.php
D gateway_forms/includes/card-visa-debit.png
M gateway_forms/mustache/forms.css
M gateway_forms/mustache/payment_method.html.mustache
8 files changed, 32 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/42/275742/1

diff --git a/astropay_gateway/astropay.adapter.php 
b/astropay_gateway/astropay.adapter.php
index 3584f52..0f5fd62 100644
--- a/astropay_gateway/astropay.adapter.php
+++ b/astropay_gateway/astropay.adapter.php
@@ -343,7 +343,8 @@
                        'countries' => array(
                                'MX' => true,
                        ),
-                       'logo' => 'card-visa-debit.png',
+                       'logo' => 'card-visa-lg.png',
+                       'sub_message' => 'donate_interface-debit',
                );
 
                // MasterCard debit
@@ -354,6 +355,8 @@
                        'countries' => array(
                                'MX' => true,
                        ),
+                       'logo' => 'card-mc-lg.png',
+                       'sub_message' => 'donate_interface-debit',
                );
 
                // Elo (Brazil-only)
diff --git a/gateway_common/i18n/interface/en.json 
b/gateway_common/i18n/interface/en.json
index 141222e..46409e1 100644
--- a/gateway_common/i18n/interface/en.json
+++ b/gateway_common/i18n/interface/en.json
@@ -307,6 +307,7 @@
        "donate_interface-cvv-number": "CVV number",
        "donate_interface-verification-number": "Verification number",
        "donate_interface-what-is-this": "What is this?",
+       "donate_interface-debit": "(debit)",
        "donate_interface-do-not-include-dashes": "Please do not include 
dashes",
        "donate_interface-please-donate-today": "Please donate today",
        "donate_interface-donate-now": "Donate now",
diff --git a/gateway_common/i18n/interface/es.json 
b/gateway_common/i18n/interface/es.json
index 4dd87e6..86f1927 100644
--- a/gateway_common/i18n/interface/es.json
+++ b/gateway_common/i18n/interface/es.json
@@ -315,6 +315,7 @@
        "donate_interface-cvv-number": "Número CVV",
        "donate_interface-verification-number": "Número de verificación",
        "donate_interface-what-is-this": "¿Qué es esto?",
+       "donate_interface-debit": "(débito)",
        "donate_interface-do-not-include-dashes": "No incluyas guiones",
        "donate_interface-please-donate-today": "Haz una donación hoy",
        "donate_interface-donate-now": "Dona ahora",
diff --git a/gateway_common/i18n/interface/qqq.json 
b/gateway_common/i18n/interface/qqq.json
index 06ca161..088135a 100644
--- a/gateway_common/i18n/interface/qqq.json
+++ b/gateway_common/i18n/interface/qqq.json
@@ -332,6 +332,7 @@
        "donate_interface-cvv-number": "Abbreviation of 'Card Verification 
Value' + 'Number' (unabbreviated)",
        "donate_interface-verification-number": "Prompt for the card's 
verification number",
        "donate_interface-what-is-this": "{{Identical|What is this}}",
+       "donate_interface-debit": "Text to indicate that the choice is a debit 
card as distinct from a credit card, displayed in parentheses",
        "donate_interface-do-not-include-dashes": "Reminder to exclude dashes 
from entries",
        "donate_interface-please-donate-today": "Label for request urging 
donation",
        "donate_interface-donate-now": "Label for button to donate",
diff --git a/gateway_forms/Mustache.php b/gateway_forms/Mustache.php
index 7f22936..8f0a3b3 100644
--- a/gateway_forms/Mustache.php
+++ b/gateway_forms/Mustache.php
@@ -98,6 +98,9 @@
                                if ( isset( $submethod['logo'] ) ) {
                                        $submethod['logo'] = 
"{$data['script_path']}/extensions/DonationInterface/gateway_forms/includes/{$submethod['logo']}";
                                }
+                               if ( isset( $submethod['sub_message'] ) ) {
+                                       $submethod['has_subtext'] = true;
+                               }
                                $data['submethods'][] = $submethod;
                        }
 
diff --git a/gateway_forms/includes/card-visa-debit.png 
b/gateway_forms/includes/card-visa-debit.png
deleted file mode 100644
index 5480719..0000000
--- a/gateway_forms/includes/card-visa-debit.png
+++ /dev/null
Binary files differ
diff --git a/gateway_forms/mustache/forms.css b/gateway_forms/mustache/forms.css
index 4d065b9..d0eba92 100644
--- a/gateway_forms/mustache/forms.css
+++ b/gateway_forms/mustache/forms.css
@@ -305,7 +305,10 @@
 }
 #cards.four-per-line > li:nth-child(4),
 #cards.four-per-line > li:nth-child(8) { margin-right: 0; }
-
+#cards li.has_subtext {
+    padding-top: 0.5em;
+    padding-bottom: 0.5em;
+}
 #cards.enabled li:hover {
     background: #bcbcbc;
 }
@@ -330,6 +333,15 @@
     margin: 0 auto !important;
     height: auto !important;
 }
+#cards li.has_subtext label {
+    margin-top: 0;
+}
+#cards li.has_subtext input {
+    margin-bottom: 0.2em !important;
+}
+#cards li label p.card_subtext {
+    margin: -0.5em auto;
+}
 
 #paymentContinue, #paymentSubmit {
   margin-top: 1em !important;
diff --git a/gateway_forms/mustache/payment_method.html.mustache 
b/gateway_forms/mustache/payment_method.html.mustache
index 6431e76..cbd46e8 100644
--- a/gateway_forms/mustache/payment_method.html.mustache
+++ b/gateway_forms/mustache/payment_method.html.mustache
@@ -5,7 +5,15 @@
 {{# show_submethods }}
                                                                                
<ul class="options-h enabled {{ button_class }}" id="cards" style="margin: 0;">
 {{# submethods }}
-                                                                               
        <li title="{{ label }}"><input id="submethod-{{ key }}" 
name="payment_submethod" type="radio" value="{{ key }}" class="cardradio" /> 
<label for="submethod-{{ key }}"><img alt="{{ label }}" src="{{ logo }}" 
/></label></li>
+                                                <li title="{{ label }}" {{# 
has_subtext }}class="has_subtext" {{/ has_subtext}}>
+                                                <input id="submethod-{{ key 
}}" name="payment_submethod" type="radio" value="{{ key }}" class="cardradio" />
+                                                <label for="submethod-{{ key 
}}">
+                                                    <img alt="{{ label }}" 
src="{{ logo }}" />
+{{# has_subtext }}
+                                                    <p class="card_subtext">{{ 
l10n sub_message }}</p>
+{{/ has_subtext }}
+                                                </label>
+                                            </li>
 {{/ submethods }}
                                                                                
</ul>
 {{/ show_submethods }}

-- 
To view, visit https://gerrit.wikimedia.org/r/275742
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I319f41c393bab37982d7baa2704a2ceb9576a6c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to