Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into gh-pages

  • Loading branch information...
commit bf7a64f27c148498b214e2d6eca2ae3fa92d1e9b 2 parents 4ad5e36 + d3f159f
Dave Cross authored
6 bin/build
View
@@ -24,7 +24,11 @@ my $tt = Template->new({
foreach my $c ($sch->resultset('Constituency')->all) {
next unless $c->candidates->count;
- $tt->process('page.tt', { c => $c }, $c->list_name . '.html',
+ $tt->process('constituency.tt', { c => $c }, $c->list_name . '.html',
{binmode => ':utf8'})
or die $tt->error;
}
+
+$tt->process('constituencies.tt', { constits => [ $sch->resultset('Constituency')->all ] },
+ 'index.html', {binmode => ':utf8'})
+ or die $tt->error;
2  c/aberavon.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/aberconwy.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/aberdeen-north.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/aberdeen-south.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/airdrie-and-shotts.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/aldershot.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/aldridge-brownhills.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/battersea.html
View
@@ -69,6 +69,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/clacton.html
View
@@ -68,6 +68,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
113 c/index.html
View
@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <title>TwittElection: York Outer</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ <link rel="stylesheet" href="/css/bootstrap.min.css">
+ <style>
+body {
+ padding-top: 50px;
+ padding-bottom: 20px;
+}
+ </style>
+ <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
+ <link rel="stylesheet" href="/css/main.css">
+
+ <script src="/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
+ </head>
+ <body>
+ <!--[if lt IE 7]>
+ <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
+ <![endif]-->
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="#">TwittElection</a>
+ </div>
+ <div class="navbar-collapse collapse">
+ <!-- form class="navbar-form navbar-right" role="form">
+ <div class="form-group">
+ <input type="text" placeholder="Email" class="form-control">
+ </div>
+ <div class="form-group">
+ <input type="password" placeholder="Password" class="form-control">
+ </div>
+ <button type="submit" class="btn btn-success">Sign in</button>
+ </form -->
+ </div><!--/.navbar-collapse -->
+ </div>
+ </div>
+
+
+ <!-- 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: <a href="#A">A</a> | <a href="#B">B</a> | <a href="#C">C</a> | <a href="#M">M</a> | <a href="#T">T</a></p>
+<table class="table table-striped table-condensed table-bordered">
+<tr><th><a name="A">A</a></th></tr>
+<tr><td><a href="/constituency/Aberavon">Aberavon</a></td></tr>
+<tr><td><a href="/constituency/Aberconwy">Aberconwy</a></td></tr>
+<tr><td><a href="/constituency/Aberdeen North">Aberdeen North</a></td></tr>
+<tr><td><a href="/constituency/Aberdeen South">Aberdeen South</a></td></tr>
+<tr><td><a href="/constituency/Airdrie and Shotts">Airdrie and Shotts</a></td></tr>
+<tr><td><a href="/constituency/Aldershot">Aldershot</a></td></tr>
+<tr><td><a href="/constituency/Aldridge-Brownhills">Aldridge-Brownhills</a></td></tr>
+<tr><th><a name="B">B</a></th></tr>
+<tr><td><a href="/constituency/Battersea">Battersea</a></td></tr>
+<tr><th><a name="C">C</a></th></tr>
+<tr><td><a href="/constituency/Clacton">Clacton</a></td></tr>
+<tr><th><a name="M">M</a></th></tr>
+<tr><td><a href="/constituency/Mid Bedfordshire">Mid Bedfordshire</a></td></tr>
+<tr><th><a name="T">T</a></th></tr>
+<tr><td><a href="/constituency/Tooting">Tooting</a></td></tr>
+</table>
+ </div>
+ <div class="col-md-4">
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+ <div id="footer">
+ <div class="container">
+ <p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
+ </div>
+ </div>
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
+ <script>window.jQuery || document.write('<script src="/js/vendor/jquery-1.11.0.min.js"><\/script>')</script>
+
+ <script src="/js/vendor/bootstrap.min.js"></script>
+
+ <script src="/js/plugins.js"></script>
+ <script src="/js/main.js"></script>
+
+ <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-56332-52', 'twittelection.co.uk');
+ ga('send', 'pageview');
+
+ </script>
+ </body>
+</html>
2  c/mid-bedfordshire.html
View
@@ -69,6 +69,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
2  c/tooting.html
View
@@ -69,6 +69,8 @@
</div>
</div>
</div>
+
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
37 ttlib/constituencies.tt
View
@@ -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 -%]
21 ttlib/constituency.tt
View
@@ -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 -%]
21 ttlib/page.tt
View
@@ -51,25 +51,8 @@ body {
</div>
</div>
- <!-- 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>
+[% content %]
+
<div id="footer">
<div class="container">
<p class="muted">Made by <a href="https://twitter.com/davorg/">@davorg</a></p>
Please sign in to comment.
Something went wrong with that request. Please try again.