Skip to content

Commit

Permalink
early london approach
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Jul 8, 2024
1 parent b16b13f commit 377dfc8
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 43 deletions.
53 changes: 53 additions & 0 deletions classes/SectionView/LondonView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
10 changes: 10 additions & 0 deletions www/docs/style/sass/parts/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
47 changes: 4 additions & 43 deletions www/includes/easyparliament/templates/html/london/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,12 @@
<div class="homepage-panels">

<?php
$homepage_panel_class = "panel--homepage--london";
$homepage_subhead = "Greater London Authority";
$homepage_desc = "";
$search_section = "lmq";
$quick_links = [];
$quick_links[] = ['title' => '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';
?>

<div class="panel panel--flushtop clearfix">
<div class="row nested-row">
<div class="homepage-featured-content homepage-content-section">
<?php if ( $featured ) {
include dirname(__FILE__) . "/../homepage/featured.php";
} ?>
</div>
<div class="homepage-create-alert homepage-content-section">
<h2>Create an alert</h2>
<h3 class="create-alert__heading">Stay informed!</h3>
<p>Get an email every time an issue you care about is mentioned in questions to the Mayor of London (and more)</p>
<a href="<?= $urls['alert'] ?>" class="button create-alert__button button--violet">Create an alert &rarr;</a>
</div>
</div>
</div>

<div class="panel panel--flushtop clearfix">
<div class="row nested-row">
<div class="homepage-recently homepage-content-section">
<h2>Recently answered questions to the Mayor of London</h2>
<ul class="recently__list"><?php
foreach ( $debates['recent'] as $recent ) {
include dirname(__FILE__) . '/../homepage/recent-debates.php';
}
?></ul>
</div>
<div class="homepage-upcoming homepage-content-section">
<h2>What is the London Assembly?</h2>

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

<p>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.</p>
</div>
</div>
</div>
<?php
include dirname(__FILE__) . '/../section/_business_section.php';
?>
</div>
</div>

0 comments on commit 377dfc8

Please sign in to comment.