Skip to content

Commit

Permalink
New search box approach with temp photos
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Jul 8, 2024
1 parent ddd50fe commit 4b019d8
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 340 deletions.
Binary file added www/docs/style/img/london-photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/style/img/niassembly-photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/style/img/parliament-photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/style/img/scotland-photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/docs/style/img/senedd-photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 13 additions & 6 deletions www/docs/style/sass/pages/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,25 @@ input.homepage-search__button {
}

.home__search-suggestions {
@include grid-column(12);
margin-top: 1em;
@media (min-width: $large-screen) {
margin-top: 0;
@include grid-column(4);
}
margin-top: 0;

h3 {
font-size: emCalc(14);
font-weight: normal;
}
}

.home__search-suggestions p, .home__search-suggestions ul {
display: inline-block;
margin: 0;
vertical-align: middle;
}

.home__search-suggestions p {
margin-right: 10px; /* Add space between p and ul */
}


.search-suggestions__list {
@include inline-list;
font-size: emCalc(14);
Expand Down
32 changes: 28 additions & 4 deletions www/docs/style/sass/parts/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,34 @@
}
}


.panel--homepage--overall {
background: rgba(#000, 0.5) url('../img/parliament-photo.jpg') center/cover no-repeat;
background-blend-mode: overlay; /* Blends the color with the image */
}

.panel--homepage--senedd {
background: rgba(#000, 0.5) url('../img/senedd-photo.jpg') center/cover no-repeat;
background-blend-mode: overlay; /* Blends the color with the image */
}

.panel--homepage--scotland {
background: rgba(#000, 0.5) url('../img/scotland-photo.jpg') center/cover no-repeat;
background-blend-mode: overlay; /* Blends the color with the image */
}

.panel--homepage--niassembly {
background: rgba(#000, 0.5) url('../img/niassembly-photo.jpg') center/cover no-repeat;
background-blend-mode: overlay; /* Blends the color with the image */
}

.panel--primary {
background-color: $colour_primary;
color: #fff;
// background-color: $colour_primary;
// background-image: url('../img/houses-of-parliament-tablet.jpg');
// background: linear-gradient(to right, $colour_primary 65%, rgba($colour_primary, 0.0) 68%, rgba($colour_primary, 0.0)), url('../img/houses-of-parliament-tablet.jpg');
background-size: cover;
background-repeat: no-repeat;
color: $colour_off_white;

a, h2, h3 {
color: inherit;
Expand Down Expand Up @@ -77,11 +102,10 @@
}

.panel--primary {
background-color: $primary-color;
color: $colour_off_white;

h1 {
color: $colour_off_white;
margin-bottom: 5px;
}

h2, label, h3, li {
Expand Down
59 changes: 59 additions & 0 deletions www/includes/easyparliament/templates/html/homepage/search-box.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<div class="panel panel--primary <?= $homepage_panel_class ?>">
<div class ="row nested-row">
<div class="home__search">
<div>
<h1 class="site-home__logo">TheyWorkForYou</h1>
</div>
<?php if ($homepage_subhead) { ?>
<div>
<h2 class="site-home__logo" style="color:#fff"><?= $homepage_subhead ?></h2>
</div>
<?php } ?>
<?php if ($homepage_desc) { ?>
<p><?= $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_section) { ?>
<input type="hidden" name="section" value="<?= $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" style="padding-top:20px;">
<h3>Quick links</h3>
<ul class="quick-links__list">
<?php foreach ($quick_links as $quick_link) { ?>
<li><a href="<?= $quick_link['url'] ?>"><?= $quick_link['title'] ?></a></li>
<?php } ?>
</ul>

</div>
<div>
<p style="margin-bottom:0px">Built by
<a href="https://www.mysociety.org?utm_source=theyworkforyou.com&amp;utm_content=footer+logo&amp;utm_medium=link&amp;utm_campaign=mysoc_footer" class="mysoc__org__logo mysoc__org__logo--mysociety">mySociety</a>
</p>
</div>
</div>
67 changes: 15 additions & 52 deletions www/includes/easyparliament/templates/html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,21 @@

<div class="full-page__row">
<div class="homepage-panels">


<div class="panel panel--primary">
<div class ="row nested-row">
<div class="home__search">
<h1 class="site-home__logo" >TheyWorkForYou</h1>
<p>Helping you understand who represents you, across the UK's Parliaments.</p>
</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;">
<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 class="home__search-suggestions">
<?php if (count($popular_searches)) { ?>
<h3>Popular searches today</h3>
<ul class="search-suggestions__list">
<?php foreach ($popular_searches as $i => $popular_search) { ?>
<li><?= $popular_search['display']; ?></li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
<div class="home__quick-links" style="padding-top:20px;">
<h3>Quick links</h3>
<ul class="quick-links__list">
<li><a href="/alert/">Create and manage email alerts</a></li>

<?php if (count($mp_data)) { ?>
<li>Find our more about <a href="<?= $mp_data['mp_url']?>"><?= $mp_data['former'] ? 'your former MP ' : 'your MP ' ?><?= $mp_data['name'] ?></a></li>
<?php } ?>
<li><a href="https://www.mysociety.org/subscribe/">Subscribe to our newsletter</a></li>
<li><a href="/support-us/">Donate to support our work</a></li>
</ul>

</div>
<div>
<p style="margin-bottom:0px">Built by
<a href="https://www.mysociety.org?utm_source=theyworkforyou.com&amp;utm_content=footer+logo&amp;utm_medium=link&amp;utm_campaign=mysoc_footer" class="mysoc__org__logo mysoc__org__logo--mysociety">mySociety</a>
</p>
</div>
</div>

<?php
$homepage_panel_class = "panel--homepage--overall";
$homepage_subhead = "";
$homepage_desc = "Helping you understand who represents you, across the UK's Parliaments.";
$search_section = "";
$quick_links = [];
$quick_links[] = ['title' => 'Create and manage email alerts', 'url' => '/alert/'];
if (count($mp_data)) {
$quick_links[] = ['title' => 'Find out more about your MP', 'url' => $mp_data['mp_url']];
}
$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 'homepage/search-box.php';
?>

<div class="panel panel--flushtop clearfix">
<div class="row nested-row">
Expand Down
80 changes: 15 additions & 65 deletions www/includes/easyparliament/templates/html/london/index.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
<div class="hero">
<div class="row">
<div class="hero__mp-search">
<div class="hero__mp-search__wrap">
<h1>Find out more about your AMs</h1>
<div class="row collapse">
<?php if ( count($data['regional']) > 0 ) { ?>
<ul class="homepage-rep-list">
<li>Your Assembly Memberss: </li>
<?php foreach ( $data['regional'] as $member ) { ?>
<li class="homepage-rep-list__rep"><a href="/london-assembly-member/?p=<?= $member['person_id'] ?>"><?= $member['name'] ?></a></li>
<?php } ?>
</ul>
<?php } else { ?>
<form action="/postcode/" class="mp-search__form" onsubmit="trackFormSubmit(this, 'PostcodeSearch', 'Submit', 'LondonHome'); return false;">
<label for="postcode">Your London postcode</label>
<div class="medium-9 columns">
<input id="postcode" name="pc" class="homepage-search__input" type="text" placeholder="TF1 8GH" />
</div>
<div class="medium-3 columns">
<input type="submit" value="Find out &rarr;" class="button homepage-search__button" />
</div>
</form>
<?php } ?>
</div>
</div>
</div>
<div class="hero__site-intro">
<div class="hero__site-intro__wrap">
<h2>Democracy: it&rsquo;s for everyone</h2>
<p>You shouldn&rsquo;t have to be an expert to understand what goes on in the London Assembly. </p>
<p>TheyWorkForYou takes open data from the London Assembly, and presents it in a way that&rsquo;s easy to follow &ndash; for everyone.</p>
<a href="/about/" class="site-intro__more-link">Find out more about TheyWorkForYou <i>&rarr;</i></a>
</div>
</div>
</div>
</div>

<div class="full-page__row">
<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">
Expand All @@ -52,34 +29,7 @@
</div>
</div>
</div>
<div class="panel panel--inverted">
<div class="row nested-row">
<div class="home__search">
<form action="<?= $urls['search'] ?>" method="GET"onsubmit="trackFormSubmit(this, 'Search', 'Submit', 'Home'); return false;">
<input type="hidden" name="section" value="lmq">
<label for="q">Search questions to the Mayor of London</label>
<div class="row collapse">
<div class="medium-9 columns">
<input name="q" id="q" class="homepage-search__input" type="text" placeholder="Enter a keyword, phrase, or person" />
</div>
<div class="medium-3 columns">
<input type="submit" value="Search" class="button homepage-search__button" />
</div>
</div>
</form>
</div>
<div class="home__search-suggestions">
<?php if (count($popular_searches)) { ?>
<h3>Popular searches today</h3>
<ul class="search-suggestions__list">
<?php foreach ($popular_searches as $i => $popular_search) { ?>
<li><?= $popular_search['display']; ?></li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
</div>

<div class="panel panel--flushtop clearfix">
<div class="row nested-row">
<div class="homepage-recently homepage-content-section">
Expand Down
79 changes: 14 additions & 65 deletions www/includes/easyparliament/templates/html/ni/index.php
Original file line number Diff line number Diff line change
@@ -1,70 +1,19 @@
<div class="hero">
<div class="row">
<div class="hero__mp-search">
<div class="hero__mp-search__wrap">
<h1>Find out more about your MLAs</h1>
<div class="row collapse">
<?php if ( count($data['regional']) > 0 ) { ?>
<ul class="homepage-rep-list">
<li>Your MLAs: </li>
<?php foreach ( $data['regional'] as $mla ) { ?>
<li class="homepage-rep-list__rep"><a href="/mla/?p=<?= $mla['person_id'] ?>"><?= $mla['name'] ?></a></li>
<?php } ?>
</ul>
<?php } else { ?>
<form action="/postcode/" class="mp-search__form" onsubmit="trackFormSubmit(this, 'PostcodeSearch', 'Submit', 'NIHome'); return false;">
<label for="postcode">Your Northern Ireland postcode</label>
<div class="medium-9 columns">
<input id="postcode" name="pc" class="homepage-search__input" type="text" placeholder="TF1 8GH" />
</div>
<div class="medium-3 columns">
<input type="submit" value="Find out &rarr;" class="button homepage-search__button" />
</div>
</form>
<?php } ?>
</div>
</div>
</div>
<div class="hero__site-intro">
<div class="hero__site-intro__wrap">
<h2>Democracy: it&rsquo;s for everyone</h2>
<p>You shouldn&rsquo;t have to be an expert to understand what goes on in the Northern Ireland Assembly.</p>
<p>TheyWorkForYou takes open data from the Northern Ireland Assembly, and presents it in a way that&rsquo;s easy to follow &ndash; for everyone.</p>
<a href="/about/" class="site-intro__more-link">Find out more about TheyWorkForYou <i>&rarr;</i></a>
</div>
</div>
</div>
</div>

<div class="full-page__row">
<div class="homepage-panels">
<div class="panel panel--inverted">
<div class="row nested-row">
<div class="home__search">
<form action="<?= $urls['search'] ?>" method="GET"onsubmit="trackFormSubmit(this, 'Search', 'Submit', 'Home'); return false;">
<input type="hidden" name="section" value="ni">
<label for="q">Search debates and written questions</label>
<div class="row collapse">
<div class="medium-9 columns">
<input name="q" id="q" class="homepage-search__input" type="text" placeholder="Enter a keyword, phrase, or person" />
</div>
<div class="medium-3 columns">
<input type="submit" value="Search" class="button homepage-search__button" />
</div>
</div>
</form>
</div>
<div class="home__search-suggestions">
<?php if (count($popular_searches)) { ?>
<h3>Popular searches today</h3>
<ul class="search-suggestions__list">
<?php foreach ($popular_searches as $i => $popular_search) { ?>
<li><?= $popular_search['display']; ?></li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
</div>

<?php
$homepage_panel_class = "panel--homepage--niassembly";
$homepage_subhead = "Northern Ireland Assembly";
$homepage_desc = "";
$search_section = "ni";
$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">
Expand Down
Loading

0 comments on commit 4b019d8

Please sign in to comment.