Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved division linking #1767

Merged
merged 5 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions classes/Renderer/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
);

Expand Down
20 changes: 20 additions & 0 deletions locale/TheyWorkForYou.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
20 changes: 20 additions & 0 deletions locale/cy_GB.UTF-8/LC_MESSAGES/TheyWorkForYou.po
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down
16 changes: 15 additions & 1 deletion www/docs/divisions/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@
include_once '../../includes/easyparliament/init.php';
include_once INCLUDESPATH . 'easyparliament/member.php';

$this_page = 'divisions_recent';

$MEMBER = null;
if ($THEUSER->postcode_is_set()) {
$MEMBER = new MySociety\TheyWorkForYou\Member(array('postcode' => $THEUSER->postcode(), 'house' => HOUSE_TYPE_COMMONS));
}

$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);

Expand All @@ -19,6 +32,7 @@
}

$data['last_updated'] = MySociety\TheyWorkForYou\Divisions::getMostRecentDivisionDate()['latest'];
$data["houses"] = $houses;

$template = 'divisions/index';
MySociety\TheyWorkForYou\Renderer::output($template, $data);
36 changes: 36 additions & 0 deletions www/includes/easyparliament/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
13 changes: 12 additions & 1 deletion www/includes/easyparliament/templates/html/divisions/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,19 @@
<div class="business-section__secondary">
<div class="business-section__secondary__item">
<h3><?= gettext('What is this?') ?></h3>

<?php if ($houses == 'commons') { ?>
<p><?= gettext('This list contains votes from the House of Commons.') ?></p>
<?php } elseif ($houses == 'lords') { ?>
<p><?= gettext('This list contains votes from the House of Lords.') ?></p>
<?php } elseif ($houses == 'pbc') { ?>
<p><?= gettext('This list contains votes from Public Bill Committees.') ?></p>
<?php } elseif ($houses == 'scotland') { ?>
<p><?= gettext('This list contains votes from the Scottish Parliament.') ?></p>
<?php } elseif ($houses == 'senedd') { ?>
<p><?= gettext('This list contains votes from the Senedd.') ?></p>
<?php } else { ?>
<p><?= gettext('This list contains votes from the House of Commons, House of Lords, Public Bill Committees, Senedd, and the Scottish Parliament.') ?></p>
<?php } ?>

<p><?= gettext('Only show votes from:') ?></p>
<ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
$nav_items = array (
array('hansard', 'alldebatesfront', 'mps', 'peers', 'wranswmsfront'),
array('sp_home', 'sp_home', 'spdebatesfront', 'msps', 'spwransfront'),
array('wales_home', 'wales_home', 'wales_debates', 'mss', 'welshlanguage'),
array('hansard', 'alldebatesfront', 'mps', 'peers', 'wranswmsfront', 'divisions_recent_commons', 'divisions_recent_lords'),
array('sp_home', 'sp_home', 'spdebatesfront', 'msps', 'spwransfront', 'divisions_recent_sp'),
array('wales_home', 'wales_home', 'wales_debates', 'mss', 'welshlanguage', 'divisions_recent_wales'),
array('ni_home', 'ni_home', 'nioverview', 'mlas'),
);

Expand Down
Loading