Skip to content
Snippets Groups Projects
Commit a676d712 authored by Ben Adida's avatar Ben Adida
Browse files

re-added helios django app as part of the same git project

parent 1a650466
No related branches found
No related tags found
No related merge requests found
Showing
with 2701 additions and 0 deletions
This diff is collapsed.
/* jTemplates 0.6.6 (http://jtemplates.tpython.com) Copyright (c) 2008 Tomasz Gloc (http://www.tpython.com)
Please do not remove or modify above line. Thanks. Dual licensed under the MIT and GPL licenses. */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9(2Q.8&&!2Q.8.2V){(7(){5 A=7(s,q,j){4.1t=[];4.1w={};4.2v=C;4.1A={};4.15={};4.j=8.1q({2r:17,2S:3F,2b:17,2O:17},j);4.2K(s,q);9(s){4.1h(4.15[\'1E\'],q)}4.15=C};A.f.1X=\'0.6.6\';A.f.2K=7(s,q){5 2x=/\\{#33 *(\\w*?)\\}/g;5 2u,1y,B;5 1k=C;2n((2u=2x.3J(s))!=C){1k=2x.1k;1y=2u[1];B=s.2i(\'{#/33 \'+1y+\'}\',1k);9(B==-1){13 c 16(\'Z: A "\'+1y+\'" 28 1F 3t.\');}4.15[1y]=s.23(1k,B)}9(1k===C){4.15[\'1E\']=s;a}H(5 i 1D 4.15){9(i!=\'1E\'){4.1A[i]=c A()}}H(5 i 1D 4.15){9(i!=\'1E\'){4.1A[i].1h(4.15[i],8.1q({},q||{},4.1A||{}));4.15[i]=C}}};A.f.1h=7(s,q){9(s==1r){4.1t.z(c 18(\'\',1));a}s=s.L(/[\\n\\r]/g,\'\');s=s.L(/\\{\\*.*?\\*\\}/g,\'\');4.2v=8.1q({},4.1A||{},q||{});5 h=4.1t;5 I=s.1f(/\\{#.*?\\}/g);5 O=0,B=0;5 e;5 19=0;5 1Q=0;H(5 i=0,l=(I)?(I.G):(0);i<l;++i){9(19){B=s.2i(\'{#/1m}\');9(B==-1){13 c 16("Z: 31 3P 2Z 1m.");}9(B>O){h.z(c 18(s.23(O,B),1))}O=B+11;19=0;i=8.3O(\'{#/1m}\',I);2X}B=s.2i(I[i],O);9(B>O){h.z(c 18(s.23(O,B),19))}5 3M=I[i].1f(/\\{#([\\w\\/]+).*?\\}/);5 2q=J.$1;2U(2q){y\'3I\':++1Q;h.1M();y\'9\':e=c 1i(I[i],h);h.z(e);h=e;N;y\'1b\':h.1M();N;y\'/9\':2n(1Q){h=h.1J();--1Q}y\'/H\':y\'/2h\':h=h.1J();N;y\'2h\':e=c 1l(I[i],h);h.z(e);h=e;N;y\'2g\':h.z(c 2e(I[i],4.2v));N;y\'b\':h.z(c 2d(I[i]));N;y\'2a\':h.z(c 29(I[i]));N;y\'3w\':h.z(c 18(\'{\'));N;y\'3v\':h.z(c 18(\'}\'));N;y\'1m\':19=1;N;y\'/1m\':13 c 16("Z: 31 2N 2Z 1m.");2M:13 c 16(\'Z: 3s 3r \'+2q+\'.\');}O=B+I[i].G}9(s.G>O){h.z(c 18(s.3p(O),19))}};A.f.F=7(d,b,x){5 $T=4.1s(d,{21:4.j.2S,2y:4.j.2r});5 $P=8.1q(4.1w,b);9(4.j.2b){$P=4.1s($P,{21:4.j.2b,2y:17})}5 $Q=x;$Q.1X=4.1X;5 X=\'\';H(5 i=0,l=4.1t.G;i<l;++i){X+=4.1t[i].F($T,$P,$Q)}a X};A.f.2p=7(1v,1B){4.1w[1v]=1B};A.f.2C=7(2W){a 2W.L(/&/g,\'&3c;\').L(/>/g,\'&36;\').L(/</g,\'&2A;\').L(/"/g,\'&37;\').L(/\'/g,\'&#39;\')};A.f.1s=7(d,1p){9(d==C){a d}2U(d.2z){y 1U:5 o={};H(5 i 1D d){o[i]=4.1s(d[i],1p)}a o;y 3V:5 o=[];H(5 i=0,l=d.G;i<l;++i){o[i]=4.1s(d[i],1p)}a o;y 35:a(1p.21)?(4.2C(d)):(d);y 3U:9(1p.2y){13 c 16("Z: 3T 3S 1F 3R.");}2M:a d}};5 18=7(2w,19){4.1R=2w;4.34=19};18.f.F=7(d,b,x){5 t=4.1R;9(!4.34){5 $T=d;5 $P=b;5 $Q=x;t=t.L(/\\{(.*?)\\}/g,7(3Q,32){5 12=14(32);9(1z 12==\'7\'){5 j=8.E(x,\'1d\').j;9(j.2r||!j.2O){a\'\'}1b{12=12($T,$P,$Q)}}a(12===1r)?(""):(35(12))})}a t};5 1i=7(R,1P){4.1O=1P;R.1f(/\\{#(?:1b)*9 (.*?)\\}/);4.30=J.$1;4.1c=[];4.1e=[];4.1n=4.1c};1i.f.z=7(e){4.1n.z(e)};1i.f.1J=7(){a 4.1O};1i.f.1M=7(){4.1n=4.1e};1i.f.F=7(d,b,x){5 $T=d;5 $P=b;5 $Q=x;5 2t=(14(4.30))?(4.1c):(4.1e);5 X=\'\';H(5 i=0,l=2t.G;i<l;++i){X+=2t[i].F(d,b,x)}a X};5 1l=7(R,1P){4.1O=1P;R.1f(/\\{#2h (.+?) 3N (\\w+?)( .+)*\\}/);4.2Y=J.$1;4.m=J.$2;4.V=J.$3||C;9(4.V!==C){5 o=4.V.3L(/[= ]/);9(o[0]===\'\'){o.3K()}4.V={};H(5 i=0,l=o.G;i<l;i+=2){4.V[o[i]]=o[i+1]}}1b{4.V={}}4.1c=[];4.1e=[];4.1n=4.1c};1l.f.z=7(e){4.1n.z(e)};1l.f.1J=7(){a 4.1O};1l.f.1M=7(){4.1n=4.1e};1l.f.F=7(d,b,x){5 $T=d;5 $P=b;5 $Q=x;5 K=14(4.2Y);5 1x=[];5 2o=1z K;9(2o==\'2T\'){5 2m=[];8.10(K,7(k,v){1x.z(k);2m.z(v)});K=2m}5 s=2l(14(4.V.2N)||0);5 1o=2l(14(4.V.1o)||1);5 e=K.G;5 X=\'\';5 i,l;9(4.V.K){5 12=s+2l(14(4.V.K));e=(12>e)?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2c[i]};8.M.1h=7(s,q,j){9(s.2z===A){8(4).10(7(){8.E(4,\'1d\',s);8.E(4,\'1u\',0)})}1b{8(4).10(7(){8.E(4,\'1d\',c A(s,q,j));8.E(4,\'1u\',0)})}};8.M.3u=7(1g,q,j){5 s=8.1Y({1a:1g,25:17}).2L;8(4).1h(s,q,j)};8.M.3q=7(24,q,j){5 s=$(\'#\'+24).2w();9(s==C){s=$(\'#\'+24).2J();s=s.L(/&2A;/g,"<").L(/&36;/g,">")}s=8.3o(s);s=s.L(/^<\\!\\[3n\\[([\\s\\S]*)\\]\\]>$/3m,\'$1\');8(4).1h(s,q,j)};8.M.3l=7(){5 K=0;8(4).10(7(){9(8.E(4,\'1d\')){++K}});a K};8.M.3k=7(){8(4).2P();8(4).10(7(){8.2I(4,\'1d\')})};8.M.2p=7(1v,1B){8(4).10(7(){5 t=8.E(4,\'1d\');9(t===1r){13 c 16(\'Z: A 28 1F 2H.\');}t.2p(1v,1B)})};8.M.22=7(d,b){8(4).10(7(){5 t=8.E(4,\'1d\');9(t===1r){13 c 16(\'Z: A 28 1F 2H.\');}8.E(4,\'1u\',8.E(4,\'1u\')+1);8(4).2J(t.F(d,b,4))})};8.M.3j=7(1g,b){5 W=4;5 s=8.1Y({1a:1g,25:17,3i:17,3h:\'3A\',3g:7(d){8(W).22(d,b)}})};5 1L=7(1a,b,1C,1G,U){4.2G=1a;4.1w=b;4.2F=1C;4.2E=1G;4.U=U;4.20=C;5 W=4;8(U).10(7(){8.E(4,\'2j\',W)});4.1Z()};1L.f.1Z=7(){4.2D();9(4.U.G==0){a}5 W=4;8.3f(4.2G,4.2E,7(d){8(W.U).22(d,W.1w)});4.20=3e(7(){W.1Z()},4.2F)};1L.f.2D=7(){4.U=8.2B(4.U,7(o){9(8.3d.3b){5 n=o.2s;2n(n&&n!=3a){n=n.2s}a n!=C}1b{a o.2s!=C}})};8.M.38=7(1a,b,1C,1G){5 u=c 1L(1a,b,1C,1G,4);a u.20};8.M.2P=7(){8(4).10(7(){5 1S=8.E(4,\'2j\');9(1S==C){a}5 W=4;1S.U=8.2B(1S.U,7(o){a o!=W});8.2I(4,\'2j\')})};8.1q({2V:7(s,q,j){a c A(s,q,j)},3W:7(1g,q,j){5 s=8.1Y({1a:1g,25:17}).2L;a c A(s,q,j)}})})(8)}',62,245,'||||this|var||function|jQuery|if|return|param|new|||prototype||node||settings|||_name||||includes|||||||element|case|push|Template|se|null|delete|data|get|length|for|op|RegExp|count|replace|fn|break|ss|||oper|||objs|_option|that|ret|iteration|jTemplates|each||tmp|throw|eval|_templates_code|Error|false|TextNode|literalMode|url|else|_onTrue|jTemplate|_onFalse|match|url_|setTemplate|opIF|ckey|lastIndex|opFOREACH|literal|_currentState|step|filter|extend|undefined|cloneData|_tree|jTemplateSID|name|_param|key|tname|typeof|_templates|value|interval|in|MAIN|not|args|total|first|getParent|cval|Updater|switchToElse|last|_parent|par|elseif_level|_value|updater|index|Object|_index|sid|version|ajax|run|timer|escapeData|processTemplate|substring|elementName|async|_length|_lastSessionID|is|Cycle|cycle|filter_params|_values|UserParam|Include|_template|include|foreach|indexOf|jTemplateUpdater|_total|Number|arr|while|mode|setParam|op_|disallow_functions|parentNode|tab|iter|_includes|val|reg|noFunc|constructor|lt|grep|escapeHTML|detectDeletedNodes|_args|_interval|_url|defined|removeData|html|splitTemplates|responseText|default|begin|runnable_functions|processTemplateStop|window|_root|filter_data|object|switch|createTemplate|txt|continue|_arg|of|_cond|No|__a1|template|_literalMode|String|gt|quot|processTemplateStart||document|msie|amp|browser|setTimeout|getJSON|success|dataType|cache|processTemplateURL|removeTemplate|hasTemplate|im|CDATA|trim|substr|setTemplateElement|tag|unknown|closed|setTemplateURL|rdelim|ldelim|elements|no|has|json|values|find|Cannot|root|true|ceil|Math|elseif|exec|shift|split|ppp|as|inArray|end|__a0|allowed|are|Functions|Function|Array|createTemplateURL'.split('|'),0,{}))
\ No newline at end of file
(function($){function toIntegersAtLease(n)
{return n<10?'0'+n:n;}
Date.prototype.toJSON=function(date)
{return date.getUTCFullYear()+'-'+
toIntegersAtLease(date.getUTCMonth()+1)+'-'+
toIntegersAtLease(date.getUTCDate());};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};
$.quoteString=function(string)
{if(escapeable.test(string))
{return'"'+string.replace(escapeable,function(a)
{var c=meta[a];if(typeof c==='string'){return c;}
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};
$.toJSON=function(o)
{var type=typeof(o);if(type=="undefined")
return"null";else if(type=="number"||type=="boolean")
return o+"";else if(o===null)
return"null";if(type=="string")
{return $.quoteString(o);}
if(type=="object"&&typeof o.toJSONObject=="function")
return $.toJSON(o.toJSONObject());if(type!="function"&&typeof(o.length)=="number")
{var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i]));}
return"["+ret.join(", ")+"]";}
if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.");}
ret=[];for(var k in o){var name;var type=typeof(k);if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;val=$.toJSON(o[k]);if(typeof(val)!="string"){continue;}
ret.push(name+": "+val);}
return"{"+ret.join(", ")+"}";}
$.evalJSON=function(src)
{return eval("("+src+")");}
$.secureEvalJSON=function(src)
{var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");}})(jQuery);
\ No newline at end of file
/*
* JavaScript Pretty Date
* Copyright (c) 2008 John Resig (jquery.com)
* Licensed under the MIT license.
*/
// Takes an ISO time and returns a string representing how
// long ago the date represents.
function prettyDate(time){
var date = new Date((time || "").replace(/-/g,"/").replace(/[TZ]/g," ")),
diff = (((new Date()).getTime() - date.getTime()) / 1000),
day_diff = Math.floor(diff / 86400);
if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 )
return;
return day_diff == 0 && (
diff < 60 && "just now" ||
diff < 120 && "1 minute ago" ||
diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" ||
diff < 7200 && "1 hour ago" ||
diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") ||
day_diff == 1 && "Yesterday" ||
day_diff < 7 && day_diff + " days ago" ||
day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago";
}
// If jQuery is included in the page, adds a jQuery plugin to handle it as well
if ( typeof jQuery != "undefined" )
jQuery.fn.prettyDate = function(){
return this.each(function(){
var date = prettyDate(this.title);
if ( date )
jQuery(this).text( date );
});
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
$(function() {
$(".datepicker").datepicker({ dateFormat: 'yy-mm-dd' });
});
This diff is collapsed.
This diff is collapsed.
helios/media/loading.gif

3.13 KiB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
"""
Helios Signals
Effectively callbacks that other apps can wait and be notified about
"""
import django.dispatch
# when an election is created
election_created = django.dispatch.Signal(providing_args=["election"])
# when a vote is cast
vote_cast = django.dispatch.Signal(providing_args=["user", "voter", "election", "cast_vote"])
# when an election is tallied
election_tallied = django.dispatch.Signal(providing_args=["election"])
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{% extends TEMPLATE_BASE %}
{% block js %}
<script language="javascript" src="{{ HELIOS_STATIC }}/jquery-jtemplates.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/class.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/jquery.json.min.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/bigint.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/random.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/elgamal.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/sha1.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/sha2.js"></script>
<script language="javascript" src="{{ HELIOS_STATIC }}/helios.js"></script>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment