Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
405 additions
and
65 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
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,74 @@ | ||
module Dcz class Www | ||
|
||
get("/info/?") do |x| | ||
render(:info) | ||
end | ||
|
||
get("/results/?") do |x| | ||
r = "" | ||
vote_p2012.results_info.each do |rs| | ||
maxPc = rs[:results].map{|x| x.score}.max | ||
r += <<-EOD | ||
<div class="scrutin" id="#{rs[:electionId]}"> | ||
<div class="name"><img src="img/info32.png" class="infoscrutin"/>#{rs[:electionType]}</div> | ||
<div class="winner"><img src="#{rs[:results].first[:piclink_anim]}" /></div> | ||
<div class="resultats"> | ||
EOD | ||
rs[:results].each do |cd| | ||
r += <<-EOD | ||
<div class="head"><img src="#{cd[:piclink_anim]}" /></div> | ||
<div class="bar"> | ||
<div class="load" style="width: #{(cd[:score]*100/maxPc).round}%;"></div> | ||
<div class="name">#{cd[:name]}</div> | ||
<div class="pc">#{cd[:score]}#{cd[:unit]}</div> | ||
</div><br/> | ||
EOD | ||
end | ||
r += '</div></div>' | ||
end | ||
r += '<div class="clear"></div>' | ||
render(:results,{results: r}) | ||
end | ||
|
||
get("/first_turn/?") do |x| | ||
r = "" | ||
k = 0 | ||
cd_info.each do |cd| | ||
r += <<-EOD | ||
<div class="candidat" id="#{cd[:voxe_id]}"> | ||
<div class="pic" style="background: url(#{cd[:piclink72]});"></div> | ||
<div>#{cd[:name]}</div> | ||
<div class="infocandidatdiv"> | ||
<a target="#{cd[:voxe_id]}" href="#{cd[:urlinfo]}"> | ||
<img src="img/info32.png" class="infocandidat"/> | ||
</a> | ||
</div> | ||
</div> | ||
EOD | ||
end | ||
if k == 2 | ||
r += '<div class="clear"></div>' | ||
k = 0 | ||
else | ||
k += 1 | ||
end | ||
r += '<div class="clear"></div>' | ||
render(:first_turn,{candidates: r}) | ||
end | ||
|
||
get("/order_candidates/?") do |x| | ||
r = "" | ||
cd_info.each do |cd| | ||
r += <<-EOD | ||
<li id="#{cd[:voxe_id]}" class="ui-state-default"> | ||
<img align="left" src="#{cd[:piclink72]}" /> | ||
<span class="ui-icon ui-icon-arrowthick-2-n-s"></span> | ||
<div>#{cd[:name]}</div> | ||
</li> | ||
EOD | ||
end | ||
vote_p2012.candidates.each.map_m(:info) do |cd| | ||
render(:order_candidates,{candidates: r}) | ||
end | ||
|
||
end 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,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta property="og:title" content="Democrazy"/> | ||
<meta property="og:type" content="article"/> | ||
<meta property="og:image" content="http://democrazy.fr/img/logo1024.png"/> | ||
<meta property="og:url" content="http://democrazy.fr"/> | ||
<meta property="og:site_name" content="democrazy"> | ||
|
||
<link rel="icon" type="image/png" href="favicon.png"> | ||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> | ||
|
||
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | ||
<title>democrazy</title> | ||
|
||
<!-- add font from google --> | ||
<link href='http://fonts.googleapis.com/css?family=Cutive&subset=latin,latin-ext' rel='stylesheet' type='text/css'> | ||
|
||
<link rel="stylesheet" href="./css/style.css"> | ||
<script data-main="js/boot.js" src="js/require.js"></script> | ||
</head> | ||
<body> | ||
<div id="page1" class="page" align="center" style="margin: auto; position:relative"> | ||
<div class="startBlock">premier_tour</div> | ||
<div class="actions"> | ||
<a href="/" title="se déconnecter" alt="se déconnecter" class="logout"></a> | ||
<span class="customtitle">Scrutin à un tour</a> | ||
</div> | ||
<div class="title customtitle"> | ||
Pour quel candidat voteriez vous au premier tour ? | ||
</div> | ||
<div class="candidats" align="center"> | ||
{{{candidates}}} | ||
</div> | ||
|
||
<div class="send"> | ||
<input type="submit" value="Envoyer" class="ui-button ui-widget ui-state-default ui-corner-all" /> | ||
</div> | ||
<div class="footer" ></div> | ||
</div> | ||
</body> | ||
</html> |
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,68 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta property="og:title" content="Democrazy"/> | ||
<meta property="og:type" content="article"/> | ||
<meta property="og:image" content="http://democrazy.fr/img/logo1024.png"/> | ||
<meta property="og:url" content="http://democrazy.fr"/> | ||
<meta property="og:site_name" content="democrazy"> | ||
|
||
<link rel="icon" type="image/png" href="favicon.png"> | ||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> | ||
|
||
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | ||
<title>democrazy</title> | ||
|
||
<!-- add font from google --> | ||
<link href='http://fonts.googleapis.com/css?family=Cutive&subset=latin,latin-ext' rel='stylesheet' type='text/css'> | ||
|
||
<link rel="stylesheet" href="./css/style.css"> | ||
<script data-main="js/boot.js" src="js/require.js"></script> | ||
</head> | ||
<body> | ||
<div id="page0" class="page" align="center" style="margin: auto;"> | ||
<div class="startBlock">login</div> | ||
<img class="bgimage" src="img/carteelecbg.jpg"/> | ||
<div class="UserIdf"> | ||
|
||
<div class="acroche">Vous élisez,<br>les règles du jeu décident.</div> | ||
|
||
|
||
<div>Pour voter, entrer votre mail<br><input class="rounded" type="text" name="mail" placeholder="Votre mail" /></div> | ||
<div class="send" style="padding-bottom:10px;"> | ||
<input type="submit" value="Envoyer" class="ui-button ui-widget ui-state-default ui-corner-all" /> | ||
</div> | ||
<div align="center" class="ptttxt"> | ||
<br> | ||
<font class="titre">Democrazy est une expérimentation de différents modes de scrutins</font><br> | ||
• Scrutin à un tour •<br> | ||
• Scrutin majoritaire à deux tours (système actuel) •<br> | ||
• Scrutin par élimination •<br> | ||
• Scrutin plurinominal majoritaire (dit de Borda) •<br> | ||
• Méthode de Condorcet •<br> | ||
|
||
</div> | ||
|
||
<p style="margin:0; line-height:20pt;"> | ||
<a style="font-size:11pt; line-height:20pt; background-color:transparent;" href="info" target="info">en savoir plus...</a> | ||
<br> | ||
<a style="line-height:20pt; font-size:11pt; background-color:transparent;" href="results" target="_self" >les résultats...</a> | ||
</p> | ||
<div class="logo"> | ||
<a href="first_turn"><img class="letter" src="img/letter.jpg" style="width: 70px; display: inline;" /></a> | ||
<img class="urne" src="img/urne.png" style="width: 280px;" /> | ||
</div> | ||
<div class="share"> | ||
<div class="fb-like facebook" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false" data-href="https://www.facebook.com/Democrazy2012"></div><div id="fb-root" class="facebook"></div> | ||
<div class="g-plusone" data-size="small"></div> | ||
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Je viens de voter sur" data-lang="fr" data-hashtags="voxe2012" data-url="http://democrazy.fr" data-via="democrazy2012" class="twitter">Tweeter</a> | ||
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: 'fr'}</script> | ||
<script>(function(d,s,id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script> | ||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.