├── wagtailpolls ├── migrations │ ├── __init__.py │ ├── 0002_auto_20161025_1513.py │ ├── 0003_auto_20170511_1620.py │ └── 0001_initial.py ├── templatetags │ ├── __init__.py │ └── wagtailpolls_tags.py ├── views │ ├── __init__.py │ ├── results.py │ ├── vote.py │ ├── editor.py │ └── chooser.py ├── __init__.py ├── templates │ ├── wagtailpolls │ │ ├── vote_success.html │ │ ├── chosen.js │ │ ├── list.html │ │ ├── search_results.html │ │ ├── delete.html │ │ ├── copy.html │ │ ├── choose.html │ │ ├── results.html │ │ ├── edit.html │ │ ├── create.html │ │ ├── search.html │ │ ├── poll_results.html │ │ ├── choose.js │ │ ├── index.html │ │ └── poll_list.html │ └── widgets │ │ └── poll_chooser.html ├── locale │ └── fr │ │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── pagination.py ├── wagtail_hooks.py ├── static │ └── js │ │ └── poll_chooser.js ├── urls.py ├── edit_handlers.py ├── widgets.py ├── forms.py └── models.py ├── .gitignore ├── setup.cfg ├── CONTRIBUTORS ├── MANIFEST.in ├── setup.py ├── LICENSE └── README.rst /wagtailpolls/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /wagtailpolls/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /wagtailpolls/views/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.egg-info 3 | dist/ 4 | -------------------------------------------------------------------------------- /wagtailpolls/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.3.0' 2 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.rst 3 | -------------------------------------------------------------------------------- /wagtailpolls/templates/wagtailpolls/vote_success.html: -------------------------------------------------------------------------------- 1 |
| {% trans "Title" %} | 9 |
|---|
15 | {% if choosing %}
16 | {{ snippet }}17 | {% else %} 18 |{{ snippet }}19 | {% endif %} 20 | |
21 |
{% blocktrans %}Sorry, no polls match "{{ query_string }}"{% endblocktrans %}
19 | {% else %} 20 | {% url 'wagtailpolls_create' as wagtailpolls_create_url %} 21 | 22 | {% endif %} 23 | {% endif %} 24 | -------------------------------------------------------------------------------- /wagtailpolls/static/js/poll_chooser.js: -------------------------------------------------------------------------------- 1 | function createPollChooser(id) { 2 | console.log('got here'); 3 | var chooserElement = $('#' + id + '-chooser'); 4 | var docTitle = chooserElement.find('.title'); 5 | var input = $('#' + id); 6 | var editLink = chooserElement.find('.edit-link'); 7 | console.log(editLink); 8 | var pollChooser = "/admin/polls/choose/"; 9 | 10 | $('.action-choose', chooserElement).click(function() { 11 | console.log('whoop'); 12 | ModalWorkflow({ 13 | url: pollChooser, 14 | responses: { 15 | pollChosen: function(pollData) { 16 | input.val(pollData.id); 17 | docTitle.text(pollData.string); 18 | chooserElement.removeClass('blank'); 19 | editLink.attr('href', pollData.edit_link); 20 | } 21 | } 22 | }); 23 | }); 24 | 25 | $('.action-clear', chooserElement).click(function() { 26 | input.val(''); 27 | chooserElement.addClass('blank'); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /wagtailpolls/templates/wagtailpolls/delete.html: -------------------------------------------------------------------------------- 1 | {% extends "wagtailadmin/base.html" %} 2 | {% load i18n %} 3 | {% block titletag %}{% trans "Polls" %}{% endblock %} 4 | {% block bodyclass %}menu-poll{% endblock %} 5 | {% block content %} 6 | 7 | {% trans "Delete" as new_str %} 8 | {% include "wagtailadmin/shared/header.html" with title=new_str subtitle=poll icon="grip" %} 9 | 10 || {% trans "Title" %} | 10 |
|---|
16 | {% if choosing %}
17 | {{ snippet }}18 | {% else %} 19 |{{ snippet }}20 | {% endif %} 21 | |
22 |
| {% blocktrans %}Question{% endblocktrans %} | 23 |{% blocktrans %}Votes{% endblocktrans %} | 24 |
|---|---|
30 | {{question}}31 | |
32 | {{question.votes.all.count}} | 33 |
| {% blocktrans %}Name{% endblocktrans %} | 7 |{% blocktrans %}Date created{% endblocktrans %} | 8 |9 | |
|---|---|---|
14 | 15 | 16 | {{poll}} 17 | 18 |19 |
|
25 |
26 | {% if poll.date_created %}
27 |
28 | {% blocktrans with when=poll.date_created|timesince %}{{ when }} ago{% endblocktrans %}
29 |
30 | {% endif %}
31 | |
32 | 33 | {% blocktrans %}Results{% endblocktrans %} 34 | | 35 |
{% blocktrans with number=page.number total=paginator.num_pages %}Page {{ number }} of {{ total }}{% endblocktrans %}
41 |