-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Search box expanded into generic title box - Merriweather for new style title - SearchBox class controls config for different parliaments - Temp images for different parliament backgrounds.
- Loading branch information
Showing
19 changed files
with
291 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace MySociety\TheyWorkForYou\Search; | ||
|
||
|
||
class SearchBox | ||
{ | ||
public string $homepage_panel_class; | ||
public string $homepage_subhead; | ||
public string $homepage_desc; | ||
public string $search_section; | ||
public array $quick_links; | ||
|
||
public function __construct(string $homepage_panel_class = '', | ||
string $homepage_subhead = '', | ||
string $homepage_desc = '', | ||
string $search_section = '', | ||
array $quick_links = []) | ||
{ | ||
$this->homepage_panel_class = $homepage_panel_class; | ||
$this->homepage_subhead = $homepage_subhead; | ||
$this->homepage_desc = $homepage_desc; | ||
$this->search_section = $search_section; | ||
$this->quick_links = $quick_links; | ||
} | ||
|
||
public function add_quick_link(string $title, string $url): void | ||
{ | ||
$this->quick_links[] = ['title' => $title, 'url' => $url]; | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
www/includes/easyparliament/templates/html/homepage/search-box.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<div class="panel panel--primary <?= $search_box->homepage_panel_class ?>"> | ||
<div class ="row nested-row"> | ||
<div class="home__search"> | ||
<div> | ||
<h1 class="site-home__logo">TheyWorkForYou</h1> | ||
</div> | ||
<?php if ($search_box->homepage_subhead) { ?> | ||
<div> | ||
<h2 class="site-home__logo" style="color:#fff"><?= $search_box->homepage_subhead ?></h2> | ||
</div> | ||
<?php } ?> | ||
<?php if ($search_box->homepage_desc) { ?> | ||
<p><?= $search_box->homepage_desc ?></p> | ||
<?php } ?> | ||
</div> | ||
</div> | ||
<div class="row nested-row "> | ||
<div class="home__search"> | ||
<form action="<?= $urls['search'] ?>" method="GET" onsubmit="trackFormSubmit(this, 'Search', 'Submit', 'Home'); return false;"> | ||
<?php if ($search_box->search_section) { ?> | ||
<input type="hidden" name="section" value="<?= $search_box->search_section ?>"> | ||
<?php } ?> | ||
<div class="row collapse"> | ||
<div class="medium-9 columns"> | ||
<input name="q" id="q" class="homepage-search__input" type="text" placeholder="Enter your postcode, person, or topic" /> | ||
</div> | ||
<div class="medium-3 columns"> | ||
<input type="submit" value="Search" class="button homepage-search__button" /> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
</div> | ||
<div class="home__search-suggestions"> | ||
<?php if (count($popular_searches)) { ?> | ||
<p>Popular searches today</p> | ||
<ul class="search-suggestions__list"> | ||
<?php foreach ($popular_searches as $i => $popular_search) { ?> | ||
<li><?= $popular_search['display']; ?></li> | ||
<?php } ?> | ||
</ul> | ||
<?php } ?> | ||
</div> | ||
<div class="home__quick-links"> | ||
<h3>Quick links</h3> | ||
<ul class="quick-links__list"> | ||
<?php foreach ($search_box->quick_links as $search_box->quick_link) { ?> | ||
<li><div class="quick-links__item"><a href="<?= $search_box->quick_link['url'] ?>"><?= $search_box->quick_link['title'] ?></a></div></li> | ||
<?php } ?> | ||
</ul> | ||
|
||
</div> | ||
<div> | ||
<p style="margin-bottom:0px">Built by | ||
<a href="https://www.mysociety.org?utm_source=theyworkforyou.com&utm_medium=link&utm_campaign=twfy_search_box" class="mysoc__org__logo mysoc__org__logo--mysociety">mySociety</a> | ||
</p> | ||
</div> | ||
</div> |
Oops, something went wrong.