Initial commit of DEMOS2 with the upgraded 'Create Event' UI. However, there is no input validation currently

This commit is contained in:
vince0656 2018-06-12 13:31:38 +01:00
commit 7084bd1b16
155 changed files with 8102 additions and 0 deletions

View file

@ -0,0 +1,3 @@
This are the files from the django-allauth example
pretty much as-is, except for some visual tweaks
and use of a different bootstrap form renderer.

View file

@ -0,0 +1,45 @@
{% extends "bases/bootstrap-member.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block content %}
<div class=container>
{% bootstrap_messages %}
<h1>{% trans 'My Account' %}</h1>
<ul class="nav nav-tabs">
<li class="{% block account_nav_events %}{% endblock %}">
<a href="{% url 'account_events' %}">{% trans 'My Events' %}</a>
</li>
<li class="{% block account_nav_email %}{% endblock %}">
<a href="{% url 'account_email' %}">{% trans 'E-mail Addresses' %}</a>
</li>
<li class="{% block account_nav_change_password %}{% endblock %}">
<a href="{% url 'account_change_password' %}">{% trans 'Change Password' %}</a>
</li>
{% url 'socialaccount_connections' as connections_url %}
{% if connections_url %}
<li class="{% block account_nav_socialaccount_connections %}{% endblock %}">
<a href="{{ connections_url}}">{% trans 'Connected Accounts' %}</a>
</li>
{% else %}
<li>No connections url</li>
{% endif %}
</ul>
{% block account_content %}
{% endblock %}
</div>
{% endblock %}
{#
{% block appjs %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
{% block appjs_jquery %}
{% endblock %}
{% endblock %}
#}

View file

@ -0,0 +1,38 @@
{% extends "bases/bootstrap-member.html" %}
{% load i18n %}
{% block content %}
<div class=container>
<h1>{% trans 'My Account' %}</h1>
<ul class="nav nav-tabs">
<li class="{% block account_tab_events %}{% endblock %}">
<a href="#">{% trans 'My Events' %}</a>
</li>
<li class="{% block account_nav_change_password %}{% endblock %}">
<a href="{% url 'account_change_password' %}">{% trans 'Change Password' %}</a>
</li>
{% url 'socialaccount_connections' as connections_url %}
{% if connections_url %}
<li class="{% block account_nav_socialaccount_connections %}{% endblock %}">
<a href="{{ connections_url}}">{% trans 'Connected Accounts' %}</a>
</li>
{% else %}
<li>No connections url</li>
{% endif %}
</ul>
{% block account_content %}
{% endblock %}
</div>
{% endblock %}
{#
{% block appjs %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
{% block appjs_jquery %}
{% endblock %}
{% endblock %}
#}

View file

@ -0,0 +1,90 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "Account" %}{% endblock %}
{% block account_nav_email %}active{% endblock %}
{% block account_content %}
{% if user.emailaddress_set.all %}
<p>{% trans 'The following e-mail addresses are associated to your account:' %}</p>
<form action="{% url 'account_email' %}" class="email_list uniForm" method="post">
{% csrf_token %}
<table class="table">
<thead>
<tr>
<th>
{% trans 'E-mail' %}
</th>
<th>
{% trans 'Status' %}
</th>
</tr>
</thead>
<tbody>
{% for emailaddress in user.emailaddress_set.all %}
<tr>
<td>
<label class="radio" for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
<input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
{{ emailaddress.email }}
</label>
</td>
<td>
{% if emailaddress.verified %}
<span class="label label-info">{% trans "Verified" %}</span>
{% else %}
<span class="label label-warning">{% trans "Unverified" %}</span>
{% endif %}
{% if emailaddress.primary %}<span class="label label-success">{% trans "Primary" %}</span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="form-actions">
<button class="btn btn-success" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
<button class="btn" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
<button class="btn btn-danger" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
</div>
</fieldset>
</form>
{% else %}
<p><strong>{% trans 'Warning:'%}</strong> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}</p>
{% endif %}
<h2>{% trans "Add E-mail Address" %}</h2>
<form method="post" action="">
{% csrf_token %}
{% bootstrap_form add_email_form %}
<div class="form-actions">
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button>
</div>
</form>
{% endblock %}
{% block appjs_jquery %}
<script type="text/javascript">
$(function(){
$("button[name='action_remove']").click(function(){
if (confirm("{% trans 'Do you really want to remove the selected e-mail address?' %}")) {
return true;
}
return false;
});
});
</script>
{% endblock %}

View file

@ -0,0 +1,31 @@
{% extends "bases/bootstrap-auth.html" %}
{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %}
{% block inner-content %}
<h1>{% trans "Confirm E-mail Address" %}</h1>
{% if confirmation %}
{% user_display confirmation.email_address.user as user_display %}
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{email}}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p>
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}">
{% csrf_token %}
<button class="btn btn-primary" type="submit">{% trans 'Confirm' %}</button>
</form>
{% else %}
{% url 'account_email' as email_url %}
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url}}">issue a new e-mail confirmation request</a>.{% endblocktrans %}</p>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,41 @@
{% extends "bases/bootstrap-auth.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load account socialaccount %}
{% block head_title %}{% trans "Sign In" %}{% endblock %}
{% block inner-content %}
{% get_providers as socialaccount_providers %}
<h1 class="text-center">Log In</h1>
<hr>
<div class="row">
{% if socialaccount_providers %}
<div class="col-md-5 col-lg-5">
{% include "allauth/account/provider_panel.html" with process="login" %}
</div>
{% endif %}
<div class="{% if socialaccount_providers %}col-md-7 col-lg-7 {% else %} col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 {% endif %}">
<form class="login" method="POST" action="{% url 'account_login' %}">
<span class="pull-right">Not yet a member? <a href="{% url 'account_signup' %}">Join</a></span>
{% csrf_token %}
{% bootstrap_form form %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<div class="form-actions">
<button class="btn btn-primary pull-right" type="submit">{% trans "Sign In" %}</button>
<a class="btn" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
</div>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends "bases/bootstrap-auth.html" %}
{% load i18n %}
{% block head_title %}{% trans "Sign Out" %}{% endblock %}
{% block inner-content %}
<h1>{% trans "Sign Out" %}</h1>
<p>{% trans 'Are you sure you want to sign out?' %}</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{redirect_field_name}}" value="{{redirect_field_value}}"/>
{% endif %}
<button class="btn btn-primary" type="submit">{% trans 'Sign Out' %}</button>
</form>
{% endblock %}

View file

@ -0,0 +1,90 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "Account" %}{% endblock %}
{% block account_tab_events %}active{% endblock %}
{% block account_content %}
{% if user.emailaddress_set.all %}
<p>{% trans 'The following e-mail addresses are associated to your account:' %}</p>
<form action="{% url 'account_email' %}" class="email_list uniForm" method="post">
{% csrf_token %}
<table class="table">
<thead>
<tr>
<th>
{% trans 'E-mail' %}
</th>
<th>
{% trans 'Status' %}
</th>
</tr>
</thead>
<tbody>
{% for emailaddress in user.emailaddress_set.all %}
<tr>
<td>
<label class="radio" for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
<input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
{{ emailaddress.email }}
</label>
</td>
<td>
{% if emailaddress.verified %}
<span class="label label-info">{% trans "Verified" %}</span>
{% else %}
<span class="label label-warning">{% trans "Unverified" %}</span>
{% endif %}
{% if emailaddress.primary %}<span class="label label-success">{% trans "Primary" %}</span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="form-actions">
<button class="btn btn-success" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
<button class="btn" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
<button class="btn btn-danger" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
</div>
</fieldset>
</form>
{% else %}
<p><strong>{% trans 'Warning:'%}</strong> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}</p>
{% endif %}
<h2>{% trans "Add E-mail Address" %}</h2>
<form method="post" action="">
{% csrf_token %}
{% bootstrap_form add_email_form %}
<div class="form-actions">
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button>
</div>
</form>
{% endblock %}
{% block appjs_jquery %}
<script type="text/javascript">
$(function(){
$("button[name='action_remove']").click(function(){
if (confirm("{% trans 'Do you really want to remove the selected e-mail address?' %}")) {
return true;
}
return false;
});
});
</script>
{% endblock %}

View file

@ -0,0 +1,17 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block account_nav_change_password %}active{% endblock %}
{% block account_content %}
<form method="POST" action="" class="password_change">
{% csrf_token %}
{% bootstrap_form password_change_form %}
<div class="form-actions">
<button class="btn btn-primary" type="submit" name="action">{% trans "Change Password" %}</button>
</div>
</form>
{% endblock %}

View file

@ -0,0 +1,33 @@
{% extends "bases/bootstrap-auth.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load account socialaccount %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block inner-content %}
<h1>{% trans "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>
<form method="POST" action="" >
{% csrf_token %}
{% bootstrap_form password_reset_form %}
<div class="form-actions">
<input class="btn btn-primary" type="submit" value="{% trans "Reset My Password" %}" />
</div>
</form>
<p>{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}</p>
{% endblock %}
{% block appjs_jquery %}
<script>
$("#id_email").focus();
</script>
{% endblock %}

View file

@ -0,0 +1,29 @@
{% extends "bases/bootstrap-auth.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block inner-content %}
<h1>{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>
{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
{% else %}
{% if form %}
<form method="POST" action="" class="uniForm">
{% csrf_token %}
{% bootstrap_form form %}
<div class="form-actions">
<button class="btn btn-primary" type="submit">{% trans "Change Password" %}</button>
</div>
</form>
{% else %}
<p>{% trans 'Your password is now changed.' %}</p>
{% endif %}
{% endif %}
{% endblock %}

View file

@ -0,0 +1,17 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "Set Password" %}{% endblock %}
{% block account_nav_change_password %}active{% endblock %}
{% block account_content %}
<form method="POST" action="" class="password_set">
{% csrf_token %}
{% bootstrap_form password_set_form %}
<div class="form-actions">
<input class="btn btn-primary" type="submit" name="action" value="{% trans "Set Password" %}"/>
</div>
</form>
{% endblock %}

View file

@ -0,0 +1,22 @@
{% load i18n %}
{% load bootstrap3 %}
{% load account socialaccount %}
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
<!--
This is the raw "real" HTML that facebook recommends.
Leaving here for reference.
<div class="fb-login-button" data-max-rows="1" data-size="large" data-show-faces="false" data-auto-logout-link="false"></div>
-->
<div class="socialaccount_ballot">
<ul class="socialaccount_providers list-unstyled">
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</ul>
</div>
{% include "socialaccount/snippets/login_extra.html" %}
{% endif %}

View file

@ -0,0 +1,38 @@
{% extends "bases/bootstrap-auth.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load account socialaccount %}
{% block head_title %}{% trans "Signup" %}BS{% endblock %}
{% block inner-content %}
{% get_providers as socialaccount_providers %}
<h1>{% trans "Sign Up" %}</h1>
<div class="row">
{% if socialaccount_providers %}
<div class="col-md-5 col-lg-5">
{% include "allauth/account/provider_panel.html" with process="login" %}
</div>
{% endif %}
<div class="{% if socialaccount_providers %}col-md-7 col-lg-7 {% else %} col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 {% endif %}">
<p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>
<form id="signup_form" method="post" action="{% url 'account_signup' %}">
{% csrf_token %}
{% bootstrap_form form %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<div class="form-actions">
<button class="btn btn-primary" type="submit">{% trans "Sign Up" %}</button>
</div>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,81 @@
{% extends "socialaccount/base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Connected Accounts" %}{% endblock %}
{% block account_nav_socialaccount_connections %}active{% endblock %}
{% block account_content %}
{% if form.accounts %}
<p>{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}</p>
<form method="post">
{% csrf_token %}
{% if form.non_field_errors %}
<div class="alert alert-error">
<a class="close" data-dismiss="alert">&times;</a>
{% for non_field_error in form.non_field_errors %}
{{ non_field_error }}
{% endfor %}
</div>
{% endif %}
<table class="table">
<thead>
<tr>
<th>
{% trans 'Provider' %}
</th>
<th>
{% trans 'Account' %}
</th>
</tr>
</thead>
<tbody>
{% for base_account in form.accounts %}
{% with base_account.get_provider_account as account %}
<tr>
<td>
<label class="radio" for="id_account_{{base_account.id}}">
<input id="id_account_{{base_account.id}}" type="radio" name="account" value="{{base_account.id}}"/>
<span class="socialaccount_provider {{base_account.provider}} {{account.get_brand.id}}">{{account.get_brand.name}}</span>
</label>
</td>
<td>
{{account}}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
<div class="form-actions">
<button class="btn btn-danger" type="submit">{% trans 'Remove' %}</button>
</div>
</fieldset>
</form>
{% else %}
<div class="alert">
<strong>{% trans 'None!' %}</strong> {% trans 'You currently have no social network accounts connected to this account.' %}
</div>
{% endif %}
<h2>{% trans 'Add a 3rd Party Account' %}</h2>
<ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
</ul>
{% include "socialaccount/snippets/login_extra.html" %}
{% endblock %}

View file

@ -0,0 +1,29 @@
{% extends "bases/bootstrap-auth.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "Signup" %}{% endblock %}
{% block inner-content %}
<h1>{% trans "Sign Up" %}</h1>
<p>{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to
{{site_name}}. As a final step, please complete the following form:{% endblocktrans %}</p>
<form class="signup" id="signup_form" method="post" action="">
{% csrf_token %}
{% bootstrap_form form %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<div class="form-actions">
<button class="btn btn-primary" type="submit">{% trans "Sign Up" %}</button>
</div>
</form>
{% endblock %}

View file

@ -0,0 +1,44 @@
{% extends "bases/bootstrap-member.html" %}
{% load bootstrap3 %}
{% block content %}
<div class="container">
<h1>Profile</h1>
{# Hmm. Not thrilled about this. #}
{# Could use django-bootstrap3 which removes some of this ugliness. #}
{# Or some AJAX-based way to retrieve messages. #}
{# I don't like the use of cookies for this. #}
{% bootstrap_messages %}
<div class="row">
<div class="col-md-6 col-lg-6">
<form action="{% url 'account_profile' %}" method="post" class="form">
{% csrf_token %}
{% bootstrap_form form %}
{% buttons %}
<button type="submit" class="btn btn-primary">
{% bootstrap_icon "star" %} Submit
</button>
{% endbuttons %}
<!--
<div class="form-group">
<div class="col-sm-12">
<button type="submit" class="btn btn-primary pull-right"> Submit </button>
</div>
</div>
-->
</form>
</div>
<div class="col-md-6 col-lg-6">
TODO: DOB, picture
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,12 @@
{% extends "bases/bootstrap-minimal.html" %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2 big-box">
{% block inner-content %}
{% endblock %}
</div>
</div>
</div><!-- container -->
{% endblock %}

View file

@ -0,0 +1,267 @@
{% extends "bases/bootstrap.html" %}
{% load staticfiles %}
{% block tail_js %}
<script>
Module = {};
Module.memoryInitializerPrefixURL = "{% static 'js/' %}";
</script>
<script src="//code.jquery.com/jquery-2.2.4.min.js"></script>
<!-- <script>window.jQuery || document.write('<script src="js/jquery-1.10.1.min.js"><\/script>')</script> -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script src="{% static 'js/papaparse.min.js' %}" type="text/javascript"></script>
<script src="{% static 'js/create-event-poll.js' %}" type="text/javascript"></script>
<script src="{% static 'js/encrypt.js' %}" type="text/javascript"></script>
<script type="text/javascript" src="{% static 'js/core/rand.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/rom_curve.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/rom_field.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/uint64.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/aes.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/big.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/gcm.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/hash256.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/hash384.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/hash512.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/sha3.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/newhope.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/nhs.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/fp.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/fp2.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/fp4.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/fp12.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/ff.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/rsa.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/ecp.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/ecp2.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/ecdh.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/pair.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/mpin.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/ctx.js' %}"></script>
<script type="text/javascript" src="{% static 'js/demos2-booth.js' %}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.js" type="text/javascript"></script>
{% block app_js %}
<script type="text/javascript">
{% block app_js_vars %}
{% endblock %}
Module.memoryInitializerPrefixURL = "LOL";
var demosEncrypt = {
}
/*
Code written with "New function" comments have
been totally or mostly re-implemented by Thomas Smith
*/
//new function
demosEncrypt.encryptAndSubmit = function() {
var ctx = new CTX("BN254CX"); //new context we can use
var n = new ctx.BIG();
var g1 = new ctx.ECP();
var g2 = new ctx.ECP2();
var param = $('#event-param').val();
//console.log(param);
var tempParams = JSON.parse(param);
//copying the values
n.copy(tempParams.n);
g1.copy(tempParams.g1);
g2.copy(tempParams.g2);
var params = {
n:n,
g1:g1,
g2:g2
}
var tempPK = JSON.parse($('#comb_pk').val());
var pk = new ctx.ECP(0);
pk.copy(tempPK.PK);
var answer = $('#poll-options').val();
console.log(answer);
var cipher = encrypt(params, pk, answer);
var c1Bytes = [];
cipher.C1.toBytes(c1Bytes);
var c2Bytes = [];
cipher.C2.toBytes(c2Bytes);
$('#id_cipher_text_c1').val(c1Bytes.toString());
$('#id_cipher_text_c2').val(c2Bytes.toString());
$('#cipher-form').submit();
}
//new function
demosEncrypt.decryptCipher = function() {
var skString = $('#secret-key').val();
if (!skString) {
alert("Please enter your secret key");
}
else {
//rebuild our secret key
var ctx = new CTX("BN254CX");
var skBytes = skString.split(",");
var sk =new ctx.BIG.fromBytes(skBytes);
var inputs = $("form input[type=text]");
inputs.each(function() { //for each ciphertext to decrypt
var ciphertext = {
C1: new ctx.ECP(),
C2: new ctx.ECP()
}
var temp = JSON.parse($(this).val());
ciphertext.C1.copy(temp.C1);
ciphertext.C2.copy(temp.C2);
var partial = partDec(sk, ciphertext);//returns an object containing an ECP()
var bytes = [];
partial.D.toBytes(bytes);
$(this).val(bytes.toString());//submit in byte array form
})
$('input[type=submit]').prop("disabled", false);
}
}
//new function
demosEncrypt.generateKeys = function() {
parameter = $("#event-param").val();
var tempParams = JSON.parse(parameter);
//the full objects need to be initalised as per the library, then copy the values we need into it
//I follow Bingsheng's code as to what objects are used in the parameter object
var ctx = new CTX("BN254CX"); //new context we can use
var n = new ctx.BIG();
var g1 = new ctx.ECP();
var g2 = new ctx.ECP2();
//copying the values
n.copy(tempParams.n);
g1.copy(tempParams.g1);
g2.copy(tempParams.g2);
var params = {
n:n,
g1:g1,
g2:g2
}
var PKbytes = [];
var SKbytes = [];
var keypair = keyGen(params);
keypair.PK.toBytes(PKbytes);
keypair.SK.toBytes(SKbytes);
$('input#public-key').val(PKbytes.toString());
$('input#secret-key').val(SKbytes.toString());
//mostly code from before here
var blob = new Blob([SKbytes.toString()], {type : 'text/plain'});
var dlBtn = $('a#download-btn');
var url = URL.createObjectURL(blob);
var fileName = $(dlBtn).attr("href", url);
$(dlBtn).attr("download", "sk-{% block sk-file-name %}{% endblock %}".replace(/[\W]/g, "-"));
$(dlBtn).attr("disabled", false);
$("#public-submit").attr("disabled", false);
}
//these other functions might not be used
//I don't think this is used
demosEncrypt.downloadSecretKey = function() {
var blob = new Blob([sk], {type : 'text/plain'});
var dlBtn = $('a#download-btn');
$(dlBtn).attr("disabled", true);
}
function getFormsetPrefix(id) {
id = id.replace(/(?:id_)?formset_/, ""); // strip generic part
return id.replace(/([A-Za-z0-9]+)[\w-]*/, "$1"); // return prefix
}
function setFormsetIndex(ele, prefix, index) {
ele = $(ele).find("div[id^='id_formset'], input[id^='id_formset']").each(function (i, el) {
var id = $(el).attr("id");
id = "id_formset_" + prefix + '-' + index + id.match(/-\w+$/);
$(el).attr("id", id);
if ($(el).is("input")) {
$(el).attr("name", id.replace(/^id_/, ""));
}
});
}
$('.formset').sortable({handle:".input-group-addon", items:".formset_object",
start: function(event, ui) {
ui.item.prevPos = ui.item.index();
console.log(ui.item.prevPos);
},
update: function(event, ui) {
ui.item.prevPos = null;
},
beforeStop: function(event, ui) {
$(ui.item).css("animation", "none"); // prevents firing of entry keyframe
}
});
//$('.glyphicon.glyphicon-trash').parent().hide();
$('.formset').find
$('.formset').on('click', '.input-group-addon', function() { // this makes the label a delete btn too :(
var ele = $(this).closest(".formset_object");
var prefix = $(this).closest(".formset_object").data("prefix") || getFormsetPrefix($(this).closest(".formset_object").find('input:first').attr("id"));
var current_total = parseInt($("#id_formset_" + prefix + "-TOTAL_FORMS").val());
if (current_total <= $("#id_formset_" + prefix + "-MIN_NUM_FORMS").val()) {
return; // don't allow removal of last element
}
ele.remove();
$("#id_formset_" + prefix + "-TOTAL_FORMS").val(current_total - 1);
$(".formset").sortable( "refresh" );
$(".formset").sortable( "refreshPositions" );
});
$('.add-another-btn').on('click',function() {
var new_formset_item = $(this).prevAll(".formset_object:first").clone();
var prefix = getFormsetPrefix(new_formset_item.find("input:first").attr("id"));
var current_total = parseInt($("#id_formset_" + prefix + "-TOTAL_FORMS").val());
if (current_total >= $("#id_formset_" + prefix + "-MAX_NUM_FORMS").val()) {
return; // don't allow more than max forms
}
new_formset_item.data("prefix", prefix);
$(this).before(new_formset_item);
new_formset_item.find("input").val("");
setFormsetIndex(new_formset_item, prefix, parseInt($("#id_formset_" + prefix + "-TOTAL_FORMS").val()));
$("#id_formset_" + prefix + "-TOTAL_FORMS").val(parseInt($("#id_formset_" + prefix + "-TOTAL_FORMS").val()) +1);
$(".formset").sortable( "refresh" );
$(".formset").sortable( "refreshPositions" );
});
// rudimentary accordion error handling
$('.has-error').closest('.panel').find('.panel-heading').addClass("error");
$('.alert.alert-block.alert-danger').closest('.panel').find('.panel-heading').addClass("error");
</script>
{% endblock %}
{% endblock %}

View file

@ -0,0 +1,42 @@
{% extends "bases/bootstrap-jquery.html" %}
{% load staticfiles %}
{% block nav %}
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-static-top navbar-shadow" 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="{% url 'user_home' %}">Demo Members Area</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="{% url 'user_home' %}">Home</a></li>
<li><a href="{% url 'user_action' %}">Action</a></li>
<li><a href="{% url 'polls:index' %}">Events</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<strong> {{ user.display_name }}</strong> <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header">Account</li>
<li><a href="{% url 'account_profile' %}"><i class="fa fa-cog"></i> Settings</a></li>
<li><a href="{% url 'account_events' %}"><i class="fa fa-bell"></i> My Events</a></li>
<li><a href="{% url 'account_email' %}"><i class="fa fa-envelope"></i> Email Addresses</a></li>
<li><a href="{% url 'socialaccount_connections' %}"><i class="fa fa-facebook"></i> Social Networks</a></li>
<li><a href="{% url 'account_change_password' %}"><i class="fa fa-lock"></i> Change Password</a></li>
<li class="divider"></li>
<li><a href="{% url 'account_logout' %}"><i class="fa fa-sign-out"></i> Sign Out</a></li>
</ul>
</li>
<li>{% if user.profile.avatar_url %}<img alt="" style="width:50px; height:50px" src="{{user.profile.avatar_url}}">{% endif %}</li>
</ul>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,25 @@
{% extends "bases/bootstrap-jquery.html" %}
{% load staticfiles %}
{% block nav %}
<div class="navbar navbar-default navbar-static-top navbar-shadow" 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="/"><img src='{% static "img/demos-banner.png" %}' style="height:100%" title="demos2"></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="{% url 'landing_index' %}"><strong>Home</strong></a></li>
<li><a href="{% url 'account_signup' %}"><strong>Join</strong></a></li>
<li><a href="{% url 'account_login' %}"><strong>Log In</strong></a></li>
</ul>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,29 @@
{% extends "bases/bootstrap-jquery.html" %}
{% load staticfiles %}
{% block nav %}
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-static-top navbar-shadow" 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="/"><img src='{% static "img/demos2-banner.png" %}' style="height:100%" title="demos2"></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="{% url 'landing_index' %}">Welcome</a></li>
<li><a href="{% url 'landing_about' %}">About</a></li>
<li><a href="{% url 'polls:index' %}">Events</a></li>
<li><a href="{% url 'account_signup' %}"><strong>Join</strong></a></li>
<li><a href="{% url 'account_login' %}"><strong>Log In</strong></a></li>
</ul>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,48 @@
{% extends "bases/bootstrap-jquery.html" %}
{% load staticfiles %}
{% block nav %}
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-static-top navbar-shadow" 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="/"><img src='{% static "img/demos2-banner.png" %}' style="height:30px" title="demos2"></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="{% url 'landing_index' %}">Welcome</a></li>
<li><a href="{% url 'landing_about' %}">About</a></li>
<li><a href="{% url 'polls:index' %}">Events</a></li>
{% if user.is_authenticated %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<strong> {{ user.display_name }}</strong> <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header">Account</li>
<li><a href="{% url 'account_profile' %}"><i class="fa fa-cog"></i> Settings</a></li>
<li><a href="{% url 'account_events' %}"><i class="fa fa-bell"></i> My Events</a></li>
<li><a href="{% url 'account_email' %}"><i class="fa fa-envelope"></i> Email Addresses</a></li>
<li><a href="{% url 'socialaccount_connections' %}"><i class="fa fa-facebook"></i> Social Networks</a></li>
<li><a href="{% url 'account_change_password' %}"><i class="fa fa-lock"></i> Change Password</a></li>
<li class="divider"></li>
<li><a href="{% url 'account_logout' %}"><i class="fa fa-sign-out"></i> Sign Out</a></li>
</ul>
</li>
<li>{% if user.profile.avatar_url %}<img alt="" style="width:50px; height:50px" src="{{user.profile.avatar_url}}">{% endif %}</li>
{% else %}
<li><a href="{% url 'account_signup' %}"><strong>Join</strong></a></li>
<li><a href="{% url 'account_login' %}"><strong>Log In</strong></a></li>
{% endif %}
</ul>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,52 @@
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en" {% block htmlattr %}{% endblock %}>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}dẽmos 2{% endblock %}</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
{% block head_css %}
<link rel="stylesheet" media="screen" href='{% static "css/main.css" %}'>
{% endblock %}
</head>
<body class='{% block pageclass %}{% endblock %}' {% block bodyattr %}{% endblock %}>
{% block nav %}{% endblock %}
{% block content %}{% endblock %}
{% block footer %}
<div class=container>
<hr>
<footer>
<ul class="list-inline pull-right">
<li><a href="{% url 'website_terms' %}">Terms</a></li>
<li><a href="{% url 'website_contact' %}">Contact</a></li>
</ul>
<p class=muted>{% include "copyright.html" %}</p>
</footer>
</div>
{% endblock %}
{% block tail_js %}
{% endblock %}
</body>
</html>

View file

@ -0,0 +1,12 @@
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#{{ div.data_parent }}" href="#{{ div.css_id }}">{{ div.name }}</a>
</h4>
</div>
<div id="{{ div.css_id }}" class="panel-collapse collapse{% if div.active %} in{% endif %}" >
<div class="panel-body">
{{ fields|safe }}
</div>
</div>
</div>

View file

@ -0,0 +1,3 @@
<div class="panel-group" id="{{ accordion.css_id }}">
{{ content|safe }}
</div>

View file

@ -0,0 +1,22 @@
{% for fieldset in form.fieldsets %}
<fieldset class="fieldset-{{ forloop.counter }} {{ fieldset.classes }}">
{% if fieldset.legend %}
<legend>{{ fieldset.legend }}</legend>
{% endif %}
{% if fieldset.description %}
<p class="description">{{ fieldset.description }}</p>
{% endif %}
{% for field in fieldset %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% include "bootstrap3/field.html" %}
{% endif %}
{% endfor %}
{% if not forloop.last or not fieldset_open %}
</fieldset>
{% endif %}
{% endfor %}

View file

@ -0,0 +1,9 @@
{% if form.form_html %}
{% if include_media %}{{ form.media }}{% endif %}
{% if form_show_errors %}
{% include "bootstrap3/errors.html" %}
{% endif %}
{{ form.form_html }}
{% else %}
{% include "bootstrap3/uni_form.html" %}
{% endif %}

View file

@ -0,0 +1,8 @@
{% if form.non_field_errors %}
<div class="alert alert-block alert-danger">
{% if form_error_title %}<h4 class="alert-heading">{{ form_error_title }}</h4>{% endif %}
<ul>
{{ form.non_field_errors|unordered_list }}
</ul>
</div>
{% endif %}

View file

@ -0,0 +1,9 @@
{% if formset.non_form_errors %}
<div class="alert alert-block alert-danger">
{% if formset_error_title %}<h4 class="alert-heading">{{ formset_error_title }}</h4>{% endif %}
<ul>
{{ formset.non_form_errors|unordered_list }}
</ul>
</div>
{% endif %}

View file

@ -0,0 +1,48 @@
{% load crispy_forms_field %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field|is_checkbox %}
<div class="form-group">
{% if label_class %}
<div class="controls col-{{ bootstrap_device_type }}-offset-{{ label_size }} {{ field_class }}">
{% endif %}
{% endif %}
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" {% if not field|is_checkbox %}class="form-group{% else %}class="checkbox{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors%}{% if field.errors %} has-error{% endif %}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label and not field|is_checkbox and form_show_labels %}
<label for="{{ field.id_for_label }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}
{% if field|is_checkboxselectmultiple %}
{% include 'bootstrap3/layout/checkboxselectmultiple.html' %}
{% endif %}
{% if field|is_radioselect %}
{% include 'bootstrap3/layout/radioselect.html' %}
{% endif %}
{% if not field|is_checkboxselectmultiple and not field|is_radioselect %}
{% if field|is_checkbox and form_show_labels %}
<label for="{{ field.id_for_label }}" class="{% if field.field.required %} requiredField{% endif %}">
{% crispy_field field %}
{{ field.label|safe }}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
</label>
{% else %}
<div class="controls {{ field_class }}">
{% crispy_field field %}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
</div>
{% endif %}
{% endif %}
</{% if tag %}{{ tag }}{% else %}div{% endif %}>
{% if field|is_checkbox %}
{% if label_class %}
</div>
{% endif %}
</div>
{% endif %}
{% endif %}

View file

@ -0,0 +1,13 @@
{% if inputs %}
<div class="form-group">
{% if label_class %}
<div class="aab controls {{ label_class }}"></div>
{% endif %}
<div class="controls {{ field_class }}">
{% for input in inputs %}
{% include "bootstrap3/layout/baseinput.html" %}
{% endfor %}
</div>
</div>
{% endif %}

View file

@ -0,0 +1,4 @@
<div{% if alert.css_id %} id="{{ alert.css_id }}"{% endif %}{% if alert.css_class %} class="{{ alert.css_class }}"{% endif %}>
{% if dismiss %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
{{ content|safe }}
</div>

View file

@ -0,0 +1,9 @@
<input type="{{ input.input_type }}"
name="{% if input.name|wordcount > 1 %}{{ input.name|slugify }}{% else %}{{ input.name }}{% endif %}"
value="{{ input.value }}"
{% if input.input_type != "hidden" %}
class="{{ input.field_classes }}"
id="{% if input.id %}{{ input.id }}{% else %}{{ input.input_type }}-id-{{ input.name|slugify }}{% endif %}"
{% endif %}
{{ input.flat_attrs|safe }}
/>

View file

@ -0,0 +1 @@
<button {{ button.flat_attrs|safe }}>{{ button.content|safe }}</button>

View file

@ -0,0 +1,4 @@
<div {% if buttonholder.css_id %}id="{{ buttonholder.css_id }}"{% endif %}
class="buttonHolder{% if buttonholder.css_class %} {{ buttonholder.css_class }}{% endif %}">
{{ fields_output|safe }}
</div>

View file

@ -0,0 +1,17 @@
{% load crispy_forms_filters %}
{% load l10n %}
<div class="controls {{ field_class }}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
{% include 'bootstrap3/layout/field_errors_block.html' %}
{% for choice in field.field.choices %}
{% if not inline_class %}<div class="checkbox">{% endif %}
<label class="{% if inline_class %}checkbox-{{ inline_class }}{% endif %}">
<input type="checkbox"{% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0|unlocalize }}" {{ field.field.widget.attrs|flatatt }}>{{ choice.1|unlocalize }}
</label>
{% if not inline_class %}</div>{% endif %}
{% endfor %}
{% include 'bootstrap3/layout/help_text.html' %}
</div>

View file

@ -0,0 +1,14 @@
{% if field.is_hidden %}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="form-group{% if form_show_errors and field.errors %} has-error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label %}
<label for="{{ field.auto_id }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}
{% include 'bootstrap3/layout/checkboxselectmultiple.html' %}
</div>
{% endif %}

View file

@ -0,0 +1,4 @@
<div {% if div.css_id %}id="{{ div.css_id }}"{% endif %}
{% if div.css_class %}class="{{ div.css_class }}"{% endif %} {{ div.flat_attrs|safe }}>
{{ fields|safe }}
</div>

View file

@ -0,0 +1,5 @@
{% if form_show_errors and field.errors %}
{% for error in field.errors %}
<span id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="help-block"><strong>{{ error }}</strong></span>
{% endfor %}
{% endif %}

View file

@ -0,0 +1,5 @@
{% if form_show_errors and field.errors %}
{% for error in field.errors %}
<p id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="help-block"><strong>{{ error }}</strong></p>
{% endfor %}
{% endif %}

View file

@ -0,0 +1,17 @@
{% load crispy_forms_field %}
<div{% if div.css_id %} id="{{ div.css_id }}"{% endif %} class="form-group{% if form_show_errors and field.errors %} has-error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}{% if div.css_class %} {{ div.css_class }}{% endif %}" {{ div.flat_attrs|safe }}>
{% if field.label and form_show_labels %}
<label for="{{ field.id_for_label }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}
<div class="controls {{ field_class }}">
<div class="input-group">
{% crispy_field field %}
<span class="input-group-btn{% if active %} active{% endif %}{% if input_size %} {{ input_size }}{% endif %}">{{ buttons|safe }}</span>
</div>
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
</div>
</div>

View file

@ -0,0 +1,6 @@
<fieldset {% if fieldset.css_id %}id="{{ fieldset.css_id }}"{% endif %}
{% if fieldset.css_class or form_style %}class="{{ fieldset.css_class }} {{ form_style }}"{% endif %}
{{ fieldset.flat_attrs|safe }}>
{% if legend %}<legend>{{ legend|safe }}</legend>{% endif %}
{{ fields|safe }}
</fieldset>

View file

@ -0,0 +1,9 @@
<div{% if formactions.attrs %} {{ formactions.flat_attrs|safe }}{% endif %} class="form-group">
{% if label_class %}
<div class="aab controls {{ label_class }}"></div>
{% endif %}
<div class="controls {{ field_class }}">
{{ fields_output|safe }}
</div>
</div>

View file

@ -0,0 +1,7 @@
{% if field.help_text %}
{% if help_text_inline %}
<span id="hint_{{ field.auto_id }}" class="help-block">{{ field.help_text|safe }}</span>
{% else %}
<p id="hint_{{ field.auto_id }}" class="help-block">{{ field.help_text|safe }}</p>
{% endif %}
{% endif %}

View file

@ -0,0 +1,13 @@
{% if help_text_inline and not error_text_inline %}
{% include 'bootstrap3/layout/help_text.html' %}
{% endif %}
{% if error_text_inline %}
{% include 'bootstrap3/layout/field_errors.html' %}
{% else %}
{% include 'bootstrap3/layout/field_errors_block.html' %}
{% endif %}
{% if not help_text_inline %}
{% include 'bootstrap3/layout/help_text.html' %}
{% endif %}

View file

@ -0,0 +1,21 @@
{% load crispy_forms_field %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field|is_checkbox %}
<div id="div_{{ field.auto_id }}" class="checkbox">
<label for="{{ field.id_for_label }}" class="{% if field.field.required %} requiredField{% endif %}">
{% crispy_field field 'class' 'checkbox' %}
{{ field.label|safe }}
</label>
</div>
{% else %}
<div id="div_{{ field.auto_id }}" class="form-group">
<label for="{{ field.id_for_label }}" class="sr-only{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}
</label>
{% crispy_field field 'placeholder' field.label %}
</div>
{% endif %}
{% endif %}

View file

@ -0,0 +1,27 @@
{% load crispy_forms_field %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field.label %}
<label for="{{ field.id_for_label }}"{% if labelclass %} class="{{ labelclass }}"{% endif %}>
{% endif %}
{% if field|is_checkbox %}
{% crispy_field field %}
{% endif %}
{% if field.label %}
{{ field.label }}
{% endif %}
{% if not field|is_checkbox %}
{% crispy_field field %}
{% endif %}
{% if field.label %}
</label>
{% endif %}
{% endif %}

View file

@ -0,0 +1,30 @@
{% load crispy_forms_field %}
{% if field.is_hidden %}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="form-group{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors and field.errors %} has-error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label and form_show_labels %}
<label for="{{ field.id_for_label }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}
<div class="controls {{ field_class }}">
{% if field|is_select %}
{% if crispy_prepended_text %}<span class="input-group{% if active %} active{% endif %}{% if input_size %} {{ input_size }}{% endif %}">{{ crispy_prepended_text|safe }}</span>{% endif %}
{% crispy_field field %}
{% if crispy_appended_text %}<span class="input-group{% if active %} active{% endif %}{% if input_size %} {{ input_size }}{% endif %}">{{ crispy_appended_text|safe }}</span>{% endif %}
{% else %}
<div class="input-group">
{% if crispy_prepended_text %}<span class="input-group-addon{% if active %} active{% endif %}{% if input_size %} {{ input_size }}{% endif %}">{{ crispy_prepended_text|safe }}</span>{% endif %}
{% crispy_field field %}
{% if crispy_appended_text %}<span class="input-group-addon{% if active %} active{% endif %}{% if input_size %} {{ input_size }}{% endif %}">{{ crispy_appended_text|safe }}</span>{% endif %}
</div>
{% endif %}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
</div>
</div>
{% endif %}

View file

@ -0,0 +1,16 @@
{% load crispy_forms_filters %}
{% load l10n %}
<div class="controls {{ field_class }}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
{% include 'bootstrap3/layout/field_errors_block.html' %}
{% for choice in field.field.choices %}
{% if not inline_class %}<div class="radio">{% endif %}
<label class="{% if inline_class %}radio-{{ inline_class }}{% endif %}">
<input type="radio"{% if choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0|unlocalize }}" {{ field.field.widget.attrs|flatatt }}>{{ choice.1|unlocalize }}
</label>
{% if not inline_class %}</div>{% endif %}
{% endfor %}
{% include 'bootstrap3/layout/help_text.html' %}
</div>

View file

@ -0,0 +1,14 @@
{% if field.is_hidden %}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="form-group{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors and field.errors %} has-error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label %}
<label for="{{ field.auto_id }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}
{% include 'bootstrap3/layout/radioselect.html' %}
</div>
{% endif %}

View file

@ -0,0 +1 @@
<li class="tab-pane{% if 'active' in link.css_class %} active{% endif %}"><a href="#{{ link.css_id }}" data-toggle="tab">{{ link.name|capfirst }}{% if tab.errors %}!{% endif %}</a></li>

View file

@ -0,0 +1,6 @@
<ul{% if tabs.css_id %} id="{{ tabs.css_id }}"{% endif %} class="nav nav-tabs">
{{ links|safe }}
</ul>
<div class="tab-content panel-body">
{{ content|safe }}
</div>

View file

@ -0,0 +1,10 @@
{% load crispy_forms_field %}
<div id="div_{{ field.auto_id }}" class="form-group{% if form_show_errors and field.errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
<label class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}</label>
<div class="controls {{ field_class }}">
{% crispy_field field 'disabled' 'disabled' %}
{% include 'bootstrap3/layout/help_text.html' %}
</div>
</div>

View file

@ -0,0 +1,51 @@
{% load crispy_forms_tags %}
{% load crispy_forms_utils %}
{% load crispy_forms_field %}
{% specialspaceless %}
{% if formset_tag %}
<form {{ flat_attrs|safe }} method="{{ form_method }}" {% if formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
{% endif %}
{% if formset_method|lower == 'post' and not disable_csrf %}
{% csrf_token %}
{% endif %}
<div>
{{ formset.management_form|crispy }}
</div>
<table{% if form_id %} id="{{ form_id }}_table"{% endif%} class="table table-striped table-condensed">
<thead>
{% if formset.readonly and not formset.queryset.exists %}
{% else %}
<tr>
{% for field in formset.forms.0 %}
{% if field.label and not field|is_checkbox and not field.is_hidden %}
<th for="{{ field.auto_id }}" class="control-label {% if field.field.required %}requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</th>
{% endif %}
{% endfor %}
</tr>
{% endif %}
</thead>
<tbody>
{% for form in formset %}
{% if form_show_errors and not form.is_extra %}
{% include "bootstrap3/errors.html" %}
{% endif %}
<tr>
{% for field in form %}
{% include 'bootstrap3/field.html' with tag="td" form_show_labels=False %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% include "bootstrap3/inputs.html" %}
{% if formset_tag %}</form>{% endif %}
{% endspecialspaceless %}

View file

@ -0,0 +1,11 @@
{% load crispy_forms_utils %}
{% specialspaceless %}
{% if include_media %}{{ form.media }}{% endif %}
{% if form_show_errors %}
{% include "bootstrap3/errors.html" %}
{% endif %}
{% for field in form %}
{% include "bootstrap3/field.html" %}
{% endfor %}
{% endspecialspaceless %}

View file

@ -0,0 +1,8 @@
{% with formset.management_form as form %}
{% include 'bootstrap3/uni_form.html' %}
{% endwith %}
{% for form in formset %}
<div class="multiField">
{% include 'bootstrap3/uni_form.html' %}
</div>
{% endfor %}

View file

@ -0,0 +1,14 @@
{% load crispy_forms_utils %}
{% specialspaceless %}
{% if form_tag %}<form {{ flat_attrs|safe }} method="{{ form_method }}" {% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>{% endif %}
{% if form_method|lower == 'post' and not disable_csrf %}
{% csrf_token %}
{% endif %}
{% include "bootstrap3/display_form.html" %}
{% include "bootstrap3/inputs.html" %}
{% if form_tag %}</form>{% endif %}
{% endspecialspaceless %}

View file

@ -0,0 +1,30 @@
{% load crispy_forms_tags %}
{% load crispy_forms_utils %}
{% specialspaceless %}
{% if formset_tag %}
<form {{ flat_attrs|safe }} method="{{ form_method }}" {% if formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
{% endif %}
{% if formset_method|lower == 'post' and not disable_csrf %}
{% csrf_token %}
{% endif %}
<div>
{{ formset.management_form|crispy }}
</div>
{% include "bootstrap3/errors_formset.html" %}
{% for form in formset %}
{% include "bootstrap3/display_form.html" %}
{% endfor %}
{% if inputs %}
<div class="form-actions">
{% for input in inputs %}
{% include "bootstrap3/layout/baseinput.html" %}
{% endfor %}
</div>
{% endif %}
{% if formset_tag %}</form>{% endif %}
{% endspecialspaceless %}

View file

@ -0,0 +1,16 @@
<script type="text/javascript">
var DjangoRecaptchaOptions = {{options}};
if (typeof RecaptchaOptions !== 'object') {
RecaptchaOptions = DjangoRecaptchaOptions;
} else {
for (key in DjangoRecaptchaOptions) {
RecaptchaOptions[key] = DjangoRecaptchaOptions[key];
}
}
</script>
<script type="text/javascript" src="{{api_server}}/challenge?k={{public_key}}&hl={{lang}}{{error_param}}"></script>
<noscript>
<iframe src="{{api_server}}/noscript?k={{public_key}}&hl={{lang}}{{error_param}}" height="300" width="500" frameborder="0"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type='hidden' name='recaptcha_response_field' value='manual_challenge' />
</noscript>

View file

@ -0,0 +1,25 @@
{# import recaptcha_ajax.js in your body #}
{# <script type="text/javascript" src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> #}
<div id="Recap"></div>
<script type="text/javascript">
var RecaptchaOptions = {{ options }};
Recaptcha.create("{{ public_key }}",
"Recap",
{
theme: RecaptchaOptions['theme'] || "red",
callback: Recaptcha.focus_response_field
},
RecaptchaOptions
);
</script>
{% comment %}
<noscript>
<iframe src="{{api_server}}/noscript?k={{public_key}}{{error_param}}" height="300" width="500" frameborder="0"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type='hidden' name='recaptcha_response_field' value='manual_challenge' />
</noscript>
{% endcomment %}

View file

@ -0,0 +1,33 @@
<script src='https://www.google.com/recaptcha/api.js{% if lang %}?hl={{ lang }}{% endif %}'></script>
<script type="text/javascript">
var DjangoRecaptchaOptions = {{options}};
if (typeof RecaptchaOptions !== 'object') {
RecaptchaOptions = DjangoRecaptchaOptions;
} else {
for (key in DjangoRecaptchaOptions) {
RecaptchaOptions[key] = DjangoRecaptchaOptions[key];
}
}
</script>
<div class="g-recaptcha" data-sitekey="{{ public_key }}"></div>
<noscript>
<div style="width: 302px; height: 352px;">
<div style="width: 302px; height: 352px; position: relative;">
<div style="width: 302px; height: 352px; position: absolute;">
<iframe src="https://www.google.com/recaptcha/api/fallback?k={{ public_key }}"
frameborder="0" scrolling="no"
style="width: 302px; height:352px; border-style: none;">
</iframe>
</div>
<div style="width: 250px; height: 80px; position: absolute; border-style: none;
bottom: 21px; left: 25px; margin: 0px; padding: 0px; right: 25px;">
<textarea id="g-recaptcha-response" name="g-recaptcha-response"
class="recaptcha_challenge_field"
style="width: 250px; height: 80px; border: 1px solid #c1c1c1;
margin: 0px; padding: 0px; resize: none;" value="">
</textarea>
<input type='hidden' name='recaptcha_response_field' value='manual_challenge' />
</div>
</div>
</div>
</noscript>

View file

@ -0,0 +1 @@
&copy; 2014-2015 See LICENSE

View file

@ -0,0 +1,10 @@
{% extends "bases/bootstrap-member.html" %}
{% block head_title %}Action{% endblock %}
{% block content %}
<div class="container">
<p>A user could do something else here.</p>
</div>
{% endblock %}

View file

@ -0,0 +1,63 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "Account Activity & Events" %}{% endblock %}
{% block account_nav_events %}active{% endblock %}
{% block account_content %}
<div class="container">
<h2>My Events</h2>
{% if object_list %}
<ul class="list-group">
{% for event in object_list %}
<li class="list-group-item"><a href="{% url 'polls:view-event' event.id %}">{{ event.title }}</a> - {{ event.start_time }}</li>
{% endfor %}
</ul>
{% else %}
<p>No Events are available.</p>
{% endif %}
</div>
{% endblock %}
<!--
<div class="row">
{% bootstrap_messages %}
<div class="col-sm-6 col-md-4 col-lg4">
<p class="sticky taped2" style="width: 250px;">
<strong>Welcome {{ request.user.name }}!</strong><br>
At this point, the site has<br />
authenticated you and, if you<br />
used a social network, retrieved<br />
your picture and key bio details<br />
such as name.
</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-4">
<h3>Picture</h3>
<p class="picture-frame">
{% if user.profile.avatar_url %}<img alt="" src="{{user.profile.avatar_url}}" style="width: 256px; height: 256px">
{% else %}No picture available yet.{% endif %}
</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-4">
<h3>Profile</h3>
<ul class="list-unstyled">
<li>First name: <strong>{{user.first_name}}</strong></li>
<li>Last name: <strong>{{user.last_name}}</strong></li>
<li>Display name: <strong>{{user.display_name}}</strong></li>
<li>Email: <strong>{{user.email}}</strong></li>
<li>{% if request.user.profile.account_verified %}Verified{% else %}Unverified{% endif %}</li>
</ul>
<a href="{% url 'account_profile' %}">Edit</a>
</div>
</div>
-->

View file

@ -0,0 +1,48 @@
{% extends "account/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block head_title %}{% trans "" %}{% endblock %}
{% block account_content %}
{% endblock %}
<!--
<div class="row">
{% bootstrap_messages %}
<div class="col-sm-6 col-md-4 col-lg4">
<p class="sticky taped2" style="width: 250px;">
<strong>Welcome {{ request.user.name }}!</strong><br>
At this point, the site has<br />
authenticated you and, if you<br />
used a social network, retrieved<br />
your picture and key bio details<br />
such as name.
</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-4">
<h3>Picture</h3>
<p class="picture-frame">
{% if user.profile.avatar_url %}<img alt="" src="{{user.profile.avatar_url}}" style="width: 256px; height: 256px">
{% else %}No picture available yet.{% endif %}
</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-4">
<h3>Profile</h3>
<ul class="list-unstyled">
<li>First name: <strong>{{user.first_name}}</strong></li>
<li>Last name: <strong>{{user.last_name}}</strong></li>
<li>Display name: <strong>{{user.display_name}}</strong></li>
<li>Email: <strong>{{user.email}}</strong></li>
<li>{% if request.user.profile.account_verified %}Verified{% else %}Unverified{% endif %}</li>
</ul>
<a href="{% url 'account_profile' %}">Edit</a>
</div>
</div>
-->

View file

@ -0,0 +1,429 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block content %}
<!-- The following UI was ported from the Election Authority UI in DEMOS1 by Vincent de Almeida -->
<!-- The DEMOS1 repository can be found at: https://github.com/mlevogiannis/demos-voting -->
<!-- TODO: look into i18n translations as this was a feature implemented in DEMOS1 -->
<hr/>
<div class="container">
<div class="page-header">
<h2>Create New Event with Polls</h2>
</div>
<div class="row">
<div class="col-xs-12">
<form id="election-form" class="form-horizontal" method="POST" novalidate>
{% csrf_token %}
<!-- TODO: Have not imported the if form not valid template code as this needs further investigating -->
<!-- Name -->
<div class="form-group"> <!-- Excluded class(missing %s): { if election_form.name.errors }has-error{ endif } -->
<label for="name-input" class="col-sm-3 col-md-2 control-label">Name:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<input type="text" class="form-control" id="name-input" placeholder="Example: My poll" name="name-input" maxlength="255">
<span id="name-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
A short and clear name.
<!-- TODO: Alignment is potentially slightly too much to the left -->
</span>
</div>
</div>
<!-- Slug / Identifier -->
<div class="form-group"> <!-- Excluded class(missing %s): { if election_form.slug.errors }has-error{ endif } -->
<label for="identifier-input" class="col-sm-3 col-md-2 control-label">Identifier:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<input type="text" class="form-control" id="identifier-input" placeholder="Example: My-poll" name="identifier-input" maxlength="255">
<span id="identifier-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Used in the election URL, it must only consist of letters, numbers, underscores or hyphens; no whitespace is permitted.
<!-- TODO: Alignment is potentially slightly too much to the left -->
</span>
</div>
</div>
<!-- Voting start time -->
<div class="form-group "> <!-- Excluded class(missing %s): { if election_form.voting_starts_at.errors }has-error{ endif } -->
<label for="vote-start-input" class="col-sm-3 col-md-2 control-label">Voting starts at:</label>
<div class="col-sm-9 col-md-10">
<div class="input-group date">
<input type="text" class="form-control" data-date-format="YYYY-MM-DD H:mm" id="vote-start-input" name="vote-start-input">
<span class="input-group-addon btn">
<i class="fa fa-calendar" aria-hidden="true"></i>
/
<i class="fa fa-clock-o" aria-hidden="true"></i>
</span>
</div>
<span id="vote-start-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Date and time when registered voters can commence voting.
</span>
</div>
</div>
<!-- Voting end time -->
<div class="form-group "> <!-- Excluded class(missing %s): { if election_form.voting_ends_at.errors }has-error{ endif } -->
<label for="vote-end-input" class="col-sm-3 col-md-2 control-label">Voting ends at:</label>
<div class="col-sm-9 col-md-10">
<div class="input-group date">
<input type="text" class="form-control" data-date-format="YYYY-MM-DD H:mm" id="vote-end-input" name="vote-end-input">
<span class="input-group-addon btn">
<i class="fa fa-calendar" aria-hidden="true"></i>
/
<i class="fa fa-clock-o" aria-hidden="true"></i>
</span>
</div>
<span id="vote-end-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Date and time when registered voters can no longer vote.
</span>
</div>
</div>
<!-- Question / Statement -->
<div class="form-group">
<label for="question-input" class="col-sm-3 col-md-2 control-label">Question / Statement:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<input type="text" class="form-control" id="question-input" placeholder="Example: Elections for the European Parliament" name="question-input" maxlength="200">
<span id="question-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Question / Statement that will be put forward to voters along with the below options.
<!-- TODO: Alignment is potentially slightly too much to the left -->
</span>
</div>
</div>
<!-- Options -->
<div class="form-group">
<label for="options-input" class="col-sm-3 col-md-2 control-label">Options:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<div class="form-group"> <!-- Excluded class(missing %s): { if option_formset.non_form_errors }has-error{ endif }-->
<table id="options-input-table" class="table table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th>Option</th>
<th class="text-center">Actions</th>
<!--Not sure what this does so disabling it: <th class="hidden">{ option_formset.management_form }</th> -->
</tr>
</thead>
<tbody id="sort" class="formset option-formset" data-formset-prefix="questions" data-formset-type="inline">
<!-- Option -->
<tr class="formset-form sorting-row" data-formset-form-prefix="question">
<!-- # -->
<th class="formset-form-index text-center" scope=row>
1
</th>
<!-- Option Label -->
<td>
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: Candidate 1" id="option-name-input" name="option-name-input" maxlength="200">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<!-- Delete Action -->
<td class="formset-form-actions text-center">
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
<!-- Option -->
<tr class="formset-form sorting-row" data-formset-form-prefix="question">
<!-- # -->
<th class="formset-form-index text-center" scope=row>
2
</th>
<!-- Option Label -->
<td>
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: Candidate 2" id="option-name-input" name="option-name-input" maxlength="200">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<!-- Delete Action -->
<td class="formset-form-actions text-center">
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
<!-- Option -->
<tr class="formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix="question">
<!-- # -->
<th class="formset-form-index text-center" scope=row>
X
</th>
<!-- Option Label -->
<td>
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: Candidate X" id="option-name-input" name="option-name-input" maxlength="200">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<!-- Delete Action -->
<td class="formset-form-actions text-center">
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
</tbody>
</table>
<div class="clearfix">
<button type="button" class="btn btn-primary formset-add" data-formset-prefix="questions">
<i class="fa fa-plus-circle" aria-hidden="true"></i>
Add Question Option
</button>
</div>
<span id="question-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Drag and drop to re-order options.
</span>
</div>
</div>
</div>
<!-- Number of option selections -->
<div class="form-group">
<label for="selections-input" class="col-sm-3 col-md-2 control-label">Number of Selections:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<div class="row">
<div class="col-xs-6">
<label class="sr-only" for="minimum-input">Minimum</label>
<input type="number" class="form-control" id="minimum-input" placeholder="Minimum" value="" name="minimum-input" min="0"> <!-- TODO: Max should be set to the number of options -->
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
<div class="col-xs-6">
<label class="sr-only" for="maximum-input">Maximum</label>
<input type="number" class="form-control" id="maximum-input" placeholder="Maximum" value="" name="maximum-input" min="1"> <!-- TODO: Max should be set to the number of options -->
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</div>
<span id="question-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Minimum and maximum number of option selections that a voter can make for the specified question / statement.
<!-- TODO: Alignment is potentially slightly too much to the left -->
</span>
</div>
</div>
<!-- Organisers -->
<div class="form-group">
<label for="organisers-input" class="col-sm-3 col-md-2 control-label">Organisers:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<div class="form-group">
<table id="organisers-input-table" class="table table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th>Email</th>
<th class="text-center">Actions</th>
<!--Not sure what this does so disabling it: <th class="hidden">{ option_formset.management_form }</th> -->
</tr>
</thead>
<tbody class="formset organiser-formset" data-formset-prefix="organisers" data-formset-type="inline">
<!-- Organiser -->
<tr class="formset-form sorting-row" data-formset-form-prefix="organiser">
<th class="formset-form-index text-center" scope=row>
<!-- # -->
1
</th>
<td>
<!-- Email -->
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: organiser@example.com" id="organiser-email-input" name="organiser-email-input" value="{{ user_email }}" maxlength="255">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<td class="formset-form-actions text-center">
<!-- Action -->
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
<!-- Organiser -->
<tr class="formset-form sorting-row" data-formset-form-prefix="question">
<th class="formset-form-index text-center" scope=row>
<!-- # -->
2
</th>
<td>
<!-- Email -->
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: organiser@example.com" id="organiser-email-input" name="organiser-email-input" maxlength="255">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<td class="formset-form-actions text-center">
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
<!-- Organiser -->
<tr class="formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix="question">
<th class="formset-form-index text-center" scope=row>
<!-- # -->
X
</th>
<td>
<!-- Email -->
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: organiser@example.com" id="organiser-email-input" name="organiser-email-input" maxlength="255">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<td class="formset-form-actions text-center">
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
</tbody>
</table>
<div class="clearfix">
<button type="button" class="btn btn-primary formset-add" data-formset-prefix="organisers">
<i class="fa fa-plus-circle" aria-hidden="true"></i>
Add Organiser Email
</button>
</div>
<span id="question-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Drag and drop to re-order emails.
</span>
</div>
</div>
</div>
<!-- Trustees -->
<div class="form-group">
<label for="trustees-input" class="col-sm-3 col-md-2 control-label">Trustees:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<div class="form-group">
<table id="trustees-input-table" class="table table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th>Email</th>
<th class="text-center">Actions</th>
<!--Not sure what this does so disabling it: <th class="hidden">{ option_formset.management_form }</th> -->
</tr>
</thead>
<tbody class="formset trustee-formset" data-formset-prefix="trustees" data-formset-type="inline">
<!-- Trustee -->
<tr class="formset-form sorting-row" data-formset-form-prefix="trustee">
<th class="formset-form-index text-center" scope=row>
<!-- # -->
1
</th>
<td>
<!-- Email -->
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: trustee@example.com" id="trustee-email-input" name="trustee-email-input" value="{{ user_email }}" maxlength="255">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<td class="formset-form-actions text-center">
<!-- Action -->
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
<!-- Trustee -->
<tr class="formset-form sorting-row" data-formset-form-prefix="trustee">
<th class="formset-form-index text-center" scope=row>
<!-- # -->
2
</th>
<td>
<!-- Email -->
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: trustee@example.com" id="trustee-email-input" name="trustee-email-input" maxlength="255">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<td class="formset-form-actions text-center">
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
<!-- Trustee -->
<tr class="formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix="trustee">
<th class="formset-form-index text-center" scope=row>
<!-- # -->
X
</th>
<td>
<!-- Email -->
<div> <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
<input type="text" class="form-control input-sm" placeholder="Example: trustee@example.com" id="trustee-email-input" name="trustee-email-input" maxlength="255">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
</div>
</td>
<td class="formset-form-actions text-center">
<button type="button" class="btn btn-sm btn-default formset-form-remove" aria-label="Remove">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
</tbody>
</table>
<div class="clearfix">
<button type="button" class="btn btn-primary formset-add" data-formset-prefix="trustees">
<i class="fa fa-plus-circle" aria-hidden="true"></i>
Add Trustee Email
</button>
</div>
<span id="question-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Drag and drop to re-order emails.
</span>
</div>
</div>
</div>
<!-- Voters List -->
<div class="form-group">
<label for="voters-list-input" class="col-sm-3 col-md-2 control-label">Voters List:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<textarea class="form-control" id="voters-list-input" placeholder="alice@example.com, bob@example.com..." name="voters-list-input" rows="4"></textarea>
<span id="voters-list-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Manually enter email addresses separated with commas. Alternatively, you can also upload a CSV file:
<!-- TODO: Alignment is potentially slightly too much to the left -->
</span>
<label for="files" class="btn btn-primary">
Upload CSV
</label>
<input type="file" id="files" name="file" class="btn-info">
<h4 id="result" class="hidden"></h4>
</div>
</div>
<!-- reCAPTCHA -->
<div class="form-group">
<label for="recaptcha-input" class="col-sm-3 col-md-2 control-label">reCAPTCHA:</label> <!-- This text can be a template variable -->
<div class="col-sm-9 col-md-10">
<div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="{{ G_R_SITE_KEY }}"></div> <!-- Need to finish server implementation and import key from settings -->
<span id="recaptcha-input-help-block" class="help-block">
<!-- Error handling / input validation has been removed temporarily and would be placed here -->
Tick the box to prove that you're not a robot.
<!-- TODO: Alignment is potentially slightly too much to the left -->
</span>
</div>
</div>
<hr>
<input class="btn btn-success" type="submit" value="Create Event" id="submit-event-create" disabled/>
<input class="btn btn-danger" type="button" value="Cancel" onclick="location.href='{% url 'polls:index' %}'" />
</form>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,6 @@
{% load crispy_forms_tags %}
<div class="formset">
{% crispy formset helper %}
<button type="button" class="btn btn-default add-another-btn" name="add" value="Add another">Add</button>
</div>

View file

@ -0,0 +1,17 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block content %}
<div class="container">
<h1>Create Poll for {{event.title}}</h1>
{% load crispy_forms_tags %}
<form method="post" action="" class="">
{% crispy question_form %}
<input class="btn btn-default" type="submit" value="Submit"/>
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% block content %}
<div class="container">
<h1>{{ question.question_text }}</h1>
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
<form action="{% url 'polls:vote' question.id %}" method="post">
{% csrf_token %}
{% for choice in question.choice_set.all %}
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br />
{% endfor %}
<input type="submit" value="Vote" />
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,32 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% comment %} is it safe really? {% endcomment %}
{% block sk-file-name %}{{ event.title|safe }}{% endblock %}
{% block content %}
<div class="container">
<h1>Event: {{event.title}}</h1>
<h2>Trustee Decrypt</h2>
<div class="panel panel-default">
<div class="panel-heading">Secret Key</div>
<div class="panel panel-body">
<input id="secret-key" class="textinput textInput form-control" type="text"></input>
<p>Use your secret key to generate a decrypted cipher</p>
<button id="keygen-btn" onclick="demosEncrypt.decryptCipher()" class="btn btn-default">Decrypt</button>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Encrypted Ciphers</div>
<div class="panel panel-body">
{% load crispy_forms_tags %}
<form method="post" action="" class="">
{% crispy formset helper %}
<input class="btn btn-default" type="submit" value="Submit" disabled>
</form>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,39 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block content %}
<div class="container">
<a href="{% url 'polls:index' %}"><< Back to Events List</a>
<br/>
<h1>Event: {{object.title}}</h1>
<p>By {{object.users_organisers.all}}</p>
<ul class="nav nav-tabs">
<li class="{% block event_nav_details %}{% endblock %}">
<a href="{% url 'polls:view-event' event.id %}">Details</a>
</li>
<li class="{% block event_nav_polls %}{% endblock %}">
<a href="{% url 'polls:event-polls' event.id %}">Polls</a>
</li>
<li class="{% block event_nav_organisers %}{% endblock %}">
<a href="{% url 'polls:event-organisers' event.id %}">Organisers</a>
</li>
{% if event.prepared == False and is_trustee %}
<li class="">
<a href="{% url 'polls:prepare-event' event.id %}">Prepare Event</a>
</li>
{% endif %}
{% if is_organiser %}
<li class="">
<a href="{% url 'polls:edit-event' event.id %}"><span class="fa fa-pencil"></span> Edit Event</a>
</li>
<li class="{% block event_nav_launch %}{% endblock %}">
<a href="{% url 'polls:launch-event' event.id %}">Launch Event</a>
</li>
{% endif %}
</ul>
{% block event_content %}{% endblock %}
</div>
{% endblock %}

View file

@ -0,0 +1,13 @@
{% extends "polls/event_detail_base.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block event_nav_details %}active{% endblock %}
{% block event_content %}
<h2>Event Details</h2>
<span>Ready/Prepared: {{ event.prepared }}</span>
<br />
<span>Start Time: {{ event.start_time }}</span>
<br />
<span>End Time: {{ event.end_time }}</span>
{% endblock %}

View file

@ -0,0 +1,14 @@
{% extends "polls/event_detail_base.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block event_nav_launch %}active{% endblock %}
{% block event_content %}
<h2>Event Details</h2>
<span>Trustee keys: {{ event.trustee_keys.count }} / {{ event.users_trustees.count }}</span>
<br />
<span>EID (param): {{ event.EID }} </span>
<br />
<span>Public key: {{ event.public_key }} </span>
{% endblock %}

View file

@ -0,0 +1,37 @@
{% extends "polls/event_detail_base.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block event_nav_organisers %}active{% endblock %}
{% block event_content %}
<h2>Event Organisers</h2>
{% if object.users_organisers.all %}
<ul class="list-group">
{% for user in object.users_organisers.all %}
<li class="list-group-item">{{ user.email }}</li>
{% endfor %}
</ul>
{% else %}
<p>No organisers for this Event.</p>
{% endif %}
<h2>Event Trustees</h2>
{% if object.users_trustees.all %}
<ul class="list-group">
{% for user in object.users_trustees.all %}
<li class="list-group-item">{{ user.email }}</li>
{% endfor %}
</ul>
{% else %}
<p>No trustees for this Event.</p>
{% endif %}
<h2>Voters</h2>
{% if object.voters.all %}
<ul class="list-group">
{% for voter in object.voters.all %}
<li class="list-group-item">{{ voter.email }}</li>
{% endfor %}
</ul>
{% else %}
<p>No voters for this Event.</p>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,20 @@
{% extends "polls/event_detail_base.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block event_nav_polls %}active{% endblock %}
{% block event_content %}
<h2>Related Polls</h2>
{% if object.polls.all %}
<ul class="list-group">
{% for poll in object.polls.all %}
<li class="list-group-item"><a href="{% url 'polls:view-poll' event_id=event.id poll_num=forloop.counter %}">{{ poll.question_text }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No polls are available for this Event.</p>
{% endif %}
{% if is_organiser %}
<a href="{% url 'polls:create-poll' event.id %}" class="btn btn-default" role="button">Add Poll</a>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,57 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% block content %}
<div class="container">
<div class="form-group">
<!-- Heading -->
<div class="col-xs-5 col-sm-3 col-md-2">
<h1>Events</h1>
</div>
<!-- Create Button -->
<div class="col-xs-7 col-sm-9 col-md-10 marginTopCreateButton">
<a href="{% url 'polls:create-event' %}" class="btn btn-primary" style="float:right">
<span class="glyphicon glyphicon-plus"></span> Create New
</a>
</div>
</div>
{% if object_list %}
<div class="form-group">
<table id="trustees-input-table" class="table table-hover marginTopEventList">
<thead>
<tr>
<th class="text-center">Event</th>
<th class="text-center">Start Time</th>
<th class="text-center">End Time</th>
<th class="text-center">No. Polls</th>
<th class="text-center">Edit</th>
<!-- Could also add a delete column to easily remove an event -->
</tr>
</thead>
<tbody>
{% for event in object_list %}
<tr>
<td class="text-center"><a href="{% url 'polls:view-event' event.id %}">{{ event.title }}</a></td>
<td class="text-center">{{ event.start_time }}</td>
<td class="text-center">{{ event.end_time }}</td>
<td class="text-center">{{ event.polls.count }}</td>
<td class="text-center">
<a href="{% url 'polls:edit-event' event.id %}">
<span class="btn btn-default glyphicon glyphicon-pencil"></span>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="col-xs-12 col-sm-12 col-md-12">
<h4>There are currently no events.</h4>
</div>
{% endif %}
</div>
{% endblock %}

View file

@ -0,0 +1,34 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% comment %} is it safe really? {% endcomment %}
{% block sk-file-name %}{{ event.title|safe }}{% endblock %}
{% block content %}
<div class="container">
<h1>Event: {{event.title}}</h1>
<h2>Trustee Setup</h2>
<div class="panel panel-default">
<div class="panel-heading">Public Key</div>
<div class="panel panel-body">
{% load crispy_forms_tags %}
<form method="post" action="" class="">
{% crispy form %}
<input id="public-submit" class="btn btn-default" type="submit" value="Submit" disabled="true"/>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Secret Key</div>
<div class="panel panel-body">
<input id="secret-key" class="textinput textInput form-control" type="text"></input>
<input id="event-param" type="text" value="{{event.EID}}" hidden></input>
<p>Make a backup of this secret key before submitting your public key. This can NOT be recalculated if forgotten!</p>
<button id="keygen-btn" onclick="demosEncrypt.generateKeys()" class="btn btn-default">Generate</button>
<a id="download-btn" role="button" href="#" class="btn btn-default" disabled>Download</a>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,16 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block content %}
<div class="container">
<h1>{{ form_title }}</h1>
{% load crispy_forms_tags %}
<form method="post" action="" {{ form_attributes }} class="">
{% crispy form %}
<input class="btn btn-default" type="submit" value="Submit"/>
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,85 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block app_js_vars %}
var option_count = {{ object.options.count }};
{% endblock %}
{% block content %}
<div class="container">
<input id="event-param" type="text" value="{{event.EID}}" hidden></input>
<input id="comb_pk" type="text" value="{{event.public_key}}" hidden></input>
<h1>Poll: {{object.question_text}}</h1>
<span>Poll {{ poll_num }} of {{ poll_count }} in Event: <a href="{% url 'polls:view-event' object.event.id %}">{{ object.event.title }}</a></span>
<div class="panel panel-body">
{% if prev_index %}
<a href="{% url 'polls:view-poll' event_id=object.event.id poll_num=prev_index %}" class="btn" role="button">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</a>
{% endif %}
{% if next_index %}
<a href="{% url 'polls:view-poll' event_id=object.event.id poll_num=next_index %}" class="btn" role="button">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</a>
{% endif %}
</div>
<a href="{% url 'polls:edit-poll' event_id=object.event.id poll_num=poll_num %}"><span class="fa fa-pencil"></span> Edit Poll</a>
{% if object.options.all %}
<h3>Options</h3>
<p> {{ vote_count }} vote(s) have been cast</p>
{% if can_vote %}
{% if has_voted %}
<p>You have already voted in this poll. Resubmitting the form will change your vote.</p>
{% endif %}
<p>Voting as {{ voter_email }} -- Do NOT share this url</p>
{% load crispy_forms_tags %}
<div class="panel panel-default">
<div class="panel-heading">Options</div>
<div class="panel panel-body">
<select class="radio-inline select form-control" id="poll-options" name="options">
{% load custom_filters_tags %}
{% for option in object.options.all %}
<option value="{{forloop.counter|get_ballot_value}}">{{ option.choice_text }}</option>
{% endfor %}
</select>
<button id="keygen-btn" onclick="demosEncrypt.encryptAndSubmit()" class="btn btn-default">Encrypt & Submit</button>
<form id="cipher-form" method="post" action="" class="">
{% crispy form %}
{% csrf_token %}
</form>
</div>
</div>
{% else %}
<div class="alert alert-warning" role="alert">
<p>You do not have permission to vote in this Event.</p>
</div>
{% endif %}
{% else %}
<p>No options are available.</p>
{% endif %}
</div>
<br>
<br>
POLL ENC {{ object.enc }}
{% if form.errors %}
{% for field in form %}
{% for error in field.errors %}
<div class="alert alert-danger">
<strong>{{ error|escape }}</strong>
</div>
{% endfor %}
{% endfor %}
{% for error in form.non_field_errors %}
<div class="alert alert-danger">
<strong>{{ error|escape }}</strong>
</div>
{% endfor %}
{% endif %}
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% block content %}
<div class="container">
<h1>{{ question.question_text }}</h1>
<ul>
{% for choice in question.choice_set.all %}
<li class="list-group-item">{{ choice.choice_text }} <span class="badge">{{ choice.votes }} vote{{ choice.votes|pluralize }}</span></li>
{% endfor %}
</ul>
<a href="{% url 'polls:detail' question.id %}">Vote again?</a>
</div>
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block content %}
<div class="container">
<h1>Poll: {{poll.question_text}}</h1>
{% if poll.options %}
<ul class="list-group">
{% for option in poll.options.all %}
<li class="list-group-item">{{ option.choice_text }}</li>
{% endfor %}
</ul>
{% else %}
<p>No options are listed.</p>
{% endif %}
</div>
{% endblock %}

View file

@ -0,0 +1,17 @@
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block content %}
<div class="container">
<h1>Vote on {{poll.question_text}}</h1>
{% load crispy_forms_tags %}
<form method="post" action="" class="">
{% crispy vote_form %}
<input class="btn btn-default" type="submit" value="Submit"/>
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,11 @@
{% extends "bases/bootstrap-visitor.html" %}
{% block content %}
<div class="container">
A fancy contact form here.
</div>
{% endblock %}

View file

@ -0,0 +1,23 @@
{% extends "bases/bootstrap-visitor.html" %}
{% block content %}
<div class="container">
<p>
This demo was built with <strong>django-allauth</strong>
[<a href="https://github.com/pennersr/django-allauth">Code</a>,
<a href="http://django-allauth.readthedocs.org/en/latest/">Docs</a>].
It uses Twitter Bootstrap 3 with jQuery.
With some work you can make it use angularjs and angular-ui with no jQuery.
</p>
<p>it uses a custom User model with email and no username.
It also has a connected UserProfile model with an avatar URL.
</p>
</div>
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends "bases/bootstrap-visitor.html" %}
{% load staticfiles %}
{% block content %}
<div class="container">
<div class="jumbotron text-center">
<h1>DEMOS 2</h1>
<img src='{% static "img/demos2-sm.png" %}'>
<p class="lead">
Read more on the <a href="{% url 'landing_about' %}">About Page.</a>
</p>
<p>
<a class="btn btn-lg btn-success " href="{% url 'account_signup' %}" role="button">Join</a>
or
<a class="btn btn-lg btn-success " href="{% url 'account_login' %}" role="button">Log In</a>
</p>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,11 @@
{% extends "bases/bootstrap-visitor.html" %}
{% block content %}
<div class="container">
Terms and stuff.
</div>
{% endblock %}