@@ -124,32 +124,32 @@ discard block |
||
| 124 | 124 | <?php |
| 125 | 125 | |
| 126 | 126 | $speaker = $speech['speaker']; |
| 127 | - $speaker_name = ucfirst($speaker['name']); |
|
| 128 | - |
|
| 129 | - [$image_url, $size] = MySociety\TheyWorkForYou\Utility\Member::findMemberImage( |
|
| 130 | - $speaker['person_id'], |
|
| 131 | - true, |
|
| 132 | - $data['info']['major'] == 101 ? 'lord' : 'general' |
|
| 133 | - ); |
|
| 134 | - |
|
| 135 | - if (count($speaker['office'])) { |
|
| 136 | - $desc = []; |
|
| 137 | - foreach ($speaker['office'] as $off) { |
|
| 138 | - $desc[] = $off['pretty']; |
|
| 139 | - } |
|
| 140 | - $speaker_position = join(', ', $desc); |
|
| 141 | - } else { |
|
| 142 | - $speaker_position = _htmlentities($speaker['party']); |
|
| 143 | - if ($speaker['house'] == 1 |
|
| 127 | + $speaker_name = ucfirst($speaker['name']); |
|
| 128 | + |
|
| 129 | + [$image_url, $size] = MySociety\TheyWorkForYou\Utility\Member::findMemberImage( |
|
| 130 | + $speaker['person_id'], |
|
| 131 | + true, |
|
| 132 | + $data['info']['major'] == 101 ? 'lord' : 'general' |
|
| 133 | + ); |
|
| 134 | + |
|
| 135 | + if (count($speaker['office'])) { |
|
| 136 | + $desc = []; |
|
| 137 | + foreach ($speaker['office'] as $off) { |
|
| 138 | + $desc[] = $off['pretty']; |
|
| 139 | + } |
|
| 140 | + $speaker_position = join(', ', $desc); |
|
| 141 | + } else { |
|
| 142 | + $speaker_position = _htmlentities($speaker['party']); |
|
| 143 | + if ($speaker['house'] == 1 |
|
| 144 | 144 | && $speaker['party'] != 'Speaker' |
| 145 | 145 | && $speaker['party'] != 'Deputy Speaker' |
| 146 | 146 | && $speaker['constituency'] |
| 147 | - ) { |
|
| 148 | - $speaker_position .= ', ' . $speaker['constituency']; |
|
| 149 | - } |
|
| 150 | - } |
|
| 147 | + ) { |
|
| 148 | + $speaker_position .= ', ' . $speaker['constituency']; |
|
| 149 | + } |
|
| 150 | + } |
|
| 151 | 151 | |
| 152 | - ?> |
|
| 152 | + ?> |
|
| 153 | 153 | <a href="<?= $speech['speaker']['url'] ?>"> |
| 154 | 154 | <img src="<?= $image_url ?>" alt="Photo of <?= $speaker_name ?>"> |
| 155 | 155 | <strong class="debate-speech__speaker__name"><?= $speaker_name ?></strong> |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | <?php } ?> |
| 166 | 166 | |
| 167 | 167 | <?php # XXX |
| 168 | - if ($data['info']['major'] == 8 && preg_match('#\d{4}-\d\d-\d\d\.(.*?)\.q#', $speech['gid'], $m)) { |
|
| 169 | - ?><p class="debate-speech__question_id"><small> |
|
| 168 | + if ($data['info']['major'] == 8 && preg_match('#\d{4}-\d\d-\d\d\.(.*?)\.q#', $speech['gid'], $m)) { |
|
| 169 | + ?><p class="debate-speech__question_id"><small> |
|
| 170 | 170 | <?= "Question $m[1]" ?> |
| 171 | 171 | </small></p> |
| 172 | 172 | <?php } ?> |
@@ -193,15 +193,15 @@ discard block |
||
| 193 | 193 | <?php } ?> |
| 194 | 194 | |
| 195 | 195 | <?php if (isset($speech['mp_vote'])) { |
| 196 | - $mp_vote = [ 'vote' => $speech['mp_vote']['vote'] ]; |
|
| 197 | - if (isset($speech['before_mp'])) { |
|
| 198 | - $before_mp = $speech['before_mp']; |
|
| 199 | - } |
|
| 200 | - if (isset($speech['after_mp'])) { |
|
| 201 | - $after_mp = $speech['after_mp']; |
|
| 202 | - } |
|
| 203 | - include dirname(__FILE__) . '/../divisions/_your_mp.php'; |
|
| 204 | - } ?> |
|
| 196 | + $mp_vote = [ 'vote' => $speech['mp_vote']['vote'] ]; |
|
| 197 | + if (isset($speech['before_mp'])) { |
|
| 198 | + $before_mp = $speech['before_mp']; |
|
| 199 | + } |
|
| 200 | + if (isset($speech['after_mp'])) { |
|
| 201 | + $after_mp = $speech['after_mp']; |
|
| 202 | + } |
|
| 203 | + include dirname(__FILE__) . '/../divisions/_your_mp.php'; |
|
| 204 | + } ?> |
|
| 205 | 205 | <div class="debate-speech__division__details"> |
| 206 | 206 | <?php include dirname(__FILE__) . '/../divisions/_votes.php'; ?> |
| 207 | 207 | </div> |