From 9162666674aacbce2f3dbb1b8bfc55db728490d0 Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Tue, 13 Feb 2024 21:31:35 +0000 Subject: [PATCH 1/5] Add parliament based page names --- www/includes/easyparliament/metadata.php | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/www/includes/easyparliament/metadata.php b/www/includes/easyparliament/metadata.php index 5c9df7c50a..dd4316deb6 100644 --- a/www/includes/easyparliament/metadata.php +++ b/www/includes/easyparliament/metadata.php @@ -386,6 +386,42 @@ 'title' => 'Recent Votes', 'url' => 'divisions/' ), + 'divisions_recent_commons' => array ( + 'menu' => array ( + 'text' => 'Recent Votes (Commons)', + 'title' => 'Recent Votes (Commons)' + ), + 'parent' => 'hansard', + 'title' => 'Recent Votes', + 'url' => 'divisions/?house=commons' + ), + 'divisions_recent_lords' => array ( + 'menu' => array ( + 'text' => 'Recent Votes (Lords)', + 'title' => 'Recent Votes (Lords)' + ), + 'parent' => 'hansard', + 'title' => 'Recent Votes', + 'url' => 'divisions/?house=lords' + ), + 'divisions_recent_wales' => array ( + 'menu' => array ( + 'text' => gettext('Recent Votes'), + 'title' => gettext('Recent Votes') + ), + 'parent' => 'wales_home', + 'title' => gettext('Recent Votes'), + 'url' => 'divisions/?house=senedd' + ), + 'divisions_recent_sp' => array ( + 'menu' => array ( + 'text' => 'Recent Votes', + 'title' => 'Recent Votes' + ), + 'parent' => 'sp_home', + 'title' => 'Recent Votes', + 'url' => 'divisions/?house=scotland' + ), 'divisions_vote' => array ( 'parent' => 'divisions_recent', 'title' => 'Vote', From 2152c3cbb75f18154d42d64b9ed578fd49c6a57e Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Tue, 13 Feb 2024 21:31:58 +0000 Subject: [PATCH 2/5] Link parliament-specific recent divisions from menus --- classes/Renderer/Header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Renderer/Header.php b/classes/Renderer/Header.php index fc18eddffa..81f1aa6e8a 100644 --- a/classes/Renderer/Header.php +++ b/classes/Renderer/Header.php @@ -314,10 +314,10 @@ private function get_top_and_bottom_links() { // we're within that section. $nav_items = array ( array('home'), - array('hansard', 'mps', 'peers', 'alldebatesfront', 'wranswmsfront', 'pbc_front', 'divisions_recent', 'calendar_summary'), - array('sp_home', 'spoverview', 'msps', 'spdebatesfront', 'spwransfront'), + array('hansard', 'mps', 'peers', 'alldebatesfront', 'wranswmsfront', 'pbc_front', 'divisions_recent_commons', 'divisions_recent_lords', 'calendar_summary'), + array('sp_home', 'spoverview', 'msps', 'spdebatesfront', 'spwransfront', 'divisions_recent_sp'), array('ni_home', 'nioverview', 'mlas'), - array('wales_home', 'seneddoverview', 'mss', 'wales_debates'), + array('wales_home', 'seneddoverview', 'mss', 'wales_debates', 'divisions_recent_wales'), array('london_home', 'lmqsfront', 'london-assembly-members'), ); From 53429fafa2d26e35391f10892521397d9db0c315 Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Tue, 13 Feb 2024 21:32:34 +0000 Subject: [PATCH 3/5] Set recent_divisions $this_page to trigger menus --- www/docs/divisions/index.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/www/docs/divisions/index.php b/www/docs/divisions/index.php index b584efa4f5..57d5b6ec3c 100644 --- a/www/docs/divisions/index.php +++ b/www/docs/divisions/index.php @@ -3,7 +3,6 @@ include_once '../../includes/easyparliament/init.php'; include_once INCLUDESPATH . 'easyparliament/member.php'; -$this_page = 'divisions_recent'; $MEMBER = null; if ($THEUSER->postcode_is_set()) { @@ -11,6 +10,20 @@ } $houses = get_http_var('house', '', true); + +// Set to a special version of the page name to get right parliament menus +if ($houses == 'scotland') { + $this_page = 'divisions_recent_sp'; +} elseif ($houses == 'senedd') { + $this_page = "divisions_recent_wales"; +} elseif ($houses == 'commons') { + $this_page = 'divisions_recent_commons'; +} elseif ($houses == 'lords') { + $this_page = 'divisions_recent_lords'; +} else { + $this_page = 'divisions_recent'; +} + $divisions = new MySociety\TheyWorkForYou\Divisions($MEMBER); $data = $divisions->getRecentDivisions(30, $houses); From 737e94c9fea9de7a55d40debe4e508d08fbfa8fd Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Tue, 13 Feb 2024 21:32:49 +0000 Subject: [PATCH 4/5] Add more specific menus to homepage --- .../templates/html/homepage/devolved-list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/includes/easyparliament/templates/html/homepage/devolved-list.php b/www/includes/easyparliament/templates/html/homepage/devolved-list.php index 71107dfa0e..2bda5ca1e5 100644 --- a/www/includes/easyparliament/templates/html/homepage/devolved-list.php +++ b/www/includes/easyparliament/templates/html/homepage/devolved-list.php @@ -1,8 +1,8 @@ Date: Thu, 15 Feb 2024 09:53:21 +0000 Subject: [PATCH 5/5] Make recent votes descriptions more individual --- locale/TheyWorkForYou.pot | 20 +++++++++++++++++++ .../cy_GB.UTF-8/LC_MESSAGES/TheyWorkForYou.po | 20 +++++++++++++++++++ www/docs/divisions/index.php | 1 + .../templates/html/divisions/index.php | 13 +++++++++++- 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/locale/TheyWorkForYou.pot b/locale/TheyWorkForYou.pot index 888be3e9bb..337c4fbbed 100644 --- a/locale/TheyWorkForYou.pot +++ b/locale/TheyWorkForYou.pot @@ -1628,6 +1628,26 @@ msgid "What is this?" msgstr "" #: www/includes/easyparliament/templates/html/divisions/index.php:47 +msgid "This list contains votes from the House of Commons." +msgstr "" + +#: www/includes/easyparliament/templates/html/divisions/index.php:49 +msgid "This list contains votes from the House of Lords." +msgstr "" + +#: www/includes/easyparliament/templates/html/divisions/index.php:51 +msgid "This list contains votes from Public Bill Committees." +msgstr "" + +#: www/includes/easyparliament/templates/html/divisions/index.php:53 +msgid "This list contains votes from the Scottish Parliament." +msgstr "" + +#: www/includes/easyparliament/templates/html/divisions/index.php:55 +msgid "This list contains votes from the Senedd." +msgstr "" + +#: www/includes/easyparliament/templates/html/divisions/index.php:57 msgid "" "This list contains votes from the House of Commons, House of Lords, Public " "Bill Committees, Senedd, and the Scottish Parliament." diff --git a/locale/cy_GB.UTF-8/LC_MESSAGES/TheyWorkForYou.po b/locale/cy_GB.UTF-8/LC_MESSAGES/TheyWorkForYou.po index b803dd70ce..84b04485d5 100644 --- a/locale/cy_GB.UTF-8/LC_MESSAGES/TheyWorkForYou.po +++ b/locale/cy_GB.UTF-8/LC_MESSAGES/TheyWorkForYou.po @@ -1547,6 +1547,26 @@ msgid "What is this?" msgstr "Beth yw hwn?" #: www/includes/easyparliament/templates/html/divisions/index.php:47 +msgid "This list contains votes from the House of Commons." +msgstr "Mae'r rhestr hon yn cynnwys pleidleisiau o Tŷ'r Arglwyddi" + +#: www/includes/easyparliament/templates/html/divisions/index.php:49 +msgid "This list contains votes from the House of Lords." +msgstr "Mae'r rhestr hon yn cynnwys pleidleisiau o Pwyllgorau Cyhoeddus" + +#: www/includes/easyparliament/templates/html/divisions/index.php:51 +msgid "This list contains votes from Public Bill Committees." +msgstr "Mae'r rhestr hon yn cynnwys pleidleisiau o Pwyllgorau Cyhoeddus" + +#: www/includes/easyparliament/templates/html/divisions/index.php:53 +msgid "This list contains votes from the Scottish Parliament." +msgstr "Mae'r rhestr hon yn cynnwys pleidleisiau o'r Senedd Cymru" + +#: www/includes/easyparliament/templates/html/divisions/index.php:55 +msgid "This list contains votes from the Senedd." +msgstr "Mae'r rhestr hon yn cynnwys pleidleisiau o'r Senedd yr Alban" + +#: www/includes/easyparliament/templates/html/divisions/index.php:57 msgid "This list contains votes from the House of Commons, House of Lords, Public Bill Committees, Senedd, and the Scottish Parliament." msgstr "Mae'r rhestr hon yn cynnwys pleidleisiau o Dŷ'r Cyffredin, Tŷ'r Arglwyddi, Pwyllgorau Cyhoeddus, Seneddau Cymru a’r Alban." diff --git a/www/docs/divisions/index.php b/www/docs/divisions/index.php index 57d5b6ec3c..7dc0e84295 100644 --- a/www/docs/divisions/index.php +++ b/www/docs/divisions/index.php @@ -32,6 +32,7 @@ } $data['last_updated'] = MySociety\TheyWorkForYou\Divisions::getMostRecentDivisionDate()['latest']; +$data["houses"] = $houses; $template = 'divisions/index'; MySociety\TheyWorkForYou\Renderer::output($template, $data); diff --git a/www/includes/easyparliament/templates/html/divisions/index.php b/www/includes/easyparliament/templates/html/divisions/index.php index 22f2b940f3..40759de6c2 100644 --- a/www/includes/easyparliament/templates/html/divisions/index.php +++ b/www/includes/easyparliament/templates/html/divisions/index.php @@ -43,8 +43,19 @@

- + +

+ +

+ +

+ +

+ +

+

+