Skip to content

Commit

Permalink
Starting to add the scaffolding for elections 2016
Browse files Browse the repository at this point in the history
  • Loading branch information
okvivi committed Nov 6, 2016
1 parent f3b9c21 commit f1c99fe
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 13 deletions.
4 changes: 4 additions & 0 deletions www/hp-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@
case 21: include('pages/cdep_2012/cdep_2012_page.php'); break;
case 22: include('pages/senat_2012/senat_2012_page.php'); break;

// Elections 2016
case 24: include('pages/cdep_2016/cdep_2016_page.php'); break;
case 25: include('pages/senat_2016/senat_2016_page.php'); break;

case 'cauta_colegiu': include('pages/electoral_college/search.php'); break;
case 'comunitate': include('pages/misc/community.php'); break;
case 'sectii_votare': include('pages/misc/polling_stations.php'); break;
Expand Down
16 changes: 16 additions & 0 deletions www/pages/cdep_2016/cdep_2016_page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
// If you are accessing this page directly, redirect to the front page
if (!$DB_USER) {
header('Location: /');
}
$title = "Alegeri 2016 Camera Deputaților";

include('header.php');
include('hp-includes/news.php');

$page = 'cdep/2016';
$c = 'camera+deputatilor+2016';
include('pages/submenu.php');

?>

23 changes: 23 additions & 0 deletions www/pages/cdep_2016/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

$subpages = array(
array(
"link" => "Alegeri 2016",
"page" => "summary.php"
)
);

function getSidFor($fileName) {
global $subpages;

$count = 0;
foreach ($subpages as $page) {
if ($page['page'] == $fileName) {
return $count;
}
$count++;
}
return -1;
}

?>
11 changes: 11 additions & 0 deletions www/pages/cdep_2016/summary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
include_once('pages/functions_common.php');
include_once('pages/cdep_2008/functions.php');
include_once('hp-includes/electoral_colleges.php');

$t = new Smarty();

$t->assign("colleges", getElectoralCollegeHashByCounty('cdep'));

$t->display('cdep_2016_summary.tpl');
?>
23 changes: 23 additions & 0 deletions www/pages/senat_2016/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

$subpages = array(
array(
"link" => "Alegeri 2016",
"page" => "summary.php"
)
);

function getSidFor($fileName) {
global $subpages;

$count = 0;
foreach ($subpages as $page) {
if ($page['page'] == $fileName) {
return $count;
}
$count++;
}
return -1;
}

?>
18 changes: 18 additions & 0 deletions www/pages/senat_2016/senat_2016_page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
// If you are accessing this page directly, redirect to the front page
if (!$DB_USER) {
header('Location: /');
}
$title = "Alegeri 2016 Camera Deputaților";

include('header.php');

// And now here I should put some content, like something about the elections,
// some stats, some news, something like that.

$page = 'senat/2016';
$c = 'senat+2016';
include('pages/submenu.php');

?>

11 changes: 11 additions & 0 deletions www/pages/senat_2016/summary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
include_once('pages/functions_common.php');
include_once('pages/cdep_2008/functions.php');
include_once('hp-includes/electoral_colleges.php');

$t = new Smarty();

$t->assign("colleges", getElectoralCollegeHashByCounty('senat'));

$t->display('cdep_2016_summary.tpl');
?>
4 changes: 2 additions & 2 deletions www/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ a.new_link:hover {
}

.college_search {
margin: 10px 0 50px 0;
margin: 0px 0 30px 0;
text-align: center;
font-size: 18px;
line-height: 1.5em;
Expand Down Expand Up @@ -859,7 +859,7 @@ a.new_link:hover {

#cartoDb {
border: 5px solid #eee;
height: 200px;
height: 20px;
width: 960px;
}

Expand Down
29 changes: 29 additions & 0 deletions www/templates/cdep_2016_summary.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{* Smarty *}

{include file="electoral_college_search.tpl"}

<table width=970 cellspacing=15>
<tr>
<td width=970 valign="top">

Lista exhaustivă a colegiilor electorale:<br><br>
<table cellpadding=5 cellspacing=0>
{foreach from=$colleges item=college key=county name=counties}
{if $smarty.foreach.counties.index % 2 == 0}
<tr>
{/if}
<td width="100" valign="top">
<b>{$county|ucwords}</b>:
</td>
<td width="350" valign="top">
{section loop=$college name=c}
<a href="?cid=23&colegiul={$college[c]}+{$county|lower|replace:' ':'+'}">{$college[c]|ucwords}</a>&nbsp;&nbsp;
{/section}
</td>

{/foreach}
<table>

</td>
</tr>
</table>
16 changes: 8 additions & 8 deletions www/templates/common_top_menu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@
<tr class="menu_bottom_row">
<td>
<div class=submenu>
<a href="{$site_path}?cid=1&room=camera_deputatilor" class="{if $cid==1}black_link{/if}">
2004-2008</a> |
<a href="{$site_path}?cid=24&room=camera_deputatilor" class="new_link{if $cid==21}_sel{/if}">
Alegeri 2016</a> |
<a href="{$site_path}?cid=11&room=camera_deputatilor" class="{if $cid==11}black_link{/if}">
2008-2012</a> |
<a href="{$site_path}?cid=21&room=camera_deputatilor" class="new_link{if $cid==21}_sel{/if}">
Alegeri 2012</a>
<a href="{$site_path}?cid=1&room=camera_deputatilor" class="{if $cid==1}black_link{/if}">
2004-2008</a>
</div>
</td>

<td>
<div class=submenu>
<a href="{$site_path}?cid=3&room=senat" class="{if $cid==3}black_link{/if}">
2004-2008</a> |
<a href="{$site_path}?cid=25&room=senat" class="new_link{if $cid==22}_sel{/if}">
Alegeri 2016</a> |
<a href="{$site_path}?cid=12&room=senat" class="{if $cid==12}black_link{/if}">
2008-2012</a> |
<a href="{$site_path}?cid=22&room=senat" class="new_link{if $cid==22}_sel{/if}">
Alegeri 2012</a>
<a href="{$site_path}?cid=3&room=senat" class="{if $cid==3}black_link{/if}">
2004-2008</a>
</div>
</td>

Expand Down
6 changes: 3 additions & 3 deletions www/templates/electoral_college_search.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<td width=970 valign="top">

<div class="college_search">
<img src="/images/cautare_colegiu.png">
<img src="/images/cautare_colegiu.png" style="float:right; padding-top: 30px">
<br>
Caută colegiul din care faci parte după stradă, comună sau oraș.

Expand All @@ -26,10 +26,10 @@

<table width=960>
<td valign="top">
<b>Data alegerilor: 9 Decembrie</b>.<br>
<b>Data alegerilor: 11 Decembrie 2016</b>.<br>

Site-ul BEC pentru aceste alegeri este aici:
<a href="http://www.becparlamentare2012.ro/">www.becparlamentare2012.ro</a>
<a href="http://parlamentare2016.bec.ro/">parlamentare2016.bec.ro</a>
</td>
<td valign="top">
{literal}
Expand Down

0 comments on commit f1c99fe

Please sign in to comment.