Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored templates. Added index for constituencies.
- Loading branch information
Showing
3 changed files
with
60 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[% WRAPPER page.tt -%] | ||
[% prev_letter = ''; | ||
letters = []; | ||
FOREACH c IN constits; | ||
NEXT UNLESS c.candidates.size; | ||
letter = c.name.substr(0, 1); | ||
IF letter != prev_letter; | ||
letters.push('<a href="#' _ letter _ '">' _ letter _ '</a>'); | ||
prev_letter = letter; | ||
END; | ||
END %] | ||
<!-- Main jumbotron for a primary marketing message or call to action --> | ||
<div class="jumbotron"> | ||
<div class="container"> | ||
<h1>Constituencies</h1> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
<p>Jump to: [% letters.join(' | ') %]</p> | ||
<table class="table table-striped table-condensed table-bordered"> | ||
[% prev_letter = ''; | ||
FOREACH c IN constits; | ||
NEXT UNLESS c.candidates.size; | ||
letter = c.name.substr(0, 1); | ||
IF letter != prev_letter -%] | ||
<tr><th><a name="[% letter %]">[% letter %]</a></th></tr> | ||
[% END -%] | ||
<tr><td><a href="/constituency/[% c.name %]">[% c.name %]</a></td></tr> | ||
[% prev_letter = letter; | ||
END -%] | ||
</table> | ||
</div> | ||
<div class="col-md-4"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
[% END -%] |
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,21 @@ | ||
[% WRAPPER page.tt -%] | ||
<!-- Main jumbotron for a primary marketing message or call to action --> | ||
<div class="jumbotron"> | ||
<div class="container"> | ||
<h1>[% c.name %]</h1> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
<a class="twitter-timeline" href="https://twitter.com/TwittElection/lists/[% c.list_name %]" data-widget-id="464129893937082368" data-list-owner-screen-name="TwittElection" data-list-slug="[% c.list_name %]">Tweets from https://twitter.com/TwittElection/lists/[% c.list_name %]</a> | ||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> | ||
</div> | ||
<div class="col-md-4"> | ||
<ul> | ||
[% FOREACH cand IN c.candidates -%] | ||
<li>[% cand.name %] ([% cand.party.name %])[% IF cand.twitter %]<br><a href="https://twitter.com/[% cand.twitter %]">@[% cand.twitter %]</a>[% END %]</li> | ||
[% END -%] | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
[% END -%] |
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