From 9dd803a2181fda4181b426d8c759f2454c9f13ee Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 14 Dec 2023 17:41:49 +0000 Subject: [PATCH] Change display of strong/weak votes. Fixes #1744. --- classes/Divisions.php | 6 +-- tests/DivisionsTest.php | 21 ++++---- www/docs/js/main.js | 6 --- www/docs/style/sass/pages/_mp.scss | 28 ---------- .../html/mp/_division_description.php | 2 +- .../templates/html/mp/divisions.php | 52 +++++++++++++------ .../templates/html/mp/recent.php | 1 - 7 files changed, 47 insertions(+), 69 deletions(-) diff --git a/classes/Divisions.php b/classes/Divisions.php index e36b080538..90bffe5097 100644 --- a/classes/Divisions.php +++ b/classes/Divisions.php @@ -621,7 +621,6 @@ private function divisionsByPolicy($q) { if ( !array_key_exists($policy_id, $policies) ) { $policies[$policy_id] = array( 'policy_id' => $policy_id, - 'weak_count' => 0, 'divisions' => array() ); if ( $this->policies ) { @@ -633,12 +632,9 @@ private function divisionsByPolicy($q) { } } + $division = $this->getDivisionDetails($row); - if ( !$division['strong'] ) { - $policies[$policy_id]['weak_count']++; - } - $policies[$policy_id]['divisions'][] = $division; }; diff --git a/tests/DivisionsTest.php b/tests/DivisionsTest.php index 0f9ff97a14..24ccb1fd7e 100644 --- a/tests/DivisionsTest.php +++ b/tests/DivisionsTest.php @@ -101,15 +101,14 @@ public function testVotedTellYesWithYesSentence() { public function testStrongIndicators() { $page = $this->fetch_division_page(); - $this->assertContains('
  • assertContains('
  • #s', $page, $m); + $minor = $m[0]; + $this->assertContains('
  • assertContains('
  • fetch_mp_recent_page(); - $this->assertContains('
  • assertNotContains('
  • li - - .policy-vote__text, - .policy-vote__date { - font-size: 0.9em; - } - - .policy-vote__text { - color: #666; - } -} - .policy-vote__date { display: block; color: #b5af9d; // desaturated taupe colour @@ -709,14 +689,6 @@ html.js { margin-bottom: 0; } } - - .js-show-all-votes { - display: none; - } -} - -html.js .policy-votes-list-footer .js-show-all-votes { - display: block; } .voting-information-provenance { diff --git a/www/includes/easyparliament/templates/html/mp/_division_description.php b/www/includes/easyparliament/templates/html/mp/_division_description.php index ef7c39e005..4ce939ed41 100644 --- a/www/includes/easyparliament/templates/html/mp/_division_description.php +++ b/www/includes/easyparliament/templates/html/mp/_division_description.php @@ -1,4 +1,4 @@ -
  • +
  • On : '2020-06-01' && $division['date'] < '2020-06-10' && $division['vote'] == 'absent') { ?> diff --git a/www/includes/easyparliament/templates/html/mp/divisions.php b/www/includes/easyparliament/templates/html/mp/divisions.php index 2ebe4477a7..143baceb90 100644 --- a/www/includes/easyparliament/templates/html/mp/divisions.php +++ b/www/includes/easyparliament/templates/html/mp/divisions.php @@ -39,19 +39,31 @@ - - + - - +

    .

    @@ -69,8 +81,9 @@
    - - +

    @@ -84,9 +97,6 @@ data on PublicWhip.org.uk.

    -

    votes about :

    We don’t have enough information to calculate ’s position on this issue @@ -97,17 +107,26 @@

    + +

    Scoring votes

      -
    + + +

    Informative votes

    +
      + +
    + - diff --git a/www/includes/easyparliament/templates/html/mp/recent.php b/www/includes/easyparliament/templates/html/mp/recent.php index 62354dfb6b..b86866ce52 100644 --- a/www/includes/easyparliament/templates/html/mp/recent.php +++ b/www/includes/easyparliament/templates/html/mp/recent.php @@ -26,7 +26,6 @@