From a14e2d0bcfcd0c246c96b75f3687e26b2dc57e8a Mon Sep 17 00:00:00 2001
From: olivier <>
Date: Fri, 9 Jan 2009 14:15:12 +0000
Subject: [PATCH] move all templates into a subdirectory to avoid conflicts
with templates from a given project or other apps
---
telemeta/templates/{ => telemeta}/admin.html | 2 +-
telemeta/templates/{ => telemeta}/base.html | 0
.../templates/{ => telemeta}/base_xspf.xml | 0
.../templates/{ => telemeta}/collection.m3u | 0
.../{ => telemeta}/collection_detail.html | 4 ++--
.../{ => telemeta}/collection_detail_dc.html | 2 +-
.../{ => telemeta}/collection_list.html | 4 ++--
.../{ => telemeta}/collection_xspf.xml | 2 +-
.../{ => telemeta}/enumeration_edit.html | 2 +-
.../enumeration_edit_value.html | 2 +-
.../{ => telemeta}/geo_continents.html | 2 +-
.../{ => telemeta}/geo_continents.js | 0
.../{ => telemeta}/geo_countries.html | 2 +-
.../geo_country_collections.html | 4 ++--
.../{ => telemeta}/inc/collection_list.html | 0
.../{ => telemeta}/inc/mediaitem_list.html | 0
telemeta/templates/{ => telemeta}/index.html | 2 +-
.../{ => telemeta}/mediaitem_detail.html | 2 +-
.../{ => telemeta}/mediaitem_detail_dc.html | 2 +-
.../{ => telemeta}/mediaitem_list.html | 4 ++--
.../{ => telemeta}/mediaitem_xspf.xml | 2 +-
.../{ => telemeta}/search_criteria.html | 2 +-
.../{ => telemeta}/search_results.html | 6 ++---
telemeta/urls.py | 16 +++++++-------
telemeta/web/base.py | 22 +++++++++----------
25 files changed, 42 insertions(+), 42 deletions(-)
rename telemeta/templates/{ => telemeta}/admin.html (95%)
rename telemeta/templates/{ => telemeta}/base.html (100%)
rename telemeta/templates/{ => telemeta}/base_xspf.xml (100%)
rename telemeta/templates/{ => telemeta}/collection.m3u (100%)
rename telemeta/templates/{ => telemeta}/collection_detail.html (97%)
rename telemeta/templates/{ => telemeta}/collection_detail_dc.html (96%)
rename telemeta/templates/{ => telemeta}/collection_list.html (61%)
rename telemeta/templates/{ => telemeta}/collection_xspf.xml (94%)
rename telemeta/templates/{ => telemeta}/enumeration_edit.html (97%)
rename telemeta/templates/{ => telemeta}/enumeration_edit_value.html (94%)
rename telemeta/templates/{ => telemeta}/geo_continents.html (95%)
rename telemeta/templates/{ => telemeta}/geo_continents.js (100%)
rename telemeta/templates/{ => telemeta}/geo_countries.html (91%)
rename telemeta/templates/{ => telemeta}/geo_country_collections.html (77%)
rename telemeta/templates/{ => telemeta}/inc/collection_list.html (100%)
rename telemeta/templates/{ => telemeta}/inc/mediaitem_list.html (100%)
rename telemeta/templates/{ => telemeta}/index.html (93%)
rename telemeta/templates/{ => telemeta}/mediaitem_detail.html (97%)
rename telemeta/templates/{ => telemeta}/mediaitem_detail_dc.html (93%)
rename telemeta/templates/{ => telemeta}/mediaitem_list.html (55%)
rename telemeta/templates/{ => telemeta}/mediaitem_xspf.xml (91%)
rename telemeta/templates/{ => telemeta}/search_criteria.html (98%)
rename telemeta/templates/{ => telemeta}/search_results.html (90%)
diff --git a/telemeta/templates/admin.html b/telemeta/templates/telemeta/admin.html
similarity index 95%
rename from telemeta/templates/admin.html
rename to telemeta/templates/telemeta/admin.html
index 9993a68a..b586b206 100644
--- a/telemeta/templates/admin.html
+++ b/telemeta/templates/telemeta/admin.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "telemeta/base.html" %}
{% block extra_style %}
diff --git a/telemeta/templates/base.html b/telemeta/templates/telemeta/base.html
similarity index 100%
rename from telemeta/templates/base.html
rename to telemeta/templates/telemeta/base.html
diff --git a/telemeta/templates/base_xspf.xml b/telemeta/templates/telemeta/base_xspf.xml
similarity index 100%
rename from telemeta/templates/base_xspf.xml
rename to telemeta/templates/telemeta/base_xspf.xml
diff --git a/telemeta/templates/collection.m3u b/telemeta/templates/telemeta/collection.m3u
similarity index 100%
rename from telemeta/templates/collection.m3u
rename to telemeta/templates/telemeta/collection.m3u
diff --git a/telemeta/templates/collection_detail.html b/telemeta/templates/telemeta/collection_detail.html
similarity index 97%
rename from telemeta/templates/collection_detail.html
rename to telemeta/templates/telemeta/collection_detail.html
index 5dea5250..b98a2d08 100644
--- a/telemeta/templates/collection_detail.html
+++ b/telemeta/templates/telemeta/collection_detail.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "telemeta/base.html" %}
{% load telemeta_utils %}
{% block extra_javascript %}
@@ -150,7 +150,7 @@
All collections
diff --git a/telemeta/templates/mediaitem_detail.html b/telemeta/templates/telemeta/mediaitem_detail.html
similarity index 97%
rename from telemeta/templates/mediaitem_detail.html
rename to telemeta/templates/telemeta/mediaitem_detail.html
index dc2b120b..c99af9dc 100644
--- a/telemeta/templates/mediaitem_detail.html
+++ b/telemeta/templates/telemeta/mediaitem_detail.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "telemeta/base.html" %}
{% load telemeta_utils %}
{% block extra_style %}
diff --git a/telemeta/templates/mediaitem_detail_dc.html b/telemeta/templates/telemeta/mediaitem_detail_dc.html
similarity index 93%
rename from telemeta/templates/mediaitem_detail_dc.html
rename to telemeta/templates/telemeta/mediaitem_detail_dc.html
index 9ad50bfb..4f1f330e 100644
--- a/telemeta/templates/mediaitem_detail_dc.html
+++ b/telemeta/templates/telemeta/mediaitem_detail_dc.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "telemeta/base.html" %}
{% load telemeta_utils %}
{% if item %}
diff --git a/telemeta/templates/mediaitem_list.html b/telemeta/templates/telemeta/mediaitem_list.html
similarity index 55%
rename from telemeta/templates/mediaitem_list.html
rename to telemeta/templates/telemeta/mediaitem_list.html
index d94e3e96..341d25d7 100644
--- a/telemeta/templates/mediaitem_list.html
+++ b/telemeta/templates/telemeta/mediaitem_list.html
@@ -1,8 +1,8 @@
-{% extends "base.html" %}
+{% extends "telemeta/base.html" %}
{% block content %}
Media items
{% with object_list as items %}
-{% include "inc/mediaitem_list.html" %}
+{% include "telemeta/inc/mediaitem_list.html" %}
{% endwith %}
{% endblock %}
diff --git a/telemeta/templates/mediaitem_xspf.xml b/telemeta/templates/telemeta/mediaitem_xspf.xml
similarity index 91%
rename from telemeta/templates/mediaitem_xspf.xml
rename to telemeta/templates/telemeta/mediaitem_xspf.xml
index c1ca2af8..ece81d37 100644
--- a/telemeta/templates/mediaitem_xspf.xml
+++ b/telemeta/templates/telemeta/mediaitem_xspf.xml
@@ -1,4 +1,4 @@
-{% extends "base_xspf.xml" %}
+{% extends "telemeta/base_xspf.xml" %}
{% load telemeta_utils %}
{% block tracklist %}
diff --git a/telemeta/templates/search_criteria.html b/telemeta/templates/telemeta/search_criteria.html
similarity index 98%
rename from telemeta/templates/search_criteria.html
rename to telemeta/templates/telemeta/search_criteria.html
index 584feb5e..9f9cccc7 100644
--- a/telemeta/templates/search_criteria.html
+++ b/telemeta/templates/telemeta/search_criteria.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "telemeta/base.html" %}
{% load telemeta_utils %}
{% block extra_javascript %}
diff --git a/telemeta/templates/search_results.html b/telemeta/templates/telemeta/search_results.html
similarity index 90%
rename from telemeta/templates/search_results.html
rename to telemeta/templates/telemeta/search_results.html
index 04d40b37..c0bcda03 100644
--- a/telemeta/templates/search_results.html
+++ b/telemeta/templates/telemeta/search_results.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "telemeta/base.html" %}
{% load telemeta_utils %}
{% block content %}
@@ -40,7 +40,7 @@
Collections ({{collections_num}})
{% with object_list as items %}
- {% include "inc/mediaitem_list.html" %}
+ {% include "telemeta/inc/mediaitem_list.html" %}
{% endwith %}
{% else %}
@@ -50,7 +50,7 @@
Collections ({{collections_num}})
{% with object_list as collections %}
- {% include "inc/collection_list.html" %}
+ {% include "telemeta/inc/collection_list.html" %}
{% endwith %}
{% endifequal %}
diff --git a/telemeta/urls.py b/telemeta/urls.py
index 79c4ebb2..d54fa435 100644
--- a/telemeta/urls.py
+++ b/telemeta/urls.py
@@ -33,12 +33,12 @@ urlpatterns = patterns('',
# items
url(r'^items/$', 'django.views.generic.list_detail.object_list',
- dict(all_items, paginate_by=20, template_name="mediaitem_list.html"),
+ dict(all_items, paginate_by=20, template_name="telemeta/mediaitem_list.html"),
name="telemeta-items"),
url(r'^items/(?P
' + i_ex + ')/$', web_view.item_detail,
name="telemeta-item-detail"),
url(r'^items/(?P' + i_ex + ')/dc/$', web_view.item_detail,
- {'template': 'mediaitem_detail_dc.html'},
+ {'template': 'telemeta/mediaitem_detail_dc.html'},
name="telemeta-item-dublincore"),
url(r'^items/(?P' + i_ex + ')/dc/xml/$', web_view.item_detail,
{'format': 'dublin_core_xml'},
@@ -52,32 +52,32 @@ urlpatterns = patterns('',
name="telemeta-item-visualize"),
url(r'^items/(?P' + i_ex + ')/item_xspf.xml$',
web_view.item_playlist,
- dict(template="mediaitem_xspf.xml", mimetype="application/xspf+xml"),
+ dict(template="telemeta/mediaitem_xspf.xml", mimetype="application/xspf+xml"),
name="telemeta-item-xspf"),
# collections
url(r'^collections/$', 'django.views.generic.list_detail.object_list',
dict(all_collections, paginate_by=20,
- template_name="collection_list.html"),
+ template_name="telemeta/collection_list.html"),
name="telemeta-collections"),
url(r'^collections/?page=(?P[0-9]+)$',
'django.views.generic.list_detail.object_list',
dict(all_collections, paginate_by=20)),
url(r'^collections/(?P' + c_ex + ')/$',
'django.views.generic.list_detail.object_detail',
- dict(all_collections, template_name="collection_detail.html"),
+ dict(all_collections, template_name="telemeta/collection_detail.html"),
name="telemeta-collection-detail"),
url(r'^collections/(?P' + c_ex + ')/dc/$',
'django.views.generic.list_detail.object_detail',
- dict(all_collections, template_name="collection_detail_dc.html"),
+ dict(all_collections, template_name="telemeta/collection_detail_dc.html"),
name="telemeta-collection-dublincore"),
url(r'^collections/(?P' + c_ex + ')/collection_xspf.xml$',
web_view.collection_playlist,
- dict(template="collection_xspf.xml", mimetype="application/xspf+xml"),
+ dict(template="telemeta/collection_xspf.xml", mimetype="application/xspf+xml"),
name="telemeta-collection-xspf"),
url(r'^collections/(?P' + c_ex + ')/collection.m3u$',
web_view.collection_playlist,
- dict(template="collection.m3u", mimetype="audio/mpegurl"),
+ dict(template="telemeta/collection.m3u", mimetype="audio/mpegurl"),
name="telemeta-collection-m3u"),
# search
diff --git a/telemeta/web/base.py b/telemeta/web/base.py
index 773f6279..9335e57b 100644
--- a/telemeta/web/base.py
+++ b/telemeta/web/base.py
@@ -38,11 +38,11 @@ class WebView(Component):
def index(self, request):
"""Render the homepage"""
- template = loader.get_template('index.html')
+ template = loader.get_template('telemeta/index.html')
context = Context({})
return HttpResponse(template.render(context))
- def item_detail(self, request, item_id, template='mediaitem_detail.html'):
+ def item_detail(self, request, item_id, template='telemeta/mediaitem_detail.html'):
"""Show the details of a given item"""
item = MediaItem.objects.get(pk=item_id)
@@ -127,7 +127,7 @@ class WebView(Component):
continents = MediaCollection.objects.list_continents()
countries = MediaCollection.objects.list_countries()
ethnic_groups = MediaItem.objects.list_ethnic_groups()
- return render_to_response('search_criteria.html',
+ return render_to_response('telemeta/search_criteria.html',
{'continents': continents, 'countries': countries,
'ethnic_groups': ethnic_groups})
@@ -185,7 +185,7 @@ class WebView(Component):
objects = collections
return list_detail.object_list(request, objects,
- template_name='search_results.html', paginate_by=20,
+ template_name='telemeta/search_results.html', paginate_by=20,
extra_context={'criteria': criteria, 'collections_num': collections.count(),
'items_num': items.count(), 'type' : type})
@@ -204,7 +204,7 @@ class WebView(Component):
return {"enumerations": self.__get_enumerations_list()}
def admin_index(self, request):
- return render_to_response('admin.html', self. __get_admin_context_vars())
+ return render_to_response('telemeta/admin.html', self. __get_admin_context_vars())
def __get_enumeration(self, id):
from django.db.models import get_models
@@ -229,7 +229,7 @@ class WebView(Component):
vars["enumeration_name"] = enumeration._meta.verbose_name
vars["enumeration_name_plural"] = enumeration._meta.verbose_name_plural
vars["enumeration_values"] = enumeration.objects.all()
- return render_to_response('enumeration_edit.html', vars)
+ return render_to_response('telemeta/enumeration_edit.html', vars)
def add_to_enumeration(self, request, enumeration_id):
@@ -264,7 +264,7 @@ class WebView(Component):
vars["enumeration_name"] = enumeration._meta.verbose_name
vars["enumeration_name_plural"] = enumeration._meta.verbose_name_plural
vars["enumeration_record"] = enumeration.objects.get(id__exact=value_id)
- return render_to_response('enumeration_edit_value.html', vars)
+ return render_to_response('telemeta/enumeration_edit_value.html', vars)
def update_enumeration_value(self, request, enumeration_id, value_id):
@@ -299,12 +299,12 @@ class WebView(Component):
def list_continents(self, request):
continents = MediaCollection.objects.stat_continents()
- return render_to_response('geo_continents.html',
+ return render_to_response('telemeta/geo_continents.html',
{'continents': continents })
def get_continents_js(self, request):
countries = MediaCollection.objects.list_countries()
- return render_to_response('geo_continents.js',
+ return render_to_response('telemeta/geo_continents.js',
{'countries': countries})
def list_countries(self, request, continent):
@@ -315,11 +315,11 @@ class WebView(Component):
if c["name"] != continent:
raise Http404
- return render_to_response('geo_countries.html', {'continent': c })
+ return render_to_response('telemeta/geo_countries.html', {'continent': c })
def list_country_collections(self, request, continent, country):
objects = MediaCollection.objects.by_country(country)
return list_detail.object_list(request, objects,
- template_name='geo_country_collections.html', paginate_by=20,
+ template_name='telemeta/geo_country_collections.html', paginate_by=20,
extra_context={'country': country, 'continent': continent})
--
2.39.5