Skip to content

Commit

Permalink
To release product Revert "Added the ability to select between showin…
Browse files Browse the repository at this point in the history
…g percentage or number of votes. gh-4"

This reverts commit b23b320.
  • Loading branch information
ericof committed Jan 10, 2012
1 parent 88a919b commit a88bbac
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 111 deletions.
12 changes: 0 additions & 12 deletions src/collective/polls/content/poll.py
Expand Up @@ -39,10 +39,6 @@
SimpleTerm(value=u'pie', title=_(u'Pie Chart')),
SimpleTerm(value=u'numbers', title=_(u'Numbers Only'))])

format_options = SimpleVocabulary(
[SimpleTerm(value=u'percentage', title=_(u'Percentage')),
SimpleTerm(value=u'numbers', title=_(u'Numbers'))])


class IOption(interface.Interface):
''' An option in a poll '''
Expand Down Expand Up @@ -86,13 +82,6 @@ class IPoll(form.Schema):
required=True,
source=graph_options)

results_format = schema.Choice(
title=_(u'Results Format'),
description=_(u"Format to show the numbers."),
default='numbers',
required=True,
source=format_options)

options = schema.List(
title=_(u"Available options"),
value_type=DictRow(title=_(u'Option'),
Expand Down Expand Up @@ -151,7 +140,6 @@ def getResults(self):
all_results.append((item['description'],
item['votes'],
item['percentage']))

return all_results

def _validateVote(self, options=[]):
Expand Down
10 changes: 1 addition & 9 deletions src/collective/polls/content/poll_templates/view.pt
Expand Up @@ -47,15 +47,7 @@
<ul id="results">
<li tal:repeat="option_result results">
<span class="option_description" tal:content="python: option_result[0]" />:

<span class="option_result"
tal:content="python: option_result[1]"
tal:condition="python:context.results_format!='percentage'"/>

<span class="option_result"
tal:content="python: '%.2f%%'%(option_result[2]*100)"
tal:condition="python:context.results_format=='percentage'"/>

<span class="option_result" tal:content="python: option_result[1]" />
</li>
</ul>
<tal:barchart condition="python:context.results_graph=='bar'">
Expand Down
42 changes: 13 additions & 29 deletions src/collective/polls/locales/collective.polls.pot
Expand Up @@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2012-01-07 23:14+0000\n"
"POT-Creation-Date: 2012-01-07 03:55+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -26,15 +26,15 @@ msgstr ""
msgid "A portlet to allow voting on a specific poll"
msgstr ""

#: collective/polls/content/poll.py:64
#: collective/polls/content/poll.py:60
msgid "Allow anonymous"
msgstr ""

#: collective/polls/content/poll.py:65
#: collective/polls/content/poll.py:61
msgid "Allow not logged in users to vote."
msgstr ""

#: collective/polls/content/poll.py:97
#: collective/polls/content/poll.py:86
msgid "Available options"
msgstr ""

Expand All @@ -46,27 +46,23 @@ msgstr ""
msgid "Bar Chart"
msgstr ""

#: collective/polls/content/poll.py:55
#: collective/polls/content/poll.py:51
msgid "Description"
msgstr ""

#: collective/polls/content/poll.py:91
msgid "Format to show the numbers."
msgstr ""

#: collective/polls/content/poll.py:84
#: collective/polls/content/poll.py:80
msgid "Format to show the results."
msgstr ""

#: collective/polls/content/poll.py:83
#: collective/polls/content/poll.py:79
msgid "Graph"
msgstr ""

#: collective/polls/portlet/voteportlet.py:53
msgid "Header"
msgstr ""

#: collective/polls/content/poll.py:304
#: collective/polls/content/poll.py:292
msgid "Invalid option"
msgstr ""

Expand All @@ -78,26 +74,18 @@ msgstr ""
msgid "Nothing to see here"
msgstr ""

#: collective/polls/content/poll.py:44
msgid "Numbers"
msgstr ""

#: collective/polls/content/poll.py:40
msgid "Numbers Only"
msgstr ""

#: collective/polls/content/poll.py:98
#: collective/polls/content/poll.py:87
msgid "Option"
msgstr ""

#: collective/polls/portlet/voteportlet.pt:21
msgid "Partial results"
msgstr ""

#: collective/polls/content/poll.py:43
msgid "Percentage"
msgstr ""

#: collective/polls/content/poll.py:39
msgid "Pie Chart"
msgstr ""
Expand All @@ -107,23 +95,19 @@ msgstr ""
msgid "Poll"
msgstr ""

#: collective/polls/content/poll.py:90
msgid "Results Format"
msgstr ""

#: collective/polls/content/poll_templates/view.pt:45
msgid "Results:"
msgstr ""

#: collective/polls/content/poll.py:76
#: collective/polls/content/poll.py:72
msgid "Show partial results"
msgstr ""

#: collective/polls/content/poll.py:77
#: collective/polls/content/poll.py:73
msgid "Show partial results after a voter has already voted."
msgstr ""

#: collective/polls/content/poll.py:318
#: collective/polls/content/poll.py:306
msgid "Thanks for your vote"
msgstr ""

Expand All @@ -146,7 +130,7 @@ msgstr ""
msgid "Which poll to show in the portlet."
msgstr ""

#: collective/polls/content/poll.py:323
#: collective/polls/content/poll.py:311
msgid "You are not authorized to vote"
msgstr ""

49 changes: 16 additions & 33 deletions src/collective/polls/locales/es/LC_MESSAGES/collective.polls.po
@@ -1,11 +1,11 @@
# Franco Pellegrini <frapell@gmail.com>, 2011, 2012.
# Franco Pellegrini <frapell@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: collective.polls\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI +ZONE\n"
"PO-Revision-Date: 2012-01-07 20:12-0300\n"
"Last-Translator: Franco Pellegrini\n"
"Language-Team: Spanish <>\n"
"PO-Revision-Date: 2012-01-06 21:56-0600\n"
"Last-Translator: Héctor Velarde <hector.velarde@gmail.com>\n"
"Language-Team: Spanish <https://github.com/collective>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -15,7 +15,6 @@ msgstr ""
"Preferred-Encodings: utf-8 latin1\n"
"Domain: collective.polls\n"
"X-Generator: Lokalize 1.2\n"
"Language: es\n"

#: collective/polls/profiles/default/types/collective.polls.poll.xml
msgid "A poll"
Expand All @@ -26,15 +25,15 @@ msgstr "Una encuesta"
msgid "A portlet to allow voting on a specific poll"
msgstr "Un portlet que permite votar en una encuesta específica"

#: collective/polls/content/poll.py:64
#: collective/polls/content/poll.py:60
msgid "Allow anonymous"
msgstr "Permitir anónimos"

#: collective/polls/content/poll.py:65
#: collective/polls/content/poll.py:61
msgid "Allow not logged in users to vote."
msgstr "Permitir a usuarios que no han iniciado sesión, votar."

#: collective/polls/content/poll.py:97
#: collective/polls/content/poll.py:86
msgid "Available options"
msgstr "Opciones disponibles"

Expand All @@ -46,27 +45,23 @@ msgstr "Opciones disponibles:"
msgid "Bar Chart"
msgstr "Gráfico de barras"

#: collective/polls/content/poll.py:55
#: collective/polls/content/poll.py:51
msgid "Description"
msgstr "Descripción"

#: collective/polls/content/poll.py:91
msgid "Format to show the numbers."
msgstr "Formato para mostrar los numeros."

#: collective/polls/content/poll.py:84
#: collective/polls/content/poll.py:80
msgid "Format to show the results."
msgstr "Formato en el que se mostrarán los resultados."

#: collective/polls/content/poll.py:83
#: collective/polls/content/poll.py:79
msgid "Graph"
msgstr "Gráfico"

#: collective/polls/portlet/voteportlet.py:53
msgid "Header"
msgstr "Cabecera"

#: collective/polls/content/poll.py:304
#: collective/polls/content/poll.py:292
msgid "Invalid option"
msgstr "Opción inválida"

Expand All @@ -78,26 +73,18 @@ msgstr "La encuesta abierta más reciente"
msgid "Nothing to see here"
msgstr "No hay nada aquí que pueda ver"

#: collective/polls/content/poll.py:44
msgid "Numbers"
msgstr "Números"

#: collective/polls/content/poll.py:40
msgid "Numbers Only"
msgstr "Sólo números"

#: collective/polls/content/poll.py:98
#: collective/polls/content/poll.py:87
msgid "Option"
msgstr "Opción"

#: collective/polls/portlet/voteportlet.pt:21
msgid "Partial results"
msgstr "Resultados parciales"

#: collective/polls/content/poll.py:43
msgid "Percentage"
msgstr "Porcentaje"

#: collective/polls/content/poll.py:39
msgid "Pie Chart"
msgstr "Gráfico de tarta"
Expand All @@ -107,23 +94,19 @@ msgstr "Gráfico de tarta"
msgid "Poll"
msgstr "Encuesta"

#: collective/polls/content/poll.py:90
msgid "Results Format"
msgstr "Formato de Resultados"

#: collective/polls/content/poll_templates/view.pt:45
msgid "Results:"
msgstr "Resultados:"

#: collective/polls/content/poll.py:76
#: collective/polls/content/poll.py:72
msgid "Show partial results"
msgstr "Mostrar resultados parciales"

#: collective/polls/content/poll.py:77
#: collective/polls/content/poll.py:73
msgid "Show partial results after a voter has already voted."
msgstr "Mostrar resultados parciales luego de que el votante ya haya votado."

#: collective/polls/content/poll.py:318
#: collective/polls/content/poll.py:306
msgid "Thanks for your vote"
msgstr "Gracias por su voto"

Expand All @@ -141,7 +124,7 @@ msgstr "Portlet de votación"
msgid "Which poll to show in the portlet."
msgstr "Qué encuesta mostrar en el portlet."

#: collective/polls/content/poll.py:323
#: collective/polls/content/poll.py:311
msgid "You are not authorized to vote"
msgstr "Usted no está autorizado para votar"

0 comments on commit a88bbac

Please sign in to comment.