From: olivier <>
Date: Fri, 9 Jan 2009 14:15:12 +0000 (+0000)
Subject: move all templates into a subdirectory to avoid conflicts with templates from a given...
X-Git-Tag: 1.1~742
X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a14e2d0bcfcd0c246c96b75f3687e26b2dc57e8a;p=telemeta.git
move all templates into a subdirectory to avoid conflicts with templates from a given project or other apps
---
diff --git a/telemeta/templates/admin.html b/telemeta/templates/admin.html
deleted file mode 100644
index 9993a68a..00000000
--- a/telemeta/templates/admin.html
+++ /dev/null
@@ -1,33 +0,0 @@
-{% extends "base.html" %}
-
-{% block extra_style %}
-
-{% endblock %}
-
-{% block content %}
-
Administration
-
-
-Users
-
-{% if enumerations %}
- Enumerations
-
- {% for enum in enumerations %}
- {%ifequal enum.id enumeration_id %}
- {{ enum.name|capfirst }}
- {%else%}
-
- {{ enum.name|capfirst }}
- {%endifequal%}
- {% endfor %}
-
-
-{% endif %}
-
-
-
- {% block tabcontents %}
- {% endblock %}
-
-{% endblock %}
diff --git a/telemeta/templates/base.html b/telemeta/templates/base.html
deleted file mode 100644
index 7f34c019..00000000
--- a/telemeta/templates/base.html
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-Telemeta
-
-
-
-{% block extra_style %}{% endblock %}
-{% block extra_javascript %}{% endblock %}
-
-{% load i18n %}
-{% load telemeta_utils %}
-
-
-
-
-
-
-
-{% block content %}{% endblock %}
-
-
-
-
-
-
-
diff --git a/telemeta/templates/base_xspf.xml b/telemeta/templates/base_xspf.xml
deleted file mode 100644
index af4166b6..00000000
--- a/telemeta/templates/base_xspf.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-{% block listinfo %}{% endblock %}
-
- {% block tracklist %}{% endblock %}
-
-
-
-
diff --git a/telemeta/templates/collection.m3u b/telemeta/templates/collection.m3u
deleted file mode 100644
index 7bb028e5..00000000
--- a/telemeta/templates/collection.m3u
+++ /dev/null
@@ -1,3 +0,0 @@
-#EXTM3U{% load telemeta_utils %}{% for item in collection.items.all %}
-#EXTINF:{{ item.get_duration }},{{ item.title }}
-http://{{ host }}{% url telemeta-item-export item.id|urlencode,"mp3" %}{% endfor %}
diff --git a/telemeta/templates/collection_detail.html b/telemeta/templates/collection_detail.html
deleted file mode 100644
index 5dea5250..00000000
--- a/telemeta/templates/collection_detail.html
+++ /dev/null
@@ -1,161 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block extra_javascript %}
-
-
-
-{% endblock %}
-
-{% if object %}
-
-{% block submenu %}
- Collection: {{ object.title }}
-
-{% endblock %}
-
-{% block content %}
-
-
-{% endblock %}
-{% else %}
- No such collection
-{% endif %}
-
diff --git a/telemeta/templates/collection_detail_dc.html b/telemeta/templates/collection_detail_dc.html
deleted file mode 100644
index 8f01ecac..00000000
--- a/telemeta/templates/collection_detail_dc.html
+++ /dev/null
@@ -1,26 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% if object %}
-{% block submenu %}
- Collection: {{ object.title }}
-
-{% endblock %}
-
-{% block content %}
- Dublin Core Expression
-
- Element RefinementValue
- {% for element in object.to_dublincore.elements %}
- {% if element.value %}
- {{ element.name }} {{ element.refinement|default:" " }}{% ifequal element.field "collection" %}{{ element.value }} {% else %}{{ element.value }}{% endifequal %}
- {% endif %}
- {% endfor %}
- {% for item in object.ordered_items %}
- relation hasPart{{ item.id }}
- {% endfor %}
-
-{% endblock %}
-{% else %}
- No such collection
-{% endif %}
\ No newline at end of file
diff --git a/telemeta/templates/collection_list.html b/telemeta/templates/collection_list.html
deleted file mode 100644
index 6d975df4..00000000
--- a/telemeta/templates/collection_list.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block content %}
-Collections
-
-{% with object_list as collections %}
-{% include "inc/collection_list.html" %}
-{% endwith %}
-
-{% endblock %}
diff --git a/telemeta/templates/collection_xspf.xml b/telemeta/templates/collection_xspf.xml
deleted file mode 100644
index acc8a3cb..00000000
--- a/telemeta/templates/collection_xspf.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-{% extends "base_xspf.xml" %}
-{% load telemeta_utils %}
-
-{% block listinfo %}
-{% with collection.to_dublincore.flatten as dc %}
- {{ dc.creator }}
- {{ dc.title }}
- http://{{ host }}{% url telemeta-collection-detail collection.id|urlencode %}
-{% endwith %}
-{% endblock %}
-
-{% block tracklist %}
-{% for item in collection.ordered_items %}
-
- {{ item.title }}
- mp3
- http://{{ host }}{% url telemeta-item-export item.id|urlencode,"mp3" %}
- {{ item.get_duration|mul:1000 }}
- http://{{ host }}{% url telemeta-item-detail item.id|urlencode %}
-
-{% endfor %}
-{% endblock %}
-
diff --git a/telemeta/templates/enumeration_edit.html b/telemeta/templates/enumeration_edit.html
deleted file mode 100644
index 8a426538..00000000
--- a/telemeta/templates/enumeration_edit.html
+++ /dev/null
@@ -1,47 +0,0 @@
-{% extends "admin.html" %}
-
-{% block tabcontents %}
- Manage {{ enumeration_name_plural|capfirst }}
-
-
-
-
- {% if enumeration_values %}
-
- {% else %}
- This enumeration is empty.
- {% endif %}
-
-
-{% endblock %}
diff --git a/telemeta/templates/enumeration_edit_value.html b/telemeta/templates/enumeration_edit_value.html
deleted file mode 100644
index b574a1b5..00000000
--- a/telemeta/templates/enumeration_edit_value.html
+++ /dev/null
@@ -1,22 +0,0 @@
-{% extends "admin.html" %}
-
-{% block tabcontents %}
- Manage {{ enumeration_name_plural|capfirst }}
-
-
-
-
-{% endblock %}
diff --git a/telemeta/templates/geo_continents.html b/telemeta/templates/geo_continents.html
deleted file mode 100644
index d59e9faa..00000000
--- a/telemeta/templates/geo_continents.html
+++ /dev/null
@@ -1,26 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block content %}
-Geographic Navigator
-{% if continents %}
-
-{% else %}
-No data
-{% endif %}
-{% endblock %}
diff --git a/telemeta/templates/geo_continents.js b/telemeta/templates/geo_continents.js
deleted file mode 100644
index 4e8c1930..00000000
--- a/telemeta/templates/geo_continents.js
+++ /dev/null
@@ -1,25 +0,0 @@
-{% load telemeta_utils %}
-
-var countries = [ {% for country in countries %}
- ['{{country.0|escapejs}}', '{{country.1|escapejs}}']{% if not forloop.last %},{% endif %} {%endfor%}
-];
-
-function get_countries(continent)
-{
- res = [];
- for (var i = 0; i < countries.length; i++)
- if ((continent == '') || (countries[i][0] == continent))
- res.push(countries[i][1]);
- return res;
-}
-
-function update_countries(continent, countries)
-{
- var list = get_countries(continent.value);
- countries.options.length = list.length + 1;
- countries.options[0] = new Option('All countries', '');
- for (var i = 0; i < list.length; i++) {
- countries.options[i+1] = new Option(list[i], list[i]);
- }
-}
-
diff --git a/telemeta/templates/geo_countries.html b/telemeta/templates/geo_countries.html
deleted file mode 100644
index b7f90a04..00000000
--- a/telemeta/templates/geo_countries.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block content %}
-WORLD /
- {{ continent.name }}
-
-{% endblock %}
diff --git a/telemeta/templates/geo_country_collections.html b/telemeta/templates/geo_country_collections.html
deleted file mode 100644
index 2fc474c2..00000000
--- a/telemeta/templates/geo_country_collections.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block content %}
-
-
-{% with object_list as collections %}
-{% include "inc/collection_list.html" %}
-{% endwith %}
-
-{% endblock %}
diff --git a/telemeta/templates/inc/collection_list.html b/telemeta/templates/inc/collection_list.html
deleted file mode 100644
index 31fbf023..00000000
--- a/telemeta/templates/inc/collection_list.html
+++ /dev/null
@@ -1,19 +0,0 @@
-{% load telemeta_utils %}
-{% if collections %}
- {% if hits %}
-
- {% endif %}
-
- {% for p in collections %}
- {{ p.title }}
-
- {% endfor %}
- {% if more_collections %} [...] {% endif %}
-
-{% else %}
- No collection
-{% endif %}
diff --git a/telemeta/templates/inc/mediaitem_list.html b/telemeta/templates/inc/mediaitem_list.html
deleted file mode 100644
index 9ef69716..00000000
--- a/telemeta/templates/inc/mediaitem_list.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{% load telemeta_utils %}
-{% if items %}
- {% if hits %}
-
- {% endif %}
-
- {% for p in items %}
- {{ p.title }}
- {% endfor %}
- {% if more_items %} [...] {% endif %}
-
-{% else %}
- No item
-{% endif %}
diff --git a/telemeta/templates/index.html b/telemeta/templates/index.html
deleted file mode 100644
index 041e169d..00000000
--- a/telemeta/templates/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{% extends "base.html" %}
-{% block content %}
-
-{% endblock %}
diff --git a/telemeta/templates/mediaitem_detail.html b/telemeta/templates/mediaitem_detail.html
deleted file mode 100644
index dc2b120b..00000000
--- a/telemeta/templates/mediaitem_detail.html
+++ /dev/null
@@ -1,222 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block extra_style %}
-
-
-
-{% endblock %}
-{% block extra_javascript %}
-
-
-
-
-
-
-
-
-
-
-{% endblock %}
-
-
-{% if item %}
-{% block submenu %}
- Item: {{ item.title }}
-
-{% endblock %}
-
-{% block content %}
-
-
-
-{% if item.file %}
-
-
-
-
-
-
-
-
-
-
- Property
- Value
- Unit
-
- {% for analyser in analysers %}
-
-
- {{ analyser.name }}
-
-
- {{ analyser.value }}
-
-
- {{ analyser.unit }}
-
-
- {% endfor %}
-
-
-
-
-
-
-
-
-
Download:
- {% for format in export_formats %}
- {{ format.name }}
- {% endfor %}
-
-
-
-{% endif %}
-
-
-
- {% if item.auteur %}Auteur {{ item.auteur }} {% endif %}
- {% if item.annee_enr %}Année d'enregistrement {{ item.annee_enr }} {% endif %}
- {% if item.dates_enregistr %}Date d'enregistrement {{ item.dates_enregistr }} {% endif %}
- {% if item.title %}Titre {{ item.title }} {% endif %}
- {% if item.transcrip_trad %}Traduction du titre {{ item.transcrip_trad }} {% endif %}
- Collection {{ item.collection.title }}
- {% if item.duree %}Durée {{ item.duree }} {% endif %}
- {% if item.collection.ispublished and item.Ref %}
- Ref {{ item.Ref }}
- {% endif %}
-
-
-
-
-
-
-
-
-
-{% endblock %}
-{% else %}
- No such item
-{% endif %}
diff --git a/telemeta/templates/mediaitem_detail_dc.html b/telemeta/templates/mediaitem_detail_dc.html
deleted file mode 100644
index 9ad50bfb..00000000
--- a/telemeta/templates/mediaitem_detail_dc.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% if item %}
-{% block submenu %}
- Item: {{ item.title }}
-
-{% endblock %}
-
-{% block content %}
- Dublin Core Expression
-
- Element RefinementValue
- {% for element in item.to_dublincore.elements %}
- {% if element.value %}
- {{ element.name }} {{ element.refinement|default:" " }}{% ifequal element.field "collection" %}{{ element.value }} {% else %}{{ element.value }}{% endifequal %}
- {% endif %}
- {% endfor %}
-
-{% endblock %}
-{% else %}
- No such item
-{% endif %}
-
-
diff --git a/telemeta/templates/mediaitem_list.html b/telemeta/templates/mediaitem_list.html
deleted file mode 100644
index d94e3e96..00000000
--- a/telemeta/templates/mediaitem_list.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-Media items
-{% with object_list as items %}
-{% include "inc/mediaitem_list.html" %}
-{% endwith %}
-{% endblock %}
diff --git a/telemeta/templates/mediaitem_xspf.xml b/telemeta/templates/mediaitem_xspf.xml
deleted file mode 100644
index c1ca2af8..00000000
--- a/telemeta/templates/mediaitem_xspf.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-{% extends "base_xspf.xml" %}
-{% load telemeta_utils %}
-
-{% block tracklist %}
-
- {{ item.title }}
- mp3
- http://{{ host }}{% url telemeta-item-export item.id|urlencode,"mp3" %}
- {{ item.get_duration|mul:1000 }}
- http://{{ host }}{% url telemeta-item-detail item.id|urlencode %}
-
-{% endblock %}
-
diff --git a/telemeta/templates/search_criteria.html b/telemeta/templates/search_criteria.html
deleted file mode 100644
index 584feb5e..00000000
--- a/telemeta/templates/search_criteria.html
+++ /dev/null
@@ -1,74 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block extra_javascript %}
-
-{% endblock %}
-
-{% block content %}
-Advanced search
-
-
-{% endblock %}
diff --git a/telemeta/templates/search_results.html b/telemeta/templates/search_results.html
deleted file mode 100644
index 04d40b37..00000000
--- a/telemeta/templates/search_results.html
+++ /dev/null
@@ -1,58 +0,0 @@
-{% extends "base.html" %}
-{% load telemeta_utils %}
-
-{% block content %}
-Search results
-
-{% if criteria %}
-
- {% if criteria.pattern %}
- Pattern: {{criteria.pattern}}
- {% endif %}
- {% if criteria.continent %}
- Continent: {{criteria.continent}}
- {% endif %}
- {% if criteria.country %}
- Country: {{criteria.country}}
- {% endif %}
- {% if criteria.ethnic_group %}
- Ethnic group: {{criteria.ethnic_group}}
- {% endif %}
- {% if criteria.creator %}
- Creator: {{criteria.creator}}
- {% endif %}
- {% if criteria.title %}
- Title: {{criteria.title}}
- {% endif %}
- {% if criteria.rec_date %}
- Recording date: {{criteria.rec_date}}
- {% endif %}
- {% if criteria.pub_date %}
- Publishing date: {{criteria.pub_date}}
- {% endif %}
-
-{% endif %}
-
-{% ifequal type 'items' %}
-
- Items ({{items_num}}) |
-
- Collections ({{collections_num}})
-
- {% with object_list as items %}
- {% include "inc/mediaitem_list.html" %}
- {% endwith %}
-
-{% else %}
-
-
- Items ({{items_num}}) |
- Collections ({{collections_num}})
-
- {% with object_list as collections %}
- {% include "inc/collection_list.html" %}
- {% endwith %}
-
-{% endifequal %}
-
-{% endblock %}
diff --git a/telemeta/templates/telemeta/admin.html b/telemeta/templates/telemeta/admin.html
new file mode 100644
index 00000000..b586b206
--- /dev/null
+++ b/telemeta/templates/telemeta/admin.html
@@ -0,0 +1,33 @@
+{% extends "telemeta/base.html" %}
+
+{% block extra_style %}
+
+{% endblock %}
+
+{% block content %}
+Administration
+
+
+Users
+
+{% if enumerations %}
+ Enumerations
+
+ {% for enum in enumerations %}
+ {%ifequal enum.id enumeration_id %}
+ {{ enum.name|capfirst }}
+ {%else%}
+
+ {{ enum.name|capfirst }}
+ {%endifequal%}
+ {% endfor %}
+
+
+{% endif %}
+
+
+
+ {% block tabcontents %}
+ {% endblock %}
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/base.html b/telemeta/templates/telemeta/base.html
new file mode 100644
index 00000000..7f34c019
--- /dev/null
+++ b/telemeta/templates/telemeta/base.html
@@ -0,0 +1,68 @@
+
+
+
+Telemeta
+
+
+
+{% block extra_style %}{% endblock %}
+{% block extra_javascript %}{% endblock %}
+
+{% load i18n %}
+{% load telemeta_utils %}
+
+
+
+
+
+
+
+{% block content %}{% endblock %}
+
+
+
+
+
+
+
diff --git a/telemeta/templates/telemeta/base_xspf.xml b/telemeta/templates/telemeta/base_xspf.xml
new file mode 100644
index 00000000..af4166b6
--- /dev/null
+++ b/telemeta/templates/telemeta/base_xspf.xml
@@ -0,0 +1,9 @@
+
+
+{% block listinfo %}{% endblock %}
+
+ {% block tracklist %}{% endblock %}
+
+
+
+
diff --git a/telemeta/templates/telemeta/collection.m3u b/telemeta/templates/telemeta/collection.m3u
new file mode 100644
index 00000000..7bb028e5
--- /dev/null
+++ b/telemeta/templates/telemeta/collection.m3u
@@ -0,0 +1,3 @@
+#EXTM3U{% load telemeta_utils %}{% for item in collection.items.all %}
+#EXTINF:{{ item.get_duration }},{{ item.title }}
+http://{{ host }}{% url telemeta-item-export item.id|urlencode,"mp3" %}{% endfor %}
diff --git a/telemeta/templates/telemeta/collection_detail.html b/telemeta/templates/telemeta/collection_detail.html
new file mode 100644
index 00000000..b98a2d08
--- /dev/null
+++ b/telemeta/templates/telemeta/collection_detail.html
@@ -0,0 +1,161 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}
+
+
+
+{% endblock %}
+
+{% if object %}
+
+{% block submenu %}
+ Collection: {{ object.title }}
+
+{% endblock %}
+
+{% block content %}
+
+
+{% endblock %}
+{% else %}
+ No such collection
+{% endif %}
+
diff --git a/telemeta/templates/telemeta/collection_detail_dc.html b/telemeta/templates/telemeta/collection_detail_dc.html
new file mode 100644
index 00000000..0cf3e394
--- /dev/null
+++ b/telemeta/templates/telemeta/collection_detail_dc.html
@@ -0,0 +1,26 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% if object %}
+{% block submenu %}
+ Collection: {{ object.title }}
+
+{% endblock %}
+
+{% block content %}
+ Dublin Core Expression
+
+ Element RefinementValue
+ {% for element in object.to_dublincore.elements %}
+ {% if element.value %}
+ {{ element.name }} {{ element.refinement|default:" " }}{% ifequal element.field "collection" %}{{ element.value }} {% else %}{{ element.value }}{% endifequal %}
+ {% endif %}
+ {% endfor %}
+ {% for item in object.ordered_items %}
+ relation hasPart{{ item.id }}
+ {% endfor %}
+
+{% endblock %}
+{% else %}
+ No such collection
+{% endif %}
\ No newline at end of file
diff --git a/telemeta/templates/telemeta/collection_list.html b/telemeta/templates/telemeta/collection_list.html
new file mode 100644
index 00000000..35a21eda
--- /dev/null
+++ b/telemeta/templates/telemeta/collection_list.html
@@ -0,0 +1,11 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block content %}
+Collections
+
+{% with object_list as collections %}
+{% include "telemeta/inc/collection_list.html" %}
+{% endwith %}
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/collection_xspf.xml b/telemeta/templates/telemeta/collection_xspf.xml
new file mode 100644
index 00000000..2e8066c0
--- /dev/null
+++ b/telemeta/templates/telemeta/collection_xspf.xml
@@ -0,0 +1,23 @@
+{% extends "telemeta/base_xspf.xml" %}
+{% load telemeta_utils %}
+
+{% block listinfo %}
+{% with collection.to_dublincore.flatten as dc %}
+ {{ dc.creator }}
+ {{ dc.title }}
+ http://{{ host }}{% url telemeta-collection-detail collection.id|urlencode %}
+{% endwith %}
+{% endblock %}
+
+{% block tracklist %}
+{% for item in collection.ordered_items %}
+
+ {{ item.title }}
+ mp3
+ http://{{ host }}{% url telemeta-item-export item.id|urlencode,"mp3" %}
+ {{ item.get_duration|mul:1000 }}
+ http://{{ host }}{% url telemeta-item-detail item.id|urlencode %}
+
+{% endfor %}
+{% endblock %}
+
diff --git a/telemeta/templates/telemeta/enumeration_edit.html b/telemeta/templates/telemeta/enumeration_edit.html
new file mode 100644
index 00000000..ae5262a5
--- /dev/null
+++ b/telemeta/templates/telemeta/enumeration_edit.html
@@ -0,0 +1,47 @@
+{% extends "telemeta/admin.html" %}
+
+{% block tabcontents %}
+ Manage {{ enumeration_name_plural|capfirst }}
+
+
+
+
+ {% if enumeration_values %}
+
+ {% else %}
+ This enumeration is empty.
+ {% endif %}
+
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/enumeration_edit_value.html b/telemeta/templates/telemeta/enumeration_edit_value.html
new file mode 100644
index 00000000..f1fc8ad1
--- /dev/null
+++ b/telemeta/templates/telemeta/enumeration_edit_value.html
@@ -0,0 +1,22 @@
+{% extends "telemeta/admin.html" %}
+
+{% block tabcontents %}
+ Manage {{ enumeration_name_plural|capfirst }}
+
+
+
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/geo_continents.html b/telemeta/templates/telemeta/geo_continents.html
new file mode 100644
index 00000000..9e2a7314
--- /dev/null
+++ b/telemeta/templates/telemeta/geo_continents.html
@@ -0,0 +1,26 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block content %}
+Geographic Navigator
+{% if continents %}
+
+{% else %}
+No data
+{% endif %}
+{% endblock %}
diff --git a/telemeta/templates/telemeta/geo_continents.js b/telemeta/templates/telemeta/geo_continents.js
new file mode 100644
index 00000000..4e8c1930
--- /dev/null
+++ b/telemeta/templates/telemeta/geo_continents.js
@@ -0,0 +1,25 @@
+{% load telemeta_utils %}
+
+var countries = [ {% for country in countries %}
+ ['{{country.0|escapejs}}', '{{country.1|escapejs}}']{% if not forloop.last %},{% endif %} {%endfor%}
+];
+
+function get_countries(continent)
+{
+ res = [];
+ for (var i = 0; i < countries.length; i++)
+ if ((continent == '') || (countries[i][0] == continent))
+ res.push(countries[i][1]);
+ return res;
+}
+
+function update_countries(continent, countries)
+{
+ var list = get_countries(continent.value);
+ countries.options.length = list.length + 1;
+ countries.options[0] = new Option('All countries', '');
+ for (var i = 0; i < list.length; i++) {
+ countries.options[i+1] = new Option(list[i], list[i]);
+ }
+}
+
diff --git a/telemeta/templates/telemeta/geo_countries.html b/telemeta/templates/telemeta/geo_countries.html
new file mode 100644
index 00000000..8b25e9ee
--- /dev/null
+++ b/telemeta/templates/telemeta/geo_countries.html
@@ -0,0 +1,13 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block content %}
+WORLD /
+ {{ continent.name }}
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/geo_country_collections.html b/telemeta/templates/telemeta/geo_country_collections.html
new file mode 100644
index 00000000..29bb27e9
--- /dev/null
+++ b/telemeta/templates/telemeta/geo_country_collections.html
@@ -0,0 +1,13 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block content %}
+
+
+{% with object_list as collections %}
+{% include "telemeta/inc/collection_list.html" %}
+{% endwith %}
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/inc/collection_list.html b/telemeta/templates/telemeta/inc/collection_list.html
new file mode 100644
index 00000000..31fbf023
--- /dev/null
+++ b/telemeta/templates/telemeta/inc/collection_list.html
@@ -0,0 +1,19 @@
+{% load telemeta_utils %}
+{% if collections %}
+ {% if hits %}
+
+ {% endif %}
+
+ {% for p in collections %}
+ {{ p.title }}
+
+ {% endfor %}
+ {% if more_collections %} [...] {% endif %}
+
+{% else %}
+ No collection
+{% endif %}
diff --git a/telemeta/templates/telemeta/inc/mediaitem_list.html b/telemeta/templates/telemeta/inc/mediaitem_list.html
new file mode 100644
index 00000000..9ef69716
--- /dev/null
+++ b/telemeta/templates/telemeta/inc/mediaitem_list.html
@@ -0,0 +1,18 @@
+{% load telemeta_utils %}
+{% if items %}
+ {% if hits %}
+
+ {% endif %}
+
+ {% for p in items %}
+ {{ p.title }}
+ {% endfor %}
+ {% if more_items %} [...] {% endif %}
+
+{% else %}
+ No item
+{% endif %}
diff --git a/telemeta/templates/telemeta/index.html b/telemeta/templates/telemeta/index.html
new file mode 100644
index 00000000..08d4e9bf
--- /dev/null
+++ b/telemeta/templates/telemeta/index.html
@@ -0,0 +1,13 @@
+{% extends "telemeta/base.html" %}
+{% block content %}
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/mediaitem_detail.html b/telemeta/templates/telemeta/mediaitem_detail.html
new file mode 100644
index 00000000..c99af9dc
--- /dev/null
+++ b/telemeta/templates/telemeta/mediaitem_detail.html
@@ -0,0 +1,222 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block extra_style %}
+
+
+
+{% endblock %}
+{% block extra_javascript %}
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
+
+
+{% if item %}
+{% block submenu %}
+ Item: {{ item.title }}
+
+{% endblock %}
+
+{% block content %}
+
+
+
+{% if item.file %}
+
+
+
+
+
+
+
+
+
+
+ Property
+ Value
+ Unit
+
+ {% for analyser in analysers %}
+
+
+ {{ analyser.name }}
+
+
+ {{ analyser.value }}
+
+
+ {{ analyser.unit }}
+
+
+ {% endfor %}
+
+
+
+
+
+
+
+
+
Download:
+ {% for format in export_formats %}
+ {{ format.name }}
+ {% endfor %}
+
+
+
+{% endif %}
+
+
+
+ {% if item.auteur %}Auteur {{ item.auteur }} {% endif %}
+ {% if item.annee_enr %}Année d'enregistrement {{ item.annee_enr }} {% endif %}
+ {% if item.dates_enregistr %}Date d'enregistrement {{ item.dates_enregistr }} {% endif %}
+ {% if item.title %}Titre {{ item.title }} {% endif %}
+ {% if item.transcrip_trad %}Traduction du titre {{ item.transcrip_trad }} {% endif %}
+ Collection {{ item.collection.title }}
+ {% if item.duree %}Durée {{ item.duree }} {% endif %}
+ {% if item.collection.ispublished and item.Ref %}
+ Ref {{ item.Ref }}
+ {% endif %}
+
+
+
+
+
+
+
+
+
+{% endblock %}
+{% else %}
+ No such item
+{% endif %}
diff --git a/telemeta/templates/telemeta/mediaitem_detail_dc.html b/telemeta/templates/telemeta/mediaitem_detail_dc.html
new file mode 100644
index 00000000..4f1f330e
--- /dev/null
+++ b/telemeta/templates/telemeta/mediaitem_detail_dc.html
@@ -0,0 +1,25 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% if item %}
+{% block submenu %}
+ Item: {{ item.title }}
+
+{% endblock %}
+
+{% block content %}
+ Dublin Core Expression
+
+ Element RefinementValue
+ {% for element in item.to_dublincore.elements %}
+ {% if element.value %}
+ {{ element.name }} {{ element.refinement|default:" " }}{% ifequal element.field "collection" %}{{ element.value }} {% else %}{{ element.value }}{% endifequal %}
+ {% endif %}
+ {% endfor %}
+
+{% endblock %}
+{% else %}
+ No such item
+{% endif %}
+
+
diff --git a/telemeta/templates/telemeta/mediaitem_list.html b/telemeta/templates/telemeta/mediaitem_list.html
new file mode 100644
index 00000000..341d25d7
--- /dev/null
+++ b/telemeta/templates/telemeta/mediaitem_list.html
@@ -0,0 +1,8 @@
+{% extends "telemeta/base.html" %}
+
+{% block content %}
+Media items
+{% with object_list as items %}
+{% include "telemeta/inc/mediaitem_list.html" %}
+{% endwith %}
+{% endblock %}
diff --git a/telemeta/templates/telemeta/mediaitem_xspf.xml b/telemeta/templates/telemeta/mediaitem_xspf.xml
new file mode 100644
index 00000000..ece81d37
--- /dev/null
+++ b/telemeta/templates/telemeta/mediaitem_xspf.xml
@@ -0,0 +1,13 @@
+{% extends "telemeta/base_xspf.xml" %}
+{% load telemeta_utils %}
+
+{% block tracklist %}
+
+ {{ item.title }}
+ mp3
+ http://{{ host }}{% url telemeta-item-export item.id|urlencode,"mp3" %}
+ {{ item.get_duration|mul:1000 }}
+ http://{{ host }}{% url telemeta-item-detail item.id|urlencode %}
+
+{% endblock %}
+
diff --git a/telemeta/templates/telemeta/search_criteria.html b/telemeta/templates/telemeta/search_criteria.html
new file mode 100644
index 00000000..9f9cccc7
--- /dev/null
+++ b/telemeta/templates/telemeta/search_criteria.html
@@ -0,0 +1,74 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}
+
+{% endblock %}
+
+{% block content %}
+Advanced search
+
+
+{% endblock %}
diff --git a/telemeta/templates/telemeta/search_results.html b/telemeta/templates/telemeta/search_results.html
new file mode 100644
index 00000000..c0bcda03
--- /dev/null
+++ b/telemeta/templates/telemeta/search_results.html
@@ -0,0 +1,58 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+
+{% block content %}
+Search results
+
+{% if criteria %}
+
+ {% if criteria.pattern %}
+ Pattern: {{criteria.pattern}}
+ {% endif %}
+ {% if criteria.continent %}
+ Continent: {{criteria.continent}}
+ {% endif %}
+ {% if criteria.country %}
+ Country: {{criteria.country}}
+ {% endif %}
+ {% if criteria.ethnic_group %}
+ Ethnic group: {{criteria.ethnic_group}}
+ {% endif %}
+ {% if criteria.creator %}
+ Creator: {{criteria.creator}}
+ {% endif %}
+ {% if criteria.title %}
+ Title: {{criteria.title}}
+ {% endif %}
+ {% if criteria.rec_date %}
+ Recording date: {{criteria.rec_date}}
+ {% endif %}
+ {% if criteria.pub_date %}
+ Publishing date: {{criteria.pub_date}}
+ {% endif %}
+
+{% endif %}
+
+{% ifequal type 'items' %}
+
+ Items ({{items_num}}) |
+
+ Collections ({{collections_num}})
+
+ {% with object_list as items %}
+ {% include "telemeta/inc/mediaitem_list.html" %}
+ {% endwith %}
+
+{% else %}
+
+
+ Items ({{items_num}}) |
+ Collections ({{collections_num}})
+
+ {% with object_list as collections %}
+ {% include "telemeta/inc/collection_list.html" %}
+ {% endwith %}
+
+{% endifequal %}
+
+{% endblock %}
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})