From 852d50136ca934a314712983f16ee1abeac6a19b Mon Sep 17 00:00:00 2001 From: etienne Date: Mon, 28 Dec 2009 18:44:20 +0000 Subject: Simplification of base url management --- polls/views.py | 4 +--- templates/base.html | 4 ++-- templates/category.html | 2 +- templates/edit.html | 12 ++++++------ templates/editChoicesAdmin.html | 8 ++++---- templates/editChoicesUser.html | 8 ++++---- templates/vote.html | 10 +++++----- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/polls/views.py b/polls/views.py index 386792f..f6bc0c2 100644 --- a/polls/views.py +++ b/polls/views.py @@ -40,9 +40,7 @@ def getBaseResponse(request): """Manage basic fields for the template If not null the second argument returned is a redirection. """ - #Get the root url in order to redirect to the main page - url = "/".join([request.META['HTTP_HOST'], - request.path.split('/')[1], '']) + url = BASE_SITE # setting the current language and available languages if 'language' in request.GET: if request.GET['language'] in [language[0] for language in LANGUAGES]: diff --git a/templates/base.html b/templates/base.html index b66a341..abedf4a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - + {% block title %}Papillon{% endblock %} {% block fullscript %}{% endblock %} @@ -13,7 +13,7 @@ {% for language in languages%}{{language.1}}{% endfor %}
-

Papillon

+

Papillon

{% block content %}{% endblock %} diff --git a/templates/category.html b/templates/category.html index 7b26d48..0908851 100644 --- a/templates/category.html +++ b/templates/category.html @@ -8,7 +8,7 @@ {% if polls %}

{%trans "Polls"%}

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

{{poll.name}}

+

{{poll.name}}

{{poll.description}}

{% endfor %} diff --git a/templates/edit.html b/templates/edit.html index f24395f..7ef4f14 100644 --- a/templates/edit.html +++ b/templates/edit.html @@ -3,9 +3,9 @@ {% load i18n %} {% block fullscript %} - - - + + + {{ form.media }} {% endblock %} @@ -16,7 +16,7 @@ -http://{{root_url}}poll/{{poll.base_url}} +{{root_url}}poll/{{poll.base_url}}

{% trans "Copy this address and send it to voters who want to participate to this poll" %} @@ -25,7 +25,7 @@ -http://{{root_url}}edit/{{poll.admin_url}} +{{root_url}}edit/{{poll.admin_url}}

{% trans "Address to modify the current poll" %} @@ -34,7 +34,7 @@ -http://{{root_url}}editChoicesAdmin/{{poll.admin_url}} +{{root_url}}editChoicesAdmin/{{poll.admin_url}}

{% trans "Address to modify choices of the current poll." %} diff --git a/templates/editChoicesAdmin.html b/templates/editChoicesAdmin.html index 260d68c..a7798bf 100644 --- a/templates/editChoicesAdmin.html +++ b/templates/editChoicesAdmin.html @@ -3,9 +3,9 @@ {% load i18n %} {% block fullscript %} - - - + + + {{ form_new_choice.media }} {% endblock %} @@ -14,7 +14,7 @@ {% blocktrans %}As long as no options were added to the poll, it will not be available.{% endblocktrans %}

{% else %}

{% trans "Complete/Finalise the poll" %}

-

+

{% endif %} {% include 'editChoices.html' %} {% if choices %} diff --git a/templates/editChoicesUser.html b/templates/editChoicesUser.html index 4313ade..0d2b2c1 100644 --- a/templates/editChoicesUser.html +++ b/templates/editChoicesUser.html @@ -3,14 +3,14 @@ {% load i18n %} {% block fullscript %} - - - + + + {{ form_new_choice.media }} {% endblock %} {% block content %} -

{%trans "Return to the poll"%}

+

{%trans "Return to the poll"%}

{% trans "Choices" %}

{% if choices %} diff --git a/templates/vote.html b/templates/vote.html index 31ba7b0..eb1ae21 100644 --- a/templates/vote.html +++ b/templates/vote.html @@ -3,9 +3,9 @@ {% load get_range %} {% block fullscript %} - - - + + + {{ form_comment.media }} {% endblock %} @@ -119,10 +119,10 @@
{%if poll.opened_admin%} -

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

{%endif%} +

{%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 "syndication"%}

{%endif%} +

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

{%endif%}
{%if not hide_vote%}

{%trans "Comments"%}

-- cgit v1.2.3