r102155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102154‎ | r102155 | r102156 >
Date:05:12, 6 November 2011
Author:pgehres
Status:ok (Comments)
Tags:
Comment:
Adding country specific BT forms for US and CA, removing state field from non-US/CA
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/css/webitects.css (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-CA.html (added) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-US.html (added) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt.html (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/css/webitects.css
@@ -73,6 +73,10 @@
7474 .loc-fields .loc-state { margin-right: 0%; width: 22%; }
7575 .loc-fields .loc-street { margin-bottom: 5px; width: 100%; }
7676
 77+/* Location where we are not including a state select */
 78+.loc-fields.nostate .loc-city { float: left; margin: 0 1% 5px 0; width: 48%; }
 79+.loc-fields.nostate .loc-postal { float: left; margin: 0 1% 5px 0; width: 49%; }
 80+
7781 /* Name */
7882 .name-fields span { float: left; margin: 0 2% 5px 0; width: 48%; }
7983 .name-fields .name-last { margin: 0; }
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-US.html
@@ -0,0 +1,125 @@
 2+<script type="text/javascript">
 3+ mw.loader.load('gc.form.rapidhtml.webitects.bt');
 4+ // these must go through RapidHTML and thus are inline
 5+ var amountErrors = ["#general|escape",'#retryMsg|escape','#amount|escape'];
 6+ var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
 7+ var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
 8+ var actionURL = "@action";
 9+ var scriptPath = "@script_path";
 10+</script>
 11+<!--[if lt IE 7]>
 12+<script type="text/javascript">
 13+ mw.loader.load('gc.form.rapidhtml.webitects.ie6');
 14+</script>
 15+<style type="text/css">
 16+ body{
 17+ behavior: url("@script_path/skins/vector/csshover.min.htc");
 18+ }
 19+</style><![endif]-->
 20+<!--[if IE 7]>
 21+<style>
 22+ .gainlayout {
 23+ zoom: 1;
 24+ height: 1%;
 25+ }
 26+</style>
 27+<![endif]-->
 28+
 29+<div class="ltr">
 30+ <table id="layouttable">
 31+ <tr>
 32+ <td>
 33+ <div id="appeal">
 34+ <div id="appeal-content">
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 37+ </div>
 38+ </div>
 39+ </td>
 40+ <td>
 41+ <div id="donate">
 42+ <div id="donate-content">
 43+ <div id="donate-body" style="padding: 0 1em;">
 44+ <form method="post" name="paypalcontribution">
 45+ <div id="step1header"><h3>%donate_interface-amount-legend% <span id="selected-amount">@amount @currency_code</span></h3></div>
 46+ <div id="amtErrorMessages" class="small"></div>
 47+ <div id="step2header"><h3>%donate_interface-billing-address% <span class="mute" id="change-billing" style="display: none;">(<a href="#">%donate_interface-change%</a>)</span></h3></div>
 48+ <div id="step2wrapper">
 49+ <div id="billing-content" class="gainlayout">
 50+ <div id="billingErrorMessages" class="small"></div>
 51+ <div id="paymentErrorMessages" class="small"></div>
 52+ <div class="name-fields">
 53+ <span class="name-first"><input class="txt" id="fname" name="fname" title="%donate_interface-donor-fname%" value="@fname" placeholder="%donate_interface-donor-fname%"/></span>
 54+ <span class="name-last"><input class="txt" id="lname" name="lname" title="%donate_interface-donor-lname%" value="@lname" placeholder="%donate_interface-donor-lname%"/></span>
 55+ </div>
 56+ <div class="loc-fields">
 57+ <span class="loc-street"><input class="txt" id="street" name="street" title="%donate_interface-donor-street%" value="@street" placeholder="%donate_interface-donor-street%"/></span>
 58+ <span class="loc-city"><input class="txt" id="city" name="city" title="%donate_interface-donor-city%" value="@city" placeholder="%donate_interface-donor-city%"/></span>
 59+ <span class="loc-state">
 60+ <select id="state" name="state" class="txt" value="@state" >
 61+ <option value=""></option>
 62+ <option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="PR">PR</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option><option value="AA">AA</option><option value="AE">AE</option><option value="AP">AP</option>
 63+ </select>
 64+ </span>
 65+ <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-zip%" value="@zip" placeholder="%donate_interface-donor-zip%"/></span> <!-- TODO: use postal code on non-US -->
 66+ </div>
 67+ <p><input class="txt" title="%donate_interface-donor-email%" id="emailAdd" name="emailAdd" value="@emailAdd" placeholder="%donate_interface-donor-email%"/></p>
 68+ <div id="bt-continue" style="margin-top: 10px;"> <input class="btn" id="bt-continueBtn" type="button" value="%donate_interface-continue%" /></div>
 69+ </div>
 70+ </div>
 71+
 72+
 73+
 74+ <input type="hidden" name="returnto" value="Thank_You/en" />
 75+ <input type="hidden" value="0" name="PaypalRedirect" id="PaypalRedirect">
 76+
 77+ <input type="hidden" value="@amount" name="amount" />
 78+ <input type="hidden" value="US" name="country" id="country" />
 79+ <input type="hidden" value="@currency_code" name="currency_code" />
 80+ <input type="hidden" value="@utm_source" name="utm_source"/>
 81+ <input type="hidden" value="@utm_medium" name="utm_medium"/>
 82+ <input type="hidden" value="@utm_campaign" name="utm_campaign"/>
 83+ <input type="hidden" value="@language" name="language"/>
 84+ <input type="hidden" value="@referrer" name="referrer"/>
 85+ <input type="hidden" value="@comment" name="comment"/>
 86+ <input type="hidden" value="@comment-option" name="comment-option"/>
 87+ <input type="hidden" value="1" name="email-opt"/>
 88+ <input type="hidden" value="@token" name="token"/>
 89+ <input type="hidden" value="@order_id" name="order_id"/>
 90+ <input type="hidden" value="@numAttempt" name="numAttempt"/>
 91+ <input type="hidden" value="@contribution_tracking_id" name="contribution_tracking_id"/>
 92+ <input type="hidden" value="@data_hash" name="data_hash"/>
 93+ <input type="hidden" value="@owa_session" name="owa_session"/>
 94+ <input type="hidden" value="@owa_ref" name="owa_ref"/>
 95+ <!-- new required fields -->
 96+ <input type="hidden" value="@gateway" name="gateway"/>
 97+ <input type="hidden" value="@payment_method" name="payment_method"/>
 98+ <!-- required fields for bt and dd -->
 99+ <input type="hidden" value="bt" name="payment_method"/>
 100+ <input type="hidden" value="bt" name="payment_submethod"/>
 101+ </form>
 102+ <div id="where-content">
 103+ {{LanguageSwitch|2011FR/core-appeal-whitebox-nodiv|@language}}
 104+ </div>
 105+ </div>
 106+ </div>
 107+ <p id="informationsharing">%donate_interface-informationsharing|url%</p>
 108+ <!-- TODO: links inside the message or not? -->
 109+ <ul id="moreinfolinks">
 110+ <li><a href="http://wikimediafoundation.org/wiki/Monthly_donations/en/US">%donate_interface-monthly-donation%</a></li><!-- TODO: localize the link -->
 111+ <li>%donate_interface-otherways-short|url%</li><!-- TODO: localize the link -->
 112+ <li><a href="http://wikimediafoundation.org/wiki/FAQ/en">%donate_interface-faqs%</a></li><!-- TODO: localize the link -->
 113+ <!--<li><a href="">%donate_interface-tax-info%</a></li>--><!-- TODO: localize the link -->
 114+ </ul>
 115+ </div>
 116+ </td>
 117+ </tr>
 118+ </table>
 119+
 120+
 121+
 122+</div>
 123+
 124+<!-- Wikimedia Project logo
 125+<li id="footer-copyrightico"><a href="https://www.mediawiki.org//wikimediafoundation.org/"><img src="//bits.wikimedia.org/images/wikimedia-button.png" width="88" height="31" alt="Wikimedia Foundation"/></a></li>
 126+ -->
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-US.html
___________________________________________________________________
Added: svn:eol-style
1127 + native
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt.html
@@ -52,16 +52,10 @@
5353 <span class="name-first"><input class="txt" id="fname" name="fname" title="%donate_interface-donor-fname%" value="@fname" placeholder="%donate_interface-donor-fname%"/></span>
5454 <span class="name-last"><input class="txt" id="lname" name="lname" title="%donate_interface-donor-lname%" value="@lname" placeholder="%donate_interface-donor-lname%"/></span>
5555 </div>
56 - <div class="loc-fields">
 56+ <div class="loc-fields nostate">
5757 <span class="loc-street"><input class="txt" id="street" name="street" title="%donate_interface-donor-street%" value="@street" placeholder="%donate_interface-donor-street%"/></span>
5858 <span class="loc-city"><input class="txt" id="city" name="city" title="%donate_interface-donor-city%" value="@city" placeholder="%donate_interface-donor-city%"/></span>
59 - <span class="loc-state">
60 - <select id="state" name="state" class="txt" value="@state" >
61 - <option value=""></option>
62 - <option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="PR">PR</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option><option value="AA">AA</option><option value="AE">AE</option><option value="AP">AP</option>
63 - </select>
64 - </span>
65 - <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-zip%" value="@zip" placeholder="%donate_interface-donor-zip%"/></span> <!-- TODO: use postal code on non-US -->
 59+ <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-donor-postal%" value="@zip" placeholder="%donate_interface-donor-postal%"/></span>
6660 </div>
6761 <p><input class="txt" title="%donate_interface-donor-email%" id="emailAdd" name="emailAdd" value="@emailAdd" placeholder="%donate_interface-donor-email%"/></p>
6862 <div id="bt-continue" style="margin-top: 10px;"> <input class="btn" id="bt-continueBtn" type="button" value="%donate_interface-continue%" /></div>
@@ -97,6 +91,8 @@
9892 <!-- required fields for bt and dd -->
9993 <input type="hidden" value="bt" name="payment_method"/>
10094 <input type="hidden" value="bt" name="payment_submethod"/>
 95+ <!-- required fields omitted above -->
 96+ <input type="hidden" value="XX" name="state"/>
10197 </form>
10298 <div id="where-content">
10399 {{LanguageSwitch|2011FR/core-appeal-whitebox-nodiv|@language}}
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-CA.html
@@ -0,0 +1,125 @@
 2+<script type="text/javascript">
 3+ mw.loader.load('gc.form.rapidhtml.webitects.bt');
 4+ // these must go through RapidHTML and thus are inline
 5+ var amountErrors = ["#general|escape",'#retryMsg|escape','#amount|escape'];
 6+ var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
 7+ var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
 8+ var actionURL = "@action";
 9+ var scriptPath = "@script_path";
 10+</script>
 11+<!--[if lt IE 7]>
 12+<script type="text/javascript">
 13+ mw.loader.load('gc.form.rapidhtml.webitects.ie6');
 14+</script>
 15+<style type="text/css">
 16+ body{
 17+ behavior: url("@script_path/skins/vector/csshover.min.htc");
 18+ }
 19+</style><![endif]-->
 20+<!--[if IE 7]>
 21+<style>
 22+ .gainlayout {
 23+ zoom: 1;
 24+ height: 1%;
 25+ }
 26+</style>
 27+<![endif]-->
 28+
 29+<div class="ltr">
 30+ <table id="layouttable">
 31+ <tr>
 32+ <td>
 33+ <div id="appeal">
 34+ <div id="appeal-content">
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 37+ </div>
 38+ </div>
 39+ </td>
 40+ <td>
 41+ <div id="donate">
 42+ <div id="donate-content">
 43+ <div id="donate-body" style="padding: 0 1em;">
 44+ <form method="post" name="paypalcontribution">
 45+ <div id="step1header"><h3>%donate_interface-amount-legend% <span id="selected-amount">@amount @currency_code</span></h3></div>
 46+ <div id="amtErrorMessages" class="small"></div>
 47+ <div id="step2header"><h3>%donate_interface-billing-address% <span class="mute" id="change-billing" style="display: none;">(<a href="#">%donate_interface-change%</a>)</span></h3></div>
 48+ <div id="step2wrapper">
 49+ <div id="billing-content" class="gainlayout">
 50+ <div id="billingErrorMessages" class="small"></div>
 51+ <div id="paymentErrorMessages" class="small"></div>
 52+ <div class="name-fields">
 53+ <span class="name-first"><input class="txt" id="fname" name="fname" title="%donate_interface-donor-fname%" value="@fname" placeholder="%donate_interface-donor-fname%"/></span>
 54+ <span class="name-last"><input class="txt" id="lname" name="lname" title="%donate_interface-donor-lname%" value="@lname" placeholder="%donate_interface-donor-lname%"/></span>
 55+ </div>
 56+ <div class="loc-fields">
 57+ <span class="loc-street"><input class="txt" id="street" name="street" title="%donate_interface-donor-street%" value="@street" placeholder="%donate_interface-donor-street%"/></span>
 58+ <span class="loc-city"><input class="txt" id="city" name="city" title="%donate_interface-donor-city%" value="@city" placeholder="%donate_interface-donor-city%"/></span>
 59+ <span class="loc-state">
 60+ <select id="state" name="state" class="txt" value="@state" >
 61+ <option value=""></option>
 62+ <option value=""></option><option value="AB">AB</option><option value="BC">BC</option><option value="MB">MB</option><option value="NB">NB</option><option value="NL">NL</option><option value="NS">NS</option><option value="ON">ON</option><option value="PE">PE</option><option value="QC">QC</option><option value="SK">SK</option>
 63+ </select>
 64+ </span>
 65+ <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-postal%" value="@zip" placeholder="%donate_interface-donor-postal%"/></span>
 66+ </div>
 67+ <p><input class="txt" title="%donate_interface-donor-email%" id="emailAdd" name="emailAdd" value="@emailAdd" placeholder="%donate_interface-donor-email%"/></p>
 68+ <div id="bt-continue" style="margin-top: 10px;"> <input class="btn" id="bt-continueBtn" type="button" value="%donate_interface-continue%" /></div>
 69+ </div>
 70+ </div>
 71+
 72+
 73+
 74+ <input type="hidden" name="returnto" value="Thank_You/en" />
 75+ <input type="hidden" value="0" name="PaypalRedirect" id="PaypalRedirect">
 76+
 77+ <input type="hidden" value="@amount" name="amount" />
 78+ <input type="hidden" value="CA" name="country" id="country" />
 79+ <input type="hidden" value="@currency_code" name="currency_code" />
 80+ <input type="hidden" value="@utm_source" name="utm_source"/>
 81+ <input type="hidden" value="@utm_medium" name="utm_medium"/>
 82+ <input type="hidden" value="@utm_campaign" name="utm_campaign"/>
 83+ <input type="hidden" value="@language" name="language"/>
 84+ <input type="hidden" value="@referrer" name="referrer"/>
 85+ <input type="hidden" value="@comment" name="comment"/>
 86+ <input type="hidden" value="@comment-option" name="comment-option"/>
 87+ <input type="hidden" value="1" name="email-opt"/>
 88+ <input type="hidden" value="@token" name="token"/>
 89+ <input type="hidden" value="@order_id" name="order_id"/>
 90+ <input type="hidden" value="@numAttempt" name="numAttempt"/>
 91+ <input type="hidden" value="@contribution_tracking_id" name="contribution_tracking_id"/>
 92+ <input type="hidden" value="@data_hash" name="data_hash"/>
 93+ <input type="hidden" value="@owa_session" name="owa_session"/>
 94+ <input type="hidden" value="@owa_ref" name="owa_ref"/>
 95+ <!-- new required fields -->
 96+ <input type="hidden" value="@gateway" name="gateway"/>
 97+ <input type="hidden" value="@payment_method" name="payment_method"/>
 98+ <!-- required fields for bt and dd -->
 99+ <input type="hidden" value="bt" name="payment_method"/>
 100+ <input type="hidden" value="bt" name="payment_submethod"/>
 101+ </form>
 102+ <div id="where-content">
 103+ {{LanguageSwitch|2011FR/core-appeal-whitebox-nodiv|@language}}
 104+ </div>
 105+ </div>
 106+ </div>
 107+ <p id="informationsharing">%donate_interface-informationsharing|url%</p>
 108+ <!-- TODO: links inside the message or not? -->
 109+ <ul id="moreinfolinks">
 110+ <li><a href="http://wikimediafoundation.org/wiki/Monthly_donations/en/US">%donate_interface-monthly-donation%</a></li><!-- TODO: localize the link -->
 111+ <li>%donate_interface-otherways-short|url%</li><!-- TODO: localize the link -->
 112+ <li><a href="http://wikimediafoundation.org/wiki/FAQ/en">%donate_interface-faqs%</a></li><!-- TODO: localize the link -->
 113+ <!--<li><a href="">%donate_interface-tax-info%</a></li>--><!-- TODO: localize the link -->
 114+ </ul>
 115+ </div>
 116+ </td>
 117+ </tr>
 118+ </table>
 119+
 120+
 121+
 122+</div>
 123+
 124+<!-- Wikimedia Project logo
 125+<li id="footer-copyrightico"><a href="https://www.mediawiki.org//wikimediafoundation.org/"><img src="//bits.wikimedia.org/images/wikimedia-button.png" width="88" height="31" alt="Wikimedia Foundation"/></a></li>
 126+ -->
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/bt/bt-CA.html
___________________________________________________________________
Added: svn:eol-style
1127 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r102236MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:06, 7 November 2011
r102237MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:07, 7 November 2011

Comments

#Comment by Awjrichards (talk | contribs)   22:19, 6 November 2011
<li><a href="[http://wikimediafoundation.org/wiki/Monthly_donations/en/US http://wikimediafoundation.org/wiki/Monthly_donations/en/US]">%donate_interface-monthly-donation%</a></li><!-- TODO: localize the link -->

Is this intedned to be hardcoded? I see the TODO, but perhaps you can hit the country/language with @country @language template tags?

#Comment by Awjrichards (talk | contribs)   22:55, 6 November 2011

We discussed and for now this needs to remain hardcoded. Marking OK.

Status & tagging log