From 377dfc8f11f4fdc721deeaa8d1a2519d1694d3f7 Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Mon, 8 Jul 2024 20:43:15 +0000 Subject: [PATCH] early london approach --- classes/SectionView/LondonView.php | 53 +++++++++++++++++++ www/docs/style/sass/parts/_panels.scss | 10 ++++ .../templates/html/london/index.php | 47 ++-------------- 3 files changed, 67 insertions(+), 43 deletions(-) diff --git a/classes/SectionView/LondonView.php b/classes/SectionView/LondonView.php index 566c6f7174..b68503a965 100644 --- a/classes/SectionView/LondonView.php +++ b/classes/SectionView/LondonView.php @@ -6,6 +6,59 @@ class LondonView extends SectionView { public $major = 9; protected $class = 'LMQLIST'; + protected function display_front() { + if (get_http_var('more')) { + return parent::display_front(); + } else { + $parent_data = parent::display_front(); + $data = $this->display_front_london(); + return array_merge($parent_data, $data); + } + } + + + protected function display_front_london() { + global $this_page; + $this_page = "londonoverview"; + + $data = array(); + + $data['template'] = 'london/index'; + $data['regional'] = []; + $data['search_box'] = $this->getSearchBox($data); + $data['featured'] = null; + $data['debates'] = ['recent' => []]; + + return $data; + } + + protected function getSearchBox(array $data): \MySociety\TheyWorkForYou\Search\SearchBox{ + + global $THEUSER; + + if ($THEUSER->isloggedin() && $THEUSER->postcode() != '' || $THEUSER->postcode_is_set()) { + $postcode = $THEUSER->postcode(); + } else { + $postcode = null; + } + + $search_box = new \MySociety\TheyWorkForYou\Search\SearchBox(); + $search_box->homepage_panel_class = "panel--homepage--london"; + $search_box->homepage_subhead = "Greater London Authority"; + $search_box->homepage_desc = ""; + $search_box->search_section = "london"; + $search_box->quick_links = []; + if (count($data["regional"])) { + $constituency = $data["regional"][0]["constituency"]; + $search_box->add_quick_link('Find out more about your MLAs for ' . $constituency, '/postcode/?pc=' . $postcode); + } + $search_box->add_quick_link('Create and manage email alerts', '/alert/'); + $search_box->add_quick_link('Subscribe to our newsletter', 'https://www.mysociety.org/subscribe/'); + $search_box->add_quick_link('Donate to support our work', '/support-us/'); + return $search_box; + } + + protected function front_content() { return $this->list->display('recent_wrans', array('days'=>30, 'num'=>20), 'none'); } diff --git a/www/docs/style/sass/parts/_panels.scss b/www/docs/style/sass/parts/_panels.scss index 8389f8a130..0cc85baa41 100644 --- a/www/docs/style/sass/parts/_panels.scss +++ b/www/docs/style/sass/parts/_panels.scss @@ -39,6 +39,16 @@ } } +.panel--homepage--london { + background: rgba(#000, 0.5) url('../img/london-photo.jpg') center/cover no-repeat; + background-blend-mode: overlay; /* Blends the color with the image */ + + .quick-links__item { + background-color: #444; + display: inline-block; + } +} + .panel--homepage--overall { background: rgba(#000, 0.5) url('../img/parliament-photo.jpg') center/cover no-repeat; diff --git a/www/includes/easyparliament/templates/html/london/index.php b/www/includes/easyparliament/templates/html/london/index.php index 1212c8ec52..c09614fe0e 100644 --- a/www/includes/easyparliament/templates/html/london/index.php +++ b/www/includes/easyparliament/templates/html/london/index.php @@ -3,51 +3,12 @@
'Create and manage email alerts', 'url' => '/alert/']; - $quick_links[] = ['title' => 'Subscribe to our newsletter', 'url' => 'https://www.mysociety.org/subscribe/']; - $quick_links[] = ['title' => 'Donate to support our work', 'url' => '/support-us/']; include dirname(__FILE__) . '/../homepage/search-box.php'; ?> -
-
- -
-

Create an alert

-

Stay informed!

-

Get an email every time an issue you care about is mentioned in questions to the Mayor of London (and more)

- Create an alert → -
-
-
- -
-
-
-

Recently answered questions to the Mayor of London

-
-
-
-

What is the London Assembly?

- -

The London Assembly is a 25-member elected body, part of the Greater London Authority, that scrutinises the activities of the Mayor of London.

- -

The London Assembly was established in 2000 and meets at City Hall on the south bank of the River Thames, close to Tower Bridge. The Assembly is also able to investigate other issues of importance to Londoners (transport, environmental matters, etc.), publish its findings and recommendations, and make proposals to the Mayor.

-
-
-
+
+