# HG changeset patch # User grandjoncl # Date 1354547573 -3600 # Node ID a6d47caa7fc0587966c7b3e5ab520e663a25e073 # Parent 78ed70bc6bfe57582c8360bb3ddd20f0e9597e93 creation of a function in order to avoid using settings.WEB_URL + reverse in the views. Function to get the web_url using site domain replacement in the templates of WEB_URL + templatetag url by the templatetag absurl diff -r 78ed70bc6bfe -r a6d47caa7fc0 src/ldt/ldt/ldt_utils/models.py --- a/src/ldt/ldt/ldt_utils/models.py Mon Dec 03 11:53:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/models.py Mon Dec 03 16:12:53 2012 +0100 @@ -14,6 +14,7 @@ from utils import (create_ldt, copy_ldt, create_empty_iri, update_iri, generate_uuid) from ldt.utils import generate_hash +from ldt.utils.url import get_web_url import datetime import lxml.etree #@UnresolvedImport import mimetypes @@ -300,7 +301,7 @@ def __unicode__(self): return str(self.id) + ":" + self.iri_id + ":" + self.title.replace("\n", " ") - def iri_url(self, web_url=settings.WEB_URL): + def iri_url(self, web_url=get_web_url()): if url_utils.is_absolute(self.iriurl): return self.iriurl else: diff -r 78ed70bc6bfe -r a6d47caa7fc0 src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/reindex_form.html --- a/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/reindex_form.html Mon Dec 03 11:53:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/reindex_form.html Mon Dec 03 16:12:53 2012 +0100 @@ -1,5 +1,6 @@ {% extends "admin/ldt_utils/app_action.html" %} {% load i18n %} +{% load absurl %} {# reindex contents #} {% block content %} {% if message %} @@ -11,13 +12,13 @@ {% endif %}
{% csrf_token %} + action="{% absurl admin:ldt_content_reindex %}">{% csrf_token %} {{ form.as_table }}
-Back to administration page +Back to administration page {% endblock %} diff -r 78ed70bc6bfe -r a6d47caa7fc0 src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/stats_form.html --- a/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/stats_form.html Mon Dec 03 11:53:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/stats_form.html Mon Dec 03 16:12:53 2012 +0100 @@ -1,5 +1,6 @@ {% extends "admin/ldt_utils/app_action.html" %} {% load i18n %} +{% load absurl %} {# reindex contents #} {% block content %} {% if message %} @@ -11,13 +12,13 @@ {% endif %}
{% csrf_token %} + action="{% absurl admin:ldt_project_compute_stats %}">{% csrf_token %} {{ form.as_table }}
-Back to administration page +Back to administration page {% endblock %} diff -r 78ed70bc6bfe -r a6d47caa7fc0 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Mon Dec 03 11:53:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Mon Dec 03 16:12:53 2012 +0100 @@ -25,7 +25,6 @@ var player_id='{{player_id}}'; var translate_show="{% trans 'Show Player' %}"; var translate_hide="{% trans 'Hide Player' %}"; - var WEB_URL='{{WEB_URL}}'; var LANGUAGE_CODE='{{LANGUAGE_CODE}}'; var json_url='{{json_url}}'; var player_id='{{player_id}}'; diff -r 78ed70bc6bfe -r a6d47caa7fc0 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_seo_meta.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_seo_meta.html Mon Dec 03 11:53:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_seo_meta.html Mon Dec 03 16:12:53 2012 +0100 @@ -1,3 +1,4 @@ +{% load absurl %} {% spaceless %} - + {% endspaceless %} \ No newline at end of file diff -r 78ed70bc6bfe -r a6d47caa7fc0 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_form.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_form.html Mon Dec 03 11:53:01 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_form.html Mon Dec 03 16:12:53 2012 +0100 @@ -1,5 +1,6 @@ {% extends "ldt/ldt_base.html" %} {% load i18n %} +{% load absurl %} {% block js_declaration %}