r109107 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109106‎ | r109107 | r109108 >
Date:05:51, 17 January 2012
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
a more usable page
Modified paths:
  • /trunk/extensions/CongressLookup/SpecialCongressLookup.php (modified) (history)
  • /trunk/extensions/CongressLookup/includes/pageBegin.html (modified) (history)

Diff [purge]

Index: trunk/extensions/CongressLookup/SpecialCongressLookup.php
@@ -58,7 +58,7 @@
5959 }
6060
6161 // Output end of the page
62 - $htmlOut .= "\n</body>\n</html>\n";
 62+ $htmlOut .= "\n</td>\n</tr>\n</table>\n</body>\n</html>\n";
6363
6464 echo $htmlOut;
6565
@@ -77,9 +77,24 @@
7878
7979 $congressTable = '';
8080
81 - //TODO: Change this so it looks like... anything.
82 - $congressTable .= '<pre>' . print_r( $myRepresentative, true ) . '</pre>';
83 - $congressTable .= '<pre>' . print_r( $mySenators, true ) . '</pre>';
 81+ if ( $myRepresentative ) {
 82+ $congressTable .= '<table class="person" border="0" cellspacing="0" cellpadding="0" style="border:none;">';
 83+ $congressTable .= '<tr><td class="name">'.$myRepresentative[0]['name'].'</td></tr>';
 84+ $congressTable .= '<tr><td>'.wfMsg( 'congresslookup-phone', $myRepresentative[0]['phone'] ).'</td></tr>';
 85+ $congressTable .= '<tr><td>'.wfMsg( 'congresslookup-fax', $myRepresentative[0]['fax'] ).'</td></tr>';
 86+ $congressTable .= '<tr><td><a href="'.$myRepresentative[0]['contactform'].'" target="_blank">';
 87+ $congressTable .= wfMsg( 'congresslookup-contact-form' ).'</a></td></tr>';
 88+ $congressTable .= '</table>';
 89+ }
 90+ foreach ( $mySenators as $senator ) {
 91+ $congressTable .= '<table class="person" border="0" cellspacing="0" cellpadding="0" style="border:none;">';
 92+ $congressTable .= '<tr><td class="name">'.$senator['name'].'</td></tr>';
 93+ $congressTable .= '<tr><td>'.wfMsg( 'congresslookup-phone', $senator['phone'] ).'</td></tr>';
 94+ $congressTable .= '<tr><td>'.wfMsg( 'congresslookup-fax', $senator['fax'] ).'</td></tr>';
 95+ $congressTable .= '<tr><td><a href="'.$senator['contactform'].'" target="_blank">';
 96+ $congressTable .= wfMsg( 'congresslookup-contact-form' ).'</a></td></tr>';
 97+ $congressTable .= '</table>';
 98+ }
8499
85100 return $congressTable;
86101 }
Index: trunk/extensions/CongressLookup/includes/pageBegin.html
@@ -5,5 +5,75 @@
66 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
77 <meta http-equiv="Content-Style-Type" content="text/css" />
88 <meta name="generator" content="MediaWiki 1.18wmf1" />
 9+<style type="text/css">
 10+body {
 11+ background-color: black;
 12+ color: white;
 13+ margin: 2em;
 14+ font-family: arial, sans-serif;
 15+ font-size: 15px;
 16+}
 17+a:link, a:visited {
 18+ color: #28a6b1;
 19+}
 20+a:hover, a:active {
 21+ color: #55a73c;
 22+}
 23+table#takeAction {
 24+ font-family: inherit;
 25+ font-size: inherit;
 26+ width: 100%;
 27+}
 28+table#takeAction td {
 29+ vertical-align: top;
 30+ padding: 0.2em;
 31+}
 32+table#takeAction td#instructions {
 33+ font-family: georgia, serif;
 34+ width: 60%;
 35+}
 36+table#takeAction td#contacts {
 37+ padding: 0.2em 2em;
 38+}
 39+table.person {
 40+ margin-bottom: 1em;
 41+}
 42+table.person td.name {
 43+ font-weight: bold;
 44+}
 45+p {
 46+ margin: 1em 0;
 47+}
 48+h3 {
 49+ font-weight: bold;
 50+ font-size: 12px;
 51+}
 52+</style>
953 </head>
1054 <body>
 55+<table id="takeAction" border="0" cellspacing="0" cellpadding="0" style="border:none;">
 56+ <tr>
 57+ <td id="instructions">
 58+ <p>
 59+ For maximum impact, please consider calling your US Representative and US Senators and explain that you are a constituent and that you oppose these bills and similar future legislation.
 60+ </p>
 61+
 62+ <h4>Things you may want to say to your Senator or Representative</h4>
 63+ <p>
 64+ “As one of your concerned constituents, I urge you to oppose SOPA and PIPA or any future bill that would censor free speech and damage the security of the Internet.”
 65+ </p>
 66+
 67+ <h4>Regarding Censorship</h4>
 68+ <p>
 69+ “The Internet has become an important communications tool allowing the free flow of ideas. As introduced in the House and the Senate, SOPA and PIPA would give the Justice Department and courts tremendous power to shut down entire sites. These bills ignore the principles of the First Amendment that require tailored solutions in lieu of across-the-board censorship. Unfortunately these bills represent terrible precedents for the United States and the world.”
 70+ </p>
 71+
 72+ <h4>Regarding Cybersecurity</h4>
 73+ <p>
 74+ “A safe and secure Web is vital to our privacy, our access to free knowledge, and to commerce. Hundreds of established authorities on the Internet believe that the required blocking of Internet sites in SOPA and PIPA is badly thought out and threatens Internet security.”
 75+ </p>
 76+ </td>
 77+ <td id="contacts">
 78+ <h4>Your Representatives:</h4>
 79+
 80+

Follow-up revisions

RevisionCommit summaryAuthorDate
r109119building tables the right waykaldari08:30, 17 January 2012

Comments

#Comment by NeilK (talk | contribs)   07:20, 17 January 2012

not properly escaped data concatenated directly into html. Please fix

#Comment by NeilK (talk | contribs)   08:23, 17 January 2012

ok, it's 12:20am and there isn't a fix in place... I am going to defer deployment until tomorrow morning. But will try to make that as early as possible, like 8am or something.

#Comment by NeilK (talk | contribs)   08:23, 17 January 2012

Kaldari: if you fix this at home ping me anyway (email, IRC, whatever)

Status & tagging log