Source

django-poll-system / poll / templates / polls.html

Full commit
{% load i18n %}
{% load polls_tags %}

{% if poll %}
<link rel="stylesheet" href="{{ STATIC_URL }}polls/css/polls.css" />
<script type="text/javascript">
	vote_url = '{% url poll_ajax_vote poll.pk %}';
	result_url = '{% url poll_ajax_result poll.pk %}';
	poll_pk = '{{ poll.pk }}';
	poll_type = {% if poll.polltype.index == 0 %}'single'{% else %}'multiple'{% endif %};
	show_points = false;
	trans_total_voters = '{% trans "Total Voters" %}';
	trans_select_something = '{% trans "Please, choose anything to vote" %}';
</script>
<script type="text/javascript" src="{{ STATIC_URL }}polls/js/common.js"></script>

<div id="poll_content">
	<noscript>
		<p id="warning">
			{% trans "WARNING: A JavaScript is disabled in your browser. Please, turn it on to vote." %}
		</p>
	</noscript>
	<form method="post">
		{% csrf_token %}
		<h1><span id="poll">{% trans "Poll" %}:</span> {{ poll.title }}</h1>
		{% if user.is_authenticated %}
		<div id="poll_userspace">
			{% trans "User" %}: {{ user }}
		</div>
		{% endif %} 
		<div id="poll_body">
			{% if poll.get_cookie_name in request.COOKIES %}
				<p>{% trans "You already voted" %}.</p>
				<p><a id="showresults" href="javascript:void(0);">{% trans "Show results" %}</a></p>
			{% else %}
				{% render_items poll items %}
				<p><input id="sendvote" type="button" value="{% trans "Vote" %}" /></p>
			{% endif %}
		</div>
	</form>
</div>
{% endif %}