Skip to content

Commit

Permalink
0.2.1 - Some small styles improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
applecat committed Mar 28, 2017
1 parent b0625c6 commit 6b7c29a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 142 deletions.
115 changes: 0 additions & 115 deletions poll/#migrations/0001_initial.py

This file was deleted.

Empty file removed poll/#migrations/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion poll/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = (0, 2, 0, 'final', 0)
VERSION = (0, 2, 1, 'final', 0)

def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
Expand Down
49 changes: 24 additions & 25 deletions poll/templates/poll/poll.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,40 @@

{% block poll_script %}
<script type="text/javascript">
var vote_url = '{% url "poll_ajax_vote" poll.pk %}';
var result_url = '{% url "poll_result" poll.pk %}';
// $(document).ready(function() {
document.addEventListener('DOMContentLoaded', function(){
var vote_url = '{% url "poll_ajax_vote" poll.pk %}';
var result_url = '{% url "poll_result" poll.pk %}';
document.addEventListener('DOMContentLoaded', function(){
function showResults() {
$.get(result_url, function(data) {
$("#poll_container").html(data);
});
$.get(result_url, function(data) {
$("#poll_container").html(data);
});
}
$("#poll_send").click(function() {
item = $('#poll_form input[name=item]:checked').val();
if (typeof item === "undefined") {
alert("{% trans "Please, select an answer" %}");
return false;
}
$.get(vote_url, {item: item}, function() {
showResults();
});
return false;
});
});
$("#poll_send").click(function() {
var item = $('#poll_form input[name=item]:checked').val();
if (typeof item === "undefined") {
alert("{% trans 'Please, select an answer' %}");
return false;
}
$.get(vote_url, {item: item}, function() {
showResults();
});
return false;
});
});
</script>
{% endblock %}

{% block poll_content %}
<div class="poll_style">
<form method="get" action="." id="poll_form">
<form method="GET" action="." id="poll_form">
<p class="title">{{ poll.title }}</p>
<ul>
{% for i in items %}
<li><input type="radio" name="item" id="item_{{ i.id }}" value="{{ i.id }}" />
<label for="item_{{ i.id }}">{{ i.value }}</label></li>
<li><input type="radio" name="item" id="item_{{ i.id }}" value="{{ i.id }}" />
<label for="item_{{ i.id }}">{{ i.value }}</label></li>
{% endfor %}
</ul>
<p class="poll_send"><input type="button" id="poll_send" value="{% trans "Vote" %}" /></p>
</ul>
<p class="poll_send"><input type="button" id="poll_send" value="{% trans 'Vote' %}" /></p>
</form>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
author='Dmitry Akinin',
author_email='d.akinin@gmail.com',
url='https://github.com/applecat/django-simple-poll',
download_url='https://github.com/applecat/django-simple-poll/tarball/v0.1.3',
download_url='https://github.com/applecat/django-simple-poll/archive/v0.2.1.tar.gz',
packages=find_packages(),
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit 6b7c29a

Please sign in to comment.