From 082ded5ae1c4b999c29e1f68d484ec1effbaa057 Mon Sep 17 00:00:00 2001 From: Ana Date: Mon, 18 Apr 2016 15:55:44 +0200 Subject: deplacement des templates dans polls/templates/polls/ --- papillon/polls/templates/polls/500.html | 6 + papillon/polls/templates/polls/category.html | 16 ++ papillon/polls/templates/polls/create.html | 39 ++++ papillon/polls/templates/polls/edit.html | 66 +++++++ papillon/polls/templates/polls/editChoices.html | 19 ++ .../polls/templates/polls/editChoicesAdmin.html | 59 ++++++ .../polls/templates/polls/editChoicesUser.html | 31 +++ .../templates/polls/feeds/poll_description.html | 8 + papillon/polls/templates/polls/main.html | 23 +++ papillon/polls/templates/polls/vote.html | 214 +++++++++++++++++++++ papillon/templates/500.html | 6 - papillon/templates/category.html | 16 -- papillon/templates/create.html | 39 ---- papillon/templates/edit.html | 66 ------- papillon/templates/editChoices.html | 19 -- papillon/templates/editChoicesAdmin.html | 59 ------ papillon/templates/editChoicesUser.html | 31 --- papillon/templates/main.html | 23 --- papillon/templates/vote.html | 214 --------------------- 19 files changed, 481 insertions(+), 473 deletions(-) create mode 100644 papillon/polls/templates/polls/500.html create mode 100644 papillon/polls/templates/polls/category.html create mode 100644 papillon/polls/templates/polls/create.html create mode 100644 papillon/polls/templates/polls/edit.html create mode 100644 papillon/polls/templates/polls/editChoices.html create mode 100644 papillon/polls/templates/polls/editChoicesAdmin.html create mode 100644 papillon/polls/templates/polls/editChoicesUser.html create mode 100644 papillon/polls/templates/polls/feeds/poll_description.html create mode 100644 papillon/polls/templates/polls/main.html create mode 100644 papillon/polls/templates/polls/vote.html delete mode 100644 papillon/templates/500.html delete mode 100644 papillon/templates/category.html delete mode 100644 papillon/templates/create.html delete mode 100644 papillon/templates/edit.html delete mode 100644 papillon/templates/editChoices.html delete mode 100644 papillon/templates/editChoicesAdmin.html delete mode 100644 papillon/templates/editChoicesUser.html delete mode 100644 papillon/templates/main.html delete mode 100644 papillon/templates/vote.html diff --git a/papillon/polls/templates/polls/500.html b/papillon/polls/templates/polls/500.html new file mode 100644 index 0000000..8196c56 --- /dev/null +++ b/papillon/polls/templates/polls/500.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} +

{% trans "An error has occurred. A system administrator has been informed and will probably fix it soon." %}

+{% endblock %} diff --git a/papillon/polls/templates/polls/category.html b/papillon/polls/templates/polls/category.html new file mode 100644 index 0000000..8df695c --- /dev/null +++ b/papillon/polls/templates/polls/category.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} +

{{category.name}}

+

{{category.description}}

+ +{% if polls %}

{%trans "Polls"%}

{%endif%} +{% for poll in polls %} +
+

{{poll.name}}

+

{{poll.description|safe}}

+
+{% endfor %} + +{% endblock %} diff --git a/papillon/polls/templates/polls/create.html b/papillon/polls/templates/polls/create.html new file mode 100644 index 0000000..163ad17 --- /dev/null +++ b/papillon/polls/templates/polls/create.html @@ -0,0 +1,39 @@ +{% extends "base.html" %} +{% load i18n %} +{% load markup %} + +{% block fullscript %} + {{ form.media }} +{% endblock %} + + +{% block content %} +

{% trans "New poll" %}

+ +
+ {% csrf_token %} + {% for field in form %} + {% if field.is_hidden %} + {{field}} + {% else %} +
+ {{field.label_tag}} + ? +
+
+ {% if field.errors %} + Error(s) : +
    + {% for error in field.errors %} +
  1. {{ error|escape }}
  2. + {% endfor %} +
+ {% endif %} +
+ {{field}} + {% endif %} + {% endfor %} + +
+ +{% endblock %} diff --git a/papillon/polls/templates/polls/edit.html b/papillon/polls/templates/polls/edit.html new file mode 100644 index 0000000..2dcdc73 --- /dev/null +++ b/papillon/polls/templates/polls/edit.html @@ -0,0 +1,66 @@ +{% extends "base.html" %} +{% load markup %} +{% load i18n %} + +{% block fullscript %} + + + +{{ form.media }} +{% endblock %} + +{% block content %} +

{% trans "Edit poll" %}

+
+ {% csrf_token %} + +
+ + ? +
+ + {% trans "Go to the poll!" %} + +
+ + ? +
+ + +
+ + ? +
+ + {% trans "Edit choices" %} + + {% for field in form %} + {% if field.is_hidden %} + {{field}} + {% else %} + +
+ {{field.label_tag}} + ? +
+
+ {% if field.errors %} + Error(s) : +
    + {% for error in field.errors %} +
  1. {{ error|escape }}
  2. + {% endfor %} +
+ {% endif %} +
+ {{field}} + {% endif %} + {% endfor %} + + + + + +
+ +{% endblock %} diff --git a/papillon/polls/templates/polls/editChoices.html b/papillon/polls/templates/polls/editChoices.html new file mode 100644 index 0000000..9146e27 --- /dev/null +++ b/papillon/polls/templates/polls/editChoices.html @@ -0,0 +1,19 @@ +{% load markup %} +{% load i18n %} + +{%if form_new_choice.errors %}

{{form_new_choice.errors}}

{%endif%} +
+ {% csrf_token %} +
+ {% trans "Add new choice" %} ? +
+ {{form_new_choice.poll}} + {{form_new_choice.order}} + + {%trans "Choice value:"%}
+ {{form_new_choice.name}} + {%trans "Max number of votes (optional):"%}
+ {{form_new_choice.limit}}
+ + +
diff --git a/papillon/polls/templates/polls/editChoicesAdmin.html b/papillon/polls/templates/polls/editChoicesAdmin.html new file mode 100644 index 0000000..7981498 --- /dev/null +++ b/papillon/polls/templates/polls/editChoicesAdmin.html @@ -0,0 +1,59 @@ +{% extends "base.html" %} +{% load markup %} +{% load i18n %} + +{% block fullscript %} + + + +{{ form_new_choice.media }} +{% endblock %} + +{% block content %} +{% if not choices %} +

+ {% blocktrans %}As long as no options were added to the poll, it will not be available.{% endblocktrans %} +

+{% else %} +

{% trans "Choice administration" %}

+

{% trans "After you've finished to add or edit choices for this poll, click on:" %}

+{% endif %} + +{% include 'editChoices.html' %} + +{% if choices %} +
+
{% trans "Edit available choices" %}
+
+ + + {%if not poll.dated_choices%}{%endif%} + + + + + {% for choice in choices %} + + {% csrf_token %} + {{choice.form.poll}}{{choice.form.order}} + {%if not poll.dated_choices%} + + {%endif%} + + + + + + + {% endfor %} +
{% trans "Position" %}{% trans "Value" %}{% trans "Max votes" %}{% trans "Delete?"%} ?
+ +
+ +
{{choice.form.name}}{{choice.form.limit}}
+
+
+
+{% endif %} + +{% endblock %} diff --git a/papillon/polls/templates/polls/editChoicesUser.html b/papillon/polls/templates/polls/editChoicesUser.html new file mode 100644 index 0000000..958d05a --- /dev/null +++ b/papillon/polls/templates/polls/editChoicesUser.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} +{% load markup %} +{% load i18n %} + +{% block fullscript %} + + + +{{ form_new_choice.media }} +{% endblock %} + +{% block content %} +

{%trans "Return to the poll"%}

+

{% trans "Choices" %}

+{% if choices %} +
+
{% trans "Current choices" %}
+ + + + + + {% for choice in choices %} + + + {% endfor %} +
{% trans "Name" %}{% trans "Limit" %}
{%if poll.dated_choices%}{{choice.date|date:_("DATETIME_FORMAT")}}{%else%}{{choice.name}}{%endif%}{% if choice.limit %}{% trans "Limited to"%} {{choice.limit}} {% trans "vote(s)" %}{% endif %}
+
+{% endif %} +{% include 'editChoices.html' %} +{% endblock %} diff --git a/papillon/polls/templates/polls/feeds/poll_description.html b/papillon/polls/templates/polls/feeds/poll_description.html new file mode 100644 index 0000000..7522a5a --- /dev/null +++ b/papillon/polls/templates/polls/feeds/poll_description.html @@ -0,0 +1,8 @@ +{% load i18n %} +

{% blocktrans with obj.user.name as voter_name %}{{ voter_name }} has added/modified a vote.{%endblocktrans%}

+

{% trans "Current results:" %}

+ \ No newline at end of file diff --git a/papillon/polls/templates/polls/main.html b/papillon/polls/templates/polls/main.html new file mode 100644 index 0000000..9a3adfb --- /dev/null +++ b/papillon/polls/templates/polls/main.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} +{% if error %}

{{error}}

{%endif%} +

{%trans "Create a poll"%}

+

{% trans "Create a new sondage for take a decision, find a date for a meeting, etc." %} {% trans "It's here!" %}

+ +{% if public %} +{% if polls %}

{%trans "Public polls"%}

{%endif%} +{% for poll in polls %} +
+

{{poll.name}}

+

{{poll.description|safe}}

+
+{% endfor %} + +{% if categories %}

{%trans "Categories"%}

{% endif %} +{% for category in categories %} +

{{category.name}}

+{% endfor %} +{% endif %} +{% endblock %} diff --git a/papillon/polls/templates/polls/vote.html b/papillon/polls/templates/polls/vote.html new file mode 100644 index 0000000..4ab70fe --- /dev/null +++ b/papillon/polls/templates/polls/vote.html @@ -0,0 +1,214 @@ +{% extends "base.html" %} +{% load i18n %} +{% load get_range %} + +{% block fullscript %} + + + +{{ form_comment.media }} +{% endblock %} + +{% block content %} +

{%if poll.category %}{{poll.category.name}} - {%endif%}{{poll.name}}

+ {% if error %}

{{ error }}

{% endif %} + {% if not poll.open %}

{% trans "The current poll is closed."%}

{% endif %} + +

{% trans "Description" %}

+

{{ poll.description|safe }}

+ +

{% trans "Participation" %}

+
+ {% csrf_token %} +
+ + + + + {% for choice in choices %} + + {% endfor %} + + + {% if not hide_vote %} + {% for voter in voters %} + + {% ifequal current_voter_id voter.id %} + + + + {% for vote in voter.votes %} + + {%endfor%} + {%else%} + + + {% for vote in voter.votes %} + {% ifequal poll.type 'V' %} + + {% else %} + + {% endifequal %} + {%endfor%} + {%endifequal%} + + {%endfor%} + {%endif%} + + + {%if not current_voter_id%} + {% if poll.open %} + + + + {%for choice in choices%} + + {%endfor%} + + {%endif%} + {%endif%} + + + {% if not hide_vote %} + + + + {% for choice in choices %} + {{choice.getSum}} + {% endfor %} + + {%endif%} + + + {% if poll.open %} + + + + + {% endif %} +
+ {%if poll.dated_choices%} + {{choice.date|date:"D d M Y H:i"}} + {%else%} + {{choice.name}} + {%endif%} + {% if choice.limit %} + ({% trans "max" %} {{choice.limit}}) + {%endif%} +
+ {% if vote.choice.available or vote.value %} + {% ifequal poll.type 'P' %} + + {% endifequal %} + {% ifequal poll.type 'O' %} + + {% endifequal %} + {% ifequal poll.type 'B' %} + + {% endifequal %} + {% ifequal poll.type 'V' %} + + {% endifequal %} + {% else %} + {% trans "Limit reached" %} + {% endif %} + {% if poll.open %}{% trans "Edit" %}{%else%} {%endif%}{{voter.user.name}} + {%if vote.value%}{{vote.value}}{%else%}0{%endif%} + + {%ifequal poll.type 'B'%} + {%for VOT in VOTE%} + {%ifequal VOT.0 vote.value%} + {{VOT.1.1}} + {%endifequal%} + {%endfor%} + {%else%} + {%for VOT in VOTE%} + {%ifequal VOT.0 vote.value%} + {{VOT.1.0}} + {%endifequal%} + {%endfor%} + {%endifequal%} +
+ {% if choice.available %} + {% ifequal poll.type 'P' %} + + {% endifequal %} + {% ifequal poll.type 'O' %} + + {% endifequal %} + {% ifequal poll.type 'B' %} + + {% endifequal %} + {% ifequal poll.type 'V' %} + + {% endifequal %} + {% else %} + {% trans "Limit reached" %} + {% endif %} +
{% trans "Sum" %}
+ +
+
+
+
+ + {%if poll.opened_admin%} +

{%trans "Add a new choice to this poll?"%}

+ {%endif%} + +
+ {%if hide_vote%} +

+ {% trans "You have already vote? You are enough wise not to be influenced by other votes? You can display result by clicking" %} + {% trans "here" %}. +

+ {%else%} +

+ {% trans "Remain informed of poll evolution:" %} + {%trans "RSS syndication"%} +

+ {%endif%} +
+ + {%if not hide_vote and max_comment_nb %} +

{%trans "Comments"%} ({% blocktrans %}{{max_comment_nb}} max{% endblocktrans %})

+ + {%if poll.open and max_comment_nb > poll.comments.count %} +
+
{% trans "Add a comment"%}
+
+ +
+ +
+ +
+ + +
+ {%endif%} + {%endif%} +{% endblock %} diff --git a/papillon/templates/500.html b/papillon/templates/500.html deleted file mode 100644 index 8196c56..0000000 --- a/papillon/templates/500.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -

{% trans "An error has occurred. A system administrator has been informed and will probably fix it soon." %}

-{% endblock %} diff --git a/papillon/templates/category.html b/papillon/templates/category.html deleted file mode 100644 index 8df695c..0000000 --- a/papillon/templates/category.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -

{{category.name}}

-

{{category.description}}

- -{% if polls %}

{%trans "Polls"%}

{%endif%} -{% for poll in polls %} -
-

{{poll.name}}

-

{{poll.description|safe}}

-
-{% endfor %} - -{% endblock %} diff --git a/papillon/templates/create.html b/papillon/templates/create.html deleted file mode 100644 index 163ad17..0000000 --- a/papillon/templates/create.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load markup %} - -{% block fullscript %} - {{ form.media }} -{% endblock %} - - -{% block content %} -

{% trans "New poll" %}

- -
- {% csrf_token %} - {% for field in form %} - {% if field.is_hidden %} - {{field}} - {% else %} -
- {{field.label_tag}} - ? -
-
- {% if field.errors %} - Error(s) : -
    - {% for error in field.errors %} -
  1. {{ error|escape }}
  2. - {% endfor %} -
- {% endif %} -
- {{field}} - {% endif %} - {% endfor %} - -
- -{% endblock %} diff --git a/papillon/templates/edit.html b/papillon/templates/edit.html deleted file mode 100644 index 2dcdc73..0000000 --- a/papillon/templates/edit.html +++ /dev/null @@ -1,66 +0,0 @@ -{% extends "base.html" %} -{% load markup %} -{% load i18n %} - -{% block fullscript %} - - - -{{ form.media }} -{% endblock %} - -{% block content %} -

{% trans "Edit poll" %}

-
- {% csrf_token %} - -
- - ? -
- - {% trans "Go to the poll!" %} - -
- - ? -
- - -
- - ? -
- - {% trans "Edit choices" %} - - {% for field in form %} - {% if field.is_hidden %} - {{field}} - {% else %} - -
- {{field.label_tag}} - ? -
-
- {% if field.errors %} - Error(s) : -
    - {% for error in field.errors %} -
  1. {{ error|escape }}
  2. - {% endfor %} -
- {% endif %} -
- {{field}} - {% endif %} - {% endfor %} - - - - - -
- -{% endblock %} diff --git a/papillon/templates/editChoices.html b/papillon/templates/editChoices.html deleted file mode 100644 index 9146e27..0000000 --- a/papillon/templates/editChoices.html +++ /dev/null @@ -1,19 +0,0 @@ -{% load markup %} -{% load i18n %} - -{%if form_new_choice.errors %}

{{form_new_choice.errors}}

{%endif%} -
- {% csrf_token %} -
- {% trans "Add new choice" %} ? -
- {{form_new_choice.poll}} - {{form_new_choice.order}} - - {%trans "Choice value:"%}
- {{form_new_choice.name}} - {%trans "Max number of votes (optional):"%}
- {{form_new_choice.limit}}
- - -
diff --git a/papillon/templates/editChoicesAdmin.html b/papillon/templates/editChoicesAdmin.html deleted file mode 100644 index 7981498..0000000 --- a/papillon/templates/editChoicesAdmin.html +++ /dev/null @@ -1,59 +0,0 @@ -{% extends "base.html" %} -{% load markup %} -{% load i18n %} - -{% block fullscript %} - - - -{{ form_new_choice.media }} -{% endblock %} - -{% block content %} -{% if not choices %} -

- {% blocktrans %}As long as no options were added to the poll, it will not be available.{% endblocktrans %} -

-{% else %} -

{% trans "Choice administration" %}

-

{% trans "After you've finished to add or edit choices for this poll, click on:" %}

-{% endif %} - -{% include 'editChoices.html' %} - -{% if choices %} -
-
{% trans "Edit available choices" %}
-
- - - {%if not poll.dated_choices%}{%endif%} - - - - - {% for choice in choices %} - - {% csrf_token %} - {{choice.form.poll}}{{choice.form.order}} - {%if not poll.dated_choices%} - - {%endif%} - - - - - - - {% endfor %} -
{% trans "Position" %}{% trans "Value" %}{% trans "Max votes" %}{% trans "Delete?"%} ?
- -
- -
{{choice.form.name}}{{choice.form.limit}}
-
-
-
-{% endif %} - -{% endblock %} diff --git a/papillon/templates/editChoicesUser.html b/papillon/templates/editChoicesUser.html deleted file mode 100644 index 958d05a..0000000 --- a/papillon/templates/editChoicesUser.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "base.html" %} -{% load markup %} -{% load i18n %} - -{% block fullscript %} - - - -{{ form_new_choice.media }} -{% endblock %} - -{% block content %} -

{%trans "Return to the poll"%}

-

{% trans "Choices" %}

-{% if choices %} -
-
{% trans "Current choices" %}
- - - - - - {% for choice in choices %} - - - {% endfor %} -
{% trans "Name" %}{% trans "Limit" %}
{%if poll.dated_choices%}{{choice.date|date:_("DATETIME_FORMAT")}}{%else%}{{choice.name}}{%endif%}{% if choice.limit %}{% trans "Limited to"%} {{choice.limit}} {% trans "vote(s)" %}{% endif %}
-
-{% endif %} -{% include 'editChoices.html' %} -{% endblock %} diff --git a/papillon/templates/main.html b/papillon/templates/main.html deleted file mode 100644 index 9a3adfb..0000000 --- a/papillon/templates/main.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -{% if error %}

{{error}}

{%endif%} -

{%trans "Create a poll"%}

-

{% trans "Create a new sondage for take a decision, find a date for a meeting, etc." %} {% trans "It's here!" %}

- -{% if public %} -{% if polls %}

{%trans "Public polls"%}

{%endif%} -{% for poll in polls %} -
-

{{poll.name}}

-

{{poll.description|safe}}

-
-{% endfor %} - -{% if categories %}

{%trans "Categories"%}

{% endif %} -{% for category in categories %} -

{{category.name}}

-{% endfor %} -{% endif %} -{% endblock %} diff --git a/papillon/templates/vote.html b/papillon/templates/vote.html deleted file mode 100644 index 4ab70fe..0000000 --- a/papillon/templates/vote.html +++ /dev/null @@ -1,214 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% load get_range %} - -{% block fullscript %} - - - -{{ form_comment.media }} -{% endblock %} - -{% block content %} -

{%if poll.category %}{{poll.category.name}} - {%endif%}{{poll.name}}

- {% if error %}

{{ error }}

{% endif %} - {% if not poll.open %}

{% trans "The current poll is closed."%}

{% endif %} - -

{% trans "Description" %}

-

{{ poll.description|safe }}

- -

{% trans "Participation" %}

-
- {% csrf_token %} -
- - - - - {% for choice in choices %} - - {% endfor %} - - - {% if not hide_vote %} - {% for voter in voters %} - - {% ifequal current_voter_id voter.id %} - - - - {% for vote in voter.votes %} - - {%endfor%} - {%else%} - - - {% for vote in voter.votes %} - {% ifequal poll.type 'V' %} - - {% else %} - - {% endifequal %} - {%endfor%} - {%endifequal%} - - {%endfor%} - {%endif%} - - - {%if not current_voter_id%} - {% if poll.open %} - - - - {%for choice in choices%} - - {%endfor%} - - {%endif%} - {%endif%} - - - {% if not hide_vote %} - - - - {% for choice in choices %} - {{choice.getSum}} - {% endfor %} - - {%endif%} - - - {% if poll.open %} - - - - - {% endif %} -
- {%if poll.dated_choices%} - {{choice.date|date:"D d M Y H:i"}} - {%else%} - {{choice.name}} - {%endif%} - {% if choice.limit %} - ({% trans "max" %} {{choice.limit}}) - {%endif%} -
- {% if vote.choice.available or vote.value %} - {% ifequal poll.type 'P' %} - - {% endifequal %} - {% ifequal poll.type 'O' %} - - {% endifequal %} - {% ifequal poll.type 'B' %} - - {% endifequal %} - {% ifequal poll.type 'V' %} - - {% endifequal %} - {% else %} - {% trans "Limit reached" %} - {% endif %} - {% if poll.open %}{% trans "Edit" %}{%else%} {%endif%}{{voter.user.name}} - {%if vote.value%}{{vote.value}}{%else%}0{%endif%} - - {%ifequal poll.type 'B'%} - {%for VOT in VOTE%} - {%ifequal VOT.0 vote.value%} - {{VOT.1.1}} - {%endifequal%} - {%endfor%} - {%else%} - {%for VOT in VOTE%} - {%ifequal VOT.0 vote.value%} - {{VOT.1.0}} - {%endifequal%} - {%endfor%} - {%endifequal%} -
- {% if choice.available %} - {% ifequal poll.type 'P' %} - - {% endifequal %} - {% ifequal poll.type 'O' %} - - {% endifequal %} - {% ifequal poll.type 'B' %} - - {% endifequal %} - {% ifequal poll.type 'V' %} - - {% endifequal %} - {% else %} - {% trans "Limit reached" %} - {% endif %} -
{% trans "Sum" %}
- -
-
-
-
- - {%if poll.opened_admin%} -

{%trans "Add a new choice to this poll?"%}

- {%endif%} - -
- {%if hide_vote%} -

- {% trans "You have already vote? You are enough wise not to be influenced by other votes? You can display result by clicking" %} - {% trans "here" %}. -

- {%else%} -

- {% trans "Remain informed of poll evolution:" %} - {%trans "RSS syndication"%} -

- {%endif%} -
- - {%if not hide_vote and max_comment_nb %} -

{%trans "Comments"%} ({% blocktrans %}{{max_comment_nb}} max{% endblocktrans %})

- - {%if poll.open and max_comment_nb > poll.comments.count %} -
-
{% trans "Add a comment"%}
-
- -
- -
- -
- - -
- {%endif%} - {%endif%} -{% endblock %} -- cgit v1.2.3