- Do not create object for new
authorymh <ymh.work@gmail.com>
Wed, 25 Sep 2013 22:14:51 +0200
changeset 117 0a4e7d6ebe80
parent 116 0a6c7c8f8490
child 118 d33a072d974b
- Do not create object for new - optimise object loading on edit (avoid double object query) - optimize sparql queries configuration - rename templates - update trnslations
src/p4l/api/serializers.py
src/p4l/locale/en/LC_MESSAGES/django.mo
src/p4l/locale/en/LC_MESSAGES/django.po
src/p4l/locale/es/LC_MESSAGES/django.mo
src/p4l/locale/es/LC_MESSAGES/django.po
src/p4l/locale/fr/LC_MESSAGES/django.mo
src/p4l/locale/fr/LC_MESSAGES/django.po
src/p4l/search/index.py
src/p4l/search/views.py
src/p4l/settings.py
src/p4l/static/p4l/js/p4l.js
src/p4l/templates/p4l/base.html
src/p4l/templates/p4l/home.html
src/p4l/templates/p4l/p4l_base.html
src/p4l/templates/p4l/p4l_home.html
src/p4l/templates/p4l/p4l_record_view.html
src/p4l/templates/p4l/record_update_form.html
src/p4l/templates/p4l/record_view.html
src/p4l/templatetags/p4lutils.py
src/p4l/urls.py
src/p4l/views.py
--- a/src/p4l/api/serializers.py	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/api/serializers.py	Wed Sep 25 22:14:51 2013 +0200
@@ -79,7 +79,8 @@
             if value in (None, ''):
                 into[(self.source or field_name)] = None
             elif self.many and hasattr(value, '__iter__'):
-                obj.all().delete()
+                if obj is not None:
+                    obj.all().delete()
                 nested_items = []
                 for val in value:
                     kwargs = {
@@ -118,19 +119,18 @@
     Serializer for record
     '''
     language = ThesaurusSerializer(many=False, required=False, slug_field='uri') 
-    otherLanguages = ThesaurusSerializer(many=True, slug_field='uri')
-    subjects = ThesaurusSerializer(many=True, slug_field='uri')
-    themes = ThesaurusSerializer(many=True, slug_field='uri')
-    countries = ThesaurusSerializer(many=True, slug_field='uri')
-    projectNames = ThesaurusSerializer(many=True, slug_field='uri')
-    subjectCorporateBodies = ThesaurusSerializer(many=True, slug_field='uri') 
-    corporateAuthors = ThesaurusSerializer(many=True, slug_field='uri')
-    audiences = ThesaurusSerializer(many=True, slug_field='uri')
+    otherLanguages = ThesaurusSerializer(many=True, required=False, slug_field='uri')
+    subjects = ThesaurusSerializer(many=True, required=False, slug_field='uri')
+    themes = ThesaurusSerializer(many=True, required=False, slug_field='uri')
+    countries = ThesaurusSerializer(many=True, required=False, slug_field='uri')
+    projectNames = ThesaurusSerializer(many=True, required=False, slug_field='uri')
+    subjectCorporateBodies = ThesaurusSerializer(many=True, required=False, slug_field='uri') 
+    corporateAuthors = ThesaurusSerializer(many=True, required=False, slug_field='uri')
+    audiences = ThesaurusSerializer(many=True, required=False, slug_field='uri')
 
     class Meta:
         model = Record
         depth = 1
-        read_only_fields = ('identifier', 'uri')
         fields = ("identifier", "uri", "subjects", "notes", "otherLanguages",
                   "language", "editionStatement", "recordType", "isDocumentPart",
                   "hidden", "restricted", "themes", "countries", "projectNames", 
Binary file src/p4l/locale/en/LC_MESSAGES/django.mo has changed
--- a/src/p4l/locale/en/LC_MESSAGES/django.po	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/locale/en/LC_MESSAGES/django.po	Wed Sep 25 22:14:51 2013 +0200
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-22 17:28-0500\n"
+"POT-Creation-Date: 2013-09-24 06:09-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,7 +16,7 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: admin.py:10 forms.py:34 templates/p4l/p4l_record_view.html:55
+#: admin.py:10 forms.py:34 templates/p4l/record_view.html:56
 msgid "language"
 msgstr "language"
 
@@ -52,275 +52,72 @@
 msgid "or"
 msgstr "or"
 
-#: templates/p4l/p4l_base.html:35
+#: templates/p4l/base.html:35
 msgid "logout"
 msgstr "logout"
 
-#: templates/p4l/p4l_base.html:37 templates/registration/login.html:4
+#: templates/p4l/base.html:37 templates/registration/login.html:4
 #: templates/registration/login.html:27
 msgid "login"
 msgstr "login"
 
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:10
+#: templates/p4l/home.html:6 templates/p4l/home.html.py:10
 msgid "Record List"
 msgstr "Record list"
 
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:30
-#: templates/p4l/p4l_home.html:70
+#: templates/p4l/home.html:6 templates/p4l/home.html.py:30
+#: templates/p4l/home.html:70
 msgid "Page"
 msgstr "Page"
 
-#: templates/p4l/p4l_home.html:14
+#: templates/p4l/home.html:14
 msgid "Query"
 msgstr "Query"
 
-#: templates/p4l/p4l_home.html:19
+#: templates/p4l/home.html:19
 msgid "New record"
 msgstr "New record"
 
-#: templates/p4l/p4l_home.html:27 templates/p4l/p4l_home.html.py:67
+#: templates/p4l/home.html:27 templates/p4l/home.html.py:67
 msgid "Previous"
 msgstr "Previous"
 
-#: templates/p4l/p4l_home.html:30 templates/p4l/p4l_home.html.py:70
+#: templates/p4l/home.html:30 templates/p4l/home.html.py:70
 msgid "on"
 msgstr "on"
 
-#: templates/p4l/p4l_home.html:33 templates/p4l/p4l_home.html.py:73
+#: templates/p4l/home.html:33 templates/p4l/home.html.py:73
 msgid "Next"
 msgstr "Next"
 
-#: templates/p4l/p4l_home.html:43 templates/p4l/p4l_record_view.html:35
+#: templates/p4l/home.html:43 templates/p4l/record_view.html:36
 msgid "identifier"
 msgstr "identifier"
 
-#: templates/p4l/p4l_home.html:43 templates/p4l/p4l_record_view.html:63
+#: templates/p4l/home.html:43 templates/p4l/record_view.html:64
 msgid "titles"
 msgstr "titles"
 
-#: templates/p4l/p4l_home.html:43
+#: templates/p4l/home.html:43
 msgid "dates"
 msgstr "dates"
 
-#: templates/p4l/p4l_home.html:43
+#: templates/p4l/home.html:43
 msgid "actions"
 msgstr "actions"
 
-#: templates/p4l/p4l_home.html:59
+#: templates/p4l/home.html:59
 msgid "No record"
 msgstr "No record"
 
-#: templates/p4l/p4l_record_view.html:6
-#: templates/p4l/record_update_form.html:5
+#: templates/p4l/record_update_form.html:5 templates/p4l/record_view.html:7
 msgid "Record"
 msgstr "Record"
 
-#: templates/p4l/p4l_record_view.html:6
-#: templates/p4l/record_update_form.html:5
+#: templates/p4l/record_update_form.html:5 templates/p4l/record_view.html:7
 msgid "View"
 msgstr "View"
 
-#: templates/p4l/p4l_record_view.html:10
-#: templates/p4l/p4l_record_view.html:236 templates/p4l/translations.html:21
-msgid "Edit the record"
-msgstr "Edit the record"
-
-#: templates/p4l/p4l_record_view.html:11
-#: templates/p4l/p4l_record_view.html:237
-#: templates/p4l/record_update_form.html:61
-#: templates/p4l/record_update_form.html:249
-msgid ""
-"Are your sure you want to delete this record ? This action is irreversible."
-msgstr ""
-"Are your sure you want to delete this record ? This action is irreversible."
-
-#: templates/p4l/p4l_record_view.html:11
-#: templates/p4l/p4l_record_view.html:237
-#: templates/p4l/record_update_form.html:61
-#: templates/p4l/record_update_form.html:249
-msgid "Delete the record"
-msgstr "Delete the record"
-
-#: templates/p4l/p4l_record_view.html:15
-msgid "property"
-msgstr "property"
-
-#: templates/p4l/p4l_record_view.html:15
-msgid "value"
-msgstr "value"
-
-#: templates/p4l/p4l_record_view.html:23
-msgid "subjects"
-msgstr "subjects"
-
-#: templates/p4l/p4l_record_view.html:27
-msgid "themes"
-msgstr "themes"
-
-#: templates/p4l/p4l_record_view.html:31
-msgid "countries"
-msgstr "countries"
-
-#: templates/p4l/p4l_record_view.html:39
-msgid "notes"
-msgstr "notes"
-
-#: templates/p4l/p4l_record_view.html:43
-msgid "issns"
-msgstr "issns"
-
-#: templates/p4l/p4l_record_view.html:47
-msgid "isbns"
-msgstr "isbns"
-
-#: templates/p4l/p4l_record_view.html:51
-msgid "document code"
-msgstr "document code"
-
-#: templates/p4l/p4l_record_view.html:59
-msgid "other languages"
-msgstr "other languages"
-
-#: templates/p4l/p4l_record_view.html:67
-msgid "abstracts"
-msgstr "abstracts"
-
-#: templates/p4l/p4l_record_view.html:71
-msgid "added titles"
-msgstr "addes titles"
-
-#: templates/p4l/p4l_record_view.html:75
-msgid "titles main document"
-msgstr "titles main document"
-
-#: templates/p4l/p4l_record_view.html:79
-msgid "edition statement"
-msgstr "edition statement"
-
-#: templates/p4l/p4l_record_view.html:83
-msgid "imprints"
-msgstr "imprints"
-
-#: templates/p4l/p4l_record_view.html:89
-msgid "City"
-msgstr "City"
-
-#: templates/p4l/p4l_record_view.html:90
-msgid "Publisher"
-msgstr "Publisher"
-
-#: templates/p4l/p4l_record_view.html:91
-#: templates/p4l/p4l_record_view.html:137
-#: templates/p4l/p4l_record_view.html:182
-msgid "Date"
-msgstr "Date"
-
-#: templates/p4l/p4l_record_view.html:92
-#: templates/p4l/p4l_record_view.html:112
-msgid "Language"
-msgstr "Language"
-
-#: templates/p4l/p4l_record_view.html:100
-msgid "collations"
-msgstr "collations"
-
-#: templates/p4l/p4l_record_view.html:104
-msgid "volume issues"
-msgstr "volume issues"
-
-#: templates/p4l/p4l_record_view.html:110
-#: templates/p4l/p4l_record_view.html:153
-msgid "Volume"
-msgstr "Volume"
-
-#: templates/p4l/p4l_record_view.html:111
-#: templates/p4l/p4l_record_view.html:135
-#: templates/p4l/p4l_record_view.html:180
-msgid "Number"
-msgstr "Number"
-
-#: templates/p4l/p4l_record_view.html:120
-msgid "project names"
-msgstr "project names"
-
-#: templates/p4l/p4l_record_view.html:124
-msgid "periodicals"
-msgstr "periodicals"
-
-#: templates/p4l/p4l_record_view.html:128
-msgid "meetings"
-msgstr "meetings"
-
-#: templates/p4l/p4l_record_view.html:136
-#: templates/p4l/p4l_record_view.html:181
-msgid "Place"
-msgstr "Place"
-
-#: templates/p4l/p4l_record_view.html:138
-#: templates/p4l/p4l_record_view.html:183
-msgid "Year"
-msgstr "Year"
-
-#: templates/p4l/p4l_record_view.html:146
-msgid "series"
-msgstr "series"
-
-#: templates/p4l/p4l_record_view.html:161
-msgid "authors"
-msgstr "authors"
-
-#: templates/p4l/p4l_record_view.html:165
-msgid "subject persons"
-msgstr "subject persons"
-
-#: templates/p4l/p4l_record_view.html:169
-msgid "subject corporate bodies"
-msgstr "subject corporate bodies"
-
-#: templates/p4l/p4l_record_view.html:173
-msgid "subject meetings"
-msgstr "subject meetings"
-
-#: templates/p4l/p4l_record_view.html:191
-msgid "corporate authors"
-msgstr "corporate authors"
-
-#: templates/p4l/p4l_record_view.html:195
-msgid "corporate author label"
-msgstr "corporate author label"
-
-#: templates/p4l/p4l_record_view.html:199
-msgid "Urls"
-msgstr "Urls"
-
-#: templates/p4l/p4l_record_view.html:205
-msgid "Address"
-msgstr "Address"
-
-#: templates/p4l/p4l_record_view.html:206
-msgid "Display"
-msgstr "Display"
-
-#: templates/p4l/p4l_record_view.html:214
-msgid "record type"
-msgstr "record type"
-
-#: templates/p4l/p4l_record_view.html:218
-msgid "audiences"
-msgstr "audiences"
-
-#: templates/p4l/p4l_record_view.html:222
-msgid "is document part"
-msgstr "is document part"
-
-#: templates/p4l/p4l_record_view.html:226
-msgid "is hidden"
-msgstr "is hidden"
-
-#: templates/p4l/p4l_record_view.html:230
-msgid "is restricted"
-msgstr "is restricted"
-
 #: templates/p4l/record_update_form.html:52 templates/p4l/translations.html:4
 msgid "Save"
 msgstr "Save"
@@ -335,6 +132,199 @@
 msgid "View the record"
 msgstr "View the record"
 
+#: templates/p4l/record_update_form.html:61
+#: templates/p4l/record_update_form.html:249 templates/p4l/record_view.html:12
+#: templates/p4l/record_view.html.py:238
+msgid ""
+"Are your sure you want to delete this record ? This action is irreversible."
+msgstr ""
+"Are your sure you want to delete this record ? This action is irreversible."
+
+#: templates/p4l/record_update_form.html:61
+#: templates/p4l/record_update_form.html:249 templates/p4l/record_view.html:12
+#: templates/p4l/record_view.html.py:238
+msgid "Delete the record"
+msgstr "Delete the record"
+
+#: templates/p4l/record_view.html:11 templates/p4l/record_view.html.py:237
+#: templates/p4l/translations.html:21
+msgid "Edit the record"
+msgstr "Edit the record"
+
+#: templates/p4l/record_view.html:16
+msgid "property"
+msgstr "property"
+
+#: templates/p4l/record_view.html:16
+msgid "value"
+msgstr "value"
+
+#: templates/p4l/record_view.html:24
+msgid "subjects"
+msgstr "subjects"
+
+#: templates/p4l/record_view.html:28
+msgid "themes"
+msgstr "themes"
+
+#: templates/p4l/record_view.html:32
+msgid "countries"
+msgstr "countries"
+
+#: templates/p4l/record_view.html:40
+msgid "notes"
+msgstr "notes"
+
+#: templates/p4l/record_view.html:44
+msgid "issns"
+msgstr "issns"
+
+#: templates/p4l/record_view.html:48
+msgid "isbns"
+msgstr "isbns"
+
+#: templates/p4l/record_view.html:52
+msgid "document code"
+msgstr "document code"
+
+#: templates/p4l/record_view.html:60
+msgid "other languages"
+msgstr "other languages"
+
+#: templates/p4l/record_view.html:68
+msgid "abstracts"
+msgstr "abstracts"
+
+#: templates/p4l/record_view.html:72
+msgid "added titles"
+msgstr "addes titles"
+
+#: templates/p4l/record_view.html:76
+msgid "titles main document"
+msgstr "titles main document"
+
+#: templates/p4l/record_view.html:80
+msgid "edition statement"
+msgstr "edition statement"
+
+#: templates/p4l/record_view.html:84
+msgid "imprints"
+msgstr "imprints"
+
+#: templates/p4l/record_view.html:90
+msgid "City"
+msgstr "City"
+
+#: templates/p4l/record_view.html:91
+msgid "Publisher"
+msgstr "Publisher"
+
+#: templates/p4l/record_view.html:92 templates/p4l/record_view.html.py:138
+#: templates/p4l/record_view.html:183
+msgid "Date"
+msgstr "Date"
+
+#: templates/p4l/record_view.html:93 templates/p4l/record_view.html.py:113
+msgid "Language"
+msgstr "Language"
+
+#: templates/p4l/record_view.html:101
+msgid "collations"
+msgstr "collations"
+
+#: templates/p4l/record_view.html:105
+msgid "volume issues"
+msgstr "volume issues"
+
+#: templates/p4l/record_view.html:111 templates/p4l/record_view.html.py:154
+msgid "Volume"
+msgstr "Volume"
+
+#: templates/p4l/record_view.html:112 templates/p4l/record_view.html.py:136
+#: templates/p4l/record_view.html:181
+msgid "Number"
+msgstr "Number"
+
+#: templates/p4l/record_view.html:121
+msgid "project names"
+msgstr "project names"
+
+#: templates/p4l/record_view.html:125
+msgid "periodicals"
+msgstr "periodicals"
+
+#: templates/p4l/record_view.html:129
+msgid "meetings"
+msgstr "meetings"
+
+#: templates/p4l/record_view.html:137 templates/p4l/record_view.html.py:182
+msgid "Place"
+msgstr "Place"
+
+#: templates/p4l/record_view.html:139 templates/p4l/record_view.html.py:184
+msgid "Year"
+msgstr "Year"
+
+#: templates/p4l/record_view.html:147
+msgid "series"
+msgstr "series"
+
+#: templates/p4l/record_view.html:162
+msgid "authors"
+msgstr "authors"
+
+#: templates/p4l/record_view.html:166
+msgid "subject persons"
+msgstr "subject persons"
+
+#: templates/p4l/record_view.html:170
+msgid "subject corporate bodies"
+msgstr "subject corporate bodies"
+
+#: templates/p4l/record_view.html:174
+msgid "subject meetings"
+msgstr "subject meetings"
+
+#: templates/p4l/record_view.html:192
+msgid "corporate authors"
+msgstr "corporate authors"
+
+#: templates/p4l/record_view.html:196
+msgid "corporate author label"
+msgstr "corporate author label"
+
+#: templates/p4l/record_view.html:200
+msgid "Urls"
+msgstr "Urls"
+
+#: templates/p4l/record_view.html:206
+msgid "Address"
+msgstr "Address"
+
+#: templates/p4l/record_view.html:207
+msgid "Display"
+msgstr "Display"
+
+#: templates/p4l/record_view.html:215
+msgid "record type"
+msgstr "record type"
+
+#: templates/p4l/record_view.html:219
+msgid "audiences"
+msgstr "audiences"
+
+#: templates/p4l/record_view.html:223
+msgid "is document part"
+msgstr "is document part"
+
+#: templates/p4l/record_view.html:227
+msgid "is hidden"
+msgstr "is hidden"
+
+#: templates/p4l/record_view.html:231
+msgid "is restricted"
+msgstr "is restricted"
+
 #: templates/p4l/translations.html:3
 msgid "Add"
 msgstr "Add"
@@ -415,5 +405,5 @@
 msgid "Password"
 msgstr "Password"
 
-msgid "Title"
-msgstr "Title"
+#~ msgid "Title"
+#~ msgstr "Title"
Binary file src/p4l/locale/es/LC_MESSAGES/django.mo has changed
--- a/src/p4l/locale/es/LC_MESSAGES/django.po	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/locale/es/LC_MESSAGES/django.po	Wed Sep 25 22:14:51 2013 +0200
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-22 17:28-0500\n"
+"POT-Creation-Date: 2013-09-24 06:09-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,7 +17,7 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: admin.py:10 forms.py:34 templates/p4l/p4l_record_view.html:55
+#: admin.py:10 forms.py:34 templates/p4l/record_view.html:56
 msgid "language"
 msgstr "language"
 
@@ -53,275 +53,72 @@
 msgid "or"
 msgstr "or"
 
-#: templates/p4l/p4l_base.html:35
+#: templates/p4l/base.html:35
 msgid "logout"
 msgstr "logout"
 
-#: templates/p4l/p4l_base.html:37 templates/registration/login.html:4
+#: templates/p4l/base.html:37 templates/registration/login.html:4
 #: templates/registration/login.html:27
 msgid "login"
 msgstr "login"
 
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:10
+#: templates/p4l/home.html:6 templates/p4l/home.html.py:10
 msgid "Record List"
 msgstr "Record list"
 
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:30
-#: templates/p4l/p4l_home.html:70
+#: templates/p4l/home.html:6 templates/p4l/home.html.py:30
+#: templates/p4l/home.html:70
 msgid "Page"
 msgstr "Page"
 
-#: templates/p4l/p4l_home.html:14
+#: templates/p4l/home.html:14
 msgid "Query"
 msgstr "Query"
 
-#: templates/p4l/p4l_home.html:19
+#: templates/p4l/home.html:19
 msgid "New record"
 msgstr "New record"
 
-#: templates/p4l/p4l_home.html:27 templates/p4l/p4l_home.html.py:67
+#: templates/p4l/home.html:27 templates/p4l/home.html.py:67
 msgid "Previous"
 msgstr "Previous"
 
-#: templates/p4l/p4l_home.html:30 templates/p4l/p4l_home.html.py:70
+#: templates/p4l/home.html:30 templates/p4l/home.html.py:70
 msgid "on"
 msgstr "on"
 
-#: templates/p4l/p4l_home.html:33 templates/p4l/p4l_home.html.py:73
+#: templates/p4l/home.html:33 templates/p4l/home.html.py:73
 msgid "Next"
 msgstr "Next"
 
-#: templates/p4l/p4l_home.html:43 templates/p4l/p4l_record_view.html:35
+#: templates/p4l/home.html:43 templates/p4l/record_view.html:36
 msgid "identifier"
 msgstr "identifier"
 
-#: templates/p4l/p4l_home.html:43 templates/p4l/p4l_record_view.html:63
+#: templates/p4l/home.html:43 templates/p4l/record_view.html:64
 msgid "titles"
 msgstr "titles"
 
-#: templates/p4l/p4l_home.html:43
+#: templates/p4l/home.html:43
 msgid "dates"
 msgstr "dates"
 
-#: templates/p4l/p4l_home.html:43
+#: templates/p4l/home.html:43
 msgid "actions"
 msgstr "actions"
 
-#: templates/p4l/p4l_home.html:59
+#: templates/p4l/home.html:59
 msgid "No record"
 msgstr "No record"
 
-#: templates/p4l/p4l_record_view.html:6
-#: templates/p4l/record_update_form.html:5
+#: templates/p4l/record_update_form.html:5 templates/p4l/record_view.html:7
 msgid "Record"
 msgstr "Record"
 
-#: templates/p4l/p4l_record_view.html:6
-#: templates/p4l/record_update_form.html:5
+#: templates/p4l/record_update_form.html:5 templates/p4l/record_view.html:7
 msgid "View"
 msgstr "View"
 
-#: templates/p4l/p4l_record_view.html:10
-#: templates/p4l/p4l_record_view.html:236 templates/p4l/translations.html:21
-msgid "Edit the record"
-msgstr "Edit the record"
-
-#: templates/p4l/p4l_record_view.html:11
-#: templates/p4l/p4l_record_view.html:237
-#: templates/p4l/record_update_form.html:61
-#: templates/p4l/record_update_form.html:249
-msgid ""
-"Are your sure you want to delete this record ? This action is irreversible."
-msgstr ""
-"Are your sure you want to delete this record ? This action is irreversible."
-
-#: templates/p4l/p4l_record_view.html:11
-#: templates/p4l/p4l_record_view.html:237
-#: templates/p4l/record_update_form.html:61
-#: templates/p4l/record_update_form.html:249
-msgid "Delete the record"
-msgstr "Delete the record"
-
-#: templates/p4l/p4l_record_view.html:15
-msgid "property"
-msgstr "property"
-
-#: templates/p4l/p4l_record_view.html:15
-msgid "value"
-msgstr "value"
-
-#: templates/p4l/p4l_record_view.html:23
-msgid "subjects"
-msgstr "subjects"
-
-#: templates/p4l/p4l_record_view.html:27
-msgid "themes"
-msgstr "themes"
-
-#: templates/p4l/p4l_record_view.html:31
-msgid "countries"
-msgstr "countries"
-
-#: templates/p4l/p4l_record_view.html:39
-msgid "notes"
-msgstr "notes"
-
-#: templates/p4l/p4l_record_view.html:43
-msgid "issns"
-msgstr "issns"
-
-#: templates/p4l/p4l_record_view.html:47
-msgid "isbns"
-msgstr "isbns"
-
-#: templates/p4l/p4l_record_view.html:51
-msgid "document code"
-msgstr "document code"
-
-#: templates/p4l/p4l_record_view.html:59
-msgid "other languages"
-msgstr "other languages"
-
-#: templates/p4l/p4l_record_view.html:67
-msgid "abstracts"
-msgstr "abstracts"
-
-#: templates/p4l/p4l_record_view.html:71
-msgid "added titles"
-msgstr "addes titles"
-
-#: templates/p4l/p4l_record_view.html:75
-msgid "titles main document"
-msgstr "titles main document"
-
-#: templates/p4l/p4l_record_view.html:79
-msgid "edition statement"
-msgstr "edition statement"
-
-#: templates/p4l/p4l_record_view.html:83
-msgid "imprints"
-msgstr "imprints"
-
-#: templates/p4l/p4l_record_view.html:89
-msgid "City"
-msgstr "City"
-
-#: templates/p4l/p4l_record_view.html:90
-msgid "Publisher"
-msgstr "Publisher"
-
-#: templates/p4l/p4l_record_view.html:91
-#: templates/p4l/p4l_record_view.html:137
-#: templates/p4l/p4l_record_view.html:182
-msgid "Date"
-msgstr "Date"
-
-#: templates/p4l/p4l_record_view.html:92
-#: templates/p4l/p4l_record_view.html:112
-msgid "Language"
-msgstr "Language"
-
-#: templates/p4l/p4l_record_view.html:100
-msgid "collations"
-msgstr "collations"
-
-#: templates/p4l/p4l_record_view.html:104
-msgid "volume issues"
-msgstr "volume issues"
-
-#: templates/p4l/p4l_record_view.html:110
-#: templates/p4l/p4l_record_view.html:153
-msgid "Volume"
-msgstr "Volume"
-
-#: templates/p4l/p4l_record_view.html:111
-#: templates/p4l/p4l_record_view.html:135
-#: templates/p4l/p4l_record_view.html:180
-msgid "Number"
-msgstr "Number"
-
-#: templates/p4l/p4l_record_view.html:120
-msgid "project names"
-msgstr "project names"
-
-#: templates/p4l/p4l_record_view.html:124
-msgid "periodicals"
-msgstr "periodicals"
-
-#: templates/p4l/p4l_record_view.html:128
-msgid "meetings"
-msgstr "meetings"
-
-#: templates/p4l/p4l_record_view.html:136
-#: templates/p4l/p4l_record_view.html:181
-msgid "Place"
-msgstr "Place"
-
-#: templates/p4l/p4l_record_view.html:138
-#: templates/p4l/p4l_record_view.html:183
-msgid "Year"
-msgstr "Year"
-
-#: templates/p4l/p4l_record_view.html:146
-msgid "series"
-msgstr "series"
-
-#: templates/p4l/p4l_record_view.html:161
-msgid "authors"
-msgstr "authors"
-
-#: templates/p4l/p4l_record_view.html:165
-msgid "subject persons"
-msgstr "subject persons"
-
-#: templates/p4l/p4l_record_view.html:169
-msgid "subject corporate bodies"
-msgstr "subject corporate bodies"
-
-#: templates/p4l/p4l_record_view.html:173
-msgid "subject meetings"
-msgstr "subject meetings"
-
-#: templates/p4l/p4l_record_view.html:191
-msgid "corporate authors"
-msgstr "corporate authors"
-
-#: templates/p4l/p4l_record_view.html:195
-msgid "corporate author label"
-msgstr "corporate author label"
-
-#: templates/p4l/p4l_record_view.html:199
-msgid "Urls"
-msgstr "Urls"
-
-#: templates/p4l/p4l_record_view.html:205
-msgid "Address"
-msgstr "Address"
-
-#: templates/p4l/p4l_record_view.html:206
-msgid "Display"
-msgstr "Display"
-
-#: templates/p4l/p4l_record_view.html:214
-msgid "record type"
-msgstr "record type"
-
-#: templates/p4l/p4l_record_view.html:218
-msgid "audiences"
-msgstr "audiences"
-
-#: templates/p4l/p4l_record_view.html:222
-msgid "is document part"
-msgstr "is document part"
-
-#: templates/p4l/p4l_record_view.html:226
-msgid "is hidden"
-msgstr "is hidden"
-
-#: templates/p4l/p4l_record_view.html:230
-msgid "is restricted"
-msgstr "is restricted"
-
 #: templates/p4l/record_update_form.html:52 templates/p4l/translations.html:4
 msgid "Save"
 msgstr "Save"
@@ -336,6 +133,199 @@
 msgid "View the record"
 msgstr "View the record"
 
+#: templates/p4l/record_update_form.html:61
+#: templates/p4l/record_update_form.html:249 templates/p4l/record_view.html:12
+#: templates/p4l/record_view.html.py:238
+msgid ""
+"Are your sure you want to delete this record ? This action is irreversible."
+msgstr ""
+"Are your sure you want to delete this record ? This action is irreversible."
+
+#: templates/p4l/record_update_form.html:61
+#: templates/p4l/record_update_form.html:249 templates/p4l/record_view.html:12
+#: templates/p4l/record_view.html.py:238
+msgid "Delete the record"
+msgstr "Delete the record"
+
+#: templates/p4l/record_view.html:11 templates/p4l/record_view.html.py:237
+#: templates/p4l/translations.html:21
+msgid "Edit the record"
+msgstr "Edit the record"
+
+#: templates/p4l/record_view.html:16
+msgid "property"
+msgstr "property"
+
+#: templates/p4l/record_view.html:16
+msgid "value"
+msgstr "value"
+
+#: templates/p4l/record_view.html:24
+msgid "subjects"
+msgstr "subjects"
+
+#: templates/p4l/record_view.html:28
+msgid "themes"
+msgstr "themes"
+
+#: templates/p4l/record_view.html:32
+msgid "countries"
+msgstr "countries"
+
+#: templates/p4l/record_view.html:40
+msgid "notes"
+msgstr "notes"
+
+#: templates/p4l/record_view.html:44
+msgid "issns"
+msgstr "issns"
+
+#: templates/p4l/record_view.html:48
+msgid "isbns"
+msgstr "isbns"
+
+#: templates/p4l/record_view.html:52
+msgid "document code"
+msgstr "document code"
+
+#: templates/p4l/record_view.html:60
+msgid "other languages"
+msgstr "other languages"
+
+#: templates/p4l/record_view.html:68
+msgid "abstracts"
+msgstr "abstracts"
+
+#: templates/p4l/record_view.html:72
+msgid "added titles"
+msgstr "addes titles"
+
+#: templates/p4l/record_view.html:76
+msgid "titles main document"
+msgstr "titles main document"
+
+#: templates/p4l/record_view.html:80
+msgid "edition statement"
+msgstr "edition statement"
+
+#: templates/p4l/record_view.html:84
+msgid "imprints"
+msgstr "imprints"
+
+#: templates/p4l/record_view.html:90
+msgid "City"
+msgstr "City"
+
+#: templates/p4l/record_view.html:91
+msgid "Publisher"
+msgstr "Publisher"
+
+#: templates/p4l/record_view.html:92 templates/p4l/record_view.html.py:138
+#: templates/p4l/record_view.html:183
+msgid "Date"
+msgstr "Date"
+
+#: templates/p4l/record_view.html:93 templates/p4l/record_view.html.py:113
+msgid "Language"
+msgstr "Language"
+
+#: templates/p4l/record_view.html:101
+msgid "collations"
+msgstr "collations"
+
+#: templates/p4l/record_view.html:105
+msgid "volume issues"
+msgstr "volume issues"
+
+#: templates/p4l/record_view.html:111 templates/p4l/record_view.html.py:154
+msgid "Volume"
+msgstr "Volume"
+
+#: templates/p4l/record_view.html:112 templates/p4l/record_view.html.py:136
+#: templates/p4l/record_view.html:181
+msgid "Number"
+msgstr "Number"
+
+#: templates/p4l/record_view.html:121
+msgid "project names"
+msgstr "project names"
+
+#: templates/p4l/record_view.html:125
+msgid "periodicals"
+msgstr "periodicals"
+
+#: templates/p4l/record_view.html:129
+msgid "meetings"
+msgstr "meetings"
+
+#: templates/p4l/record_view.html:137 templates/p4l/record_view.html.py:182
+msgid "Place"
+msgstr "Place"
+
+#: templates/p4l/record_view.html:139 templates/p4l/record_view.html.py:184
+msgid "Year"
+msgstr "Year"
+
+#: templates/p4l/record_view.html:147
+msgid "series"
+msgstr "series"
+
+#: templates/p4l/record_view.html:162
+msgid "authors"
+msgstr "authors"
+
+#: templates/p4l/record_view.html:166
+msgid "subject persons"
+msgstr "subject persons"
+
+#: templates/p4l/record_view.html:170
+msgid "subject corporate bodies"
+msgstr "subject corporate bodies"
+
+#: templates/p4l/record_view.html:174
+msgid "subject meetings"
+msgstr "subject meetings"
+
+#: templates/p4l/record_view.html:192
+msgid "corporate authors"
+msgstr "corporate authors"
+
+#: templates/p4l/record_view.html:196
+msgid "corporate author label"
+msgstr "corporate author label"
+
+#: templates/p4l/record_view.html:200
+msgid "Urls"
+msgstr "Urls"
+
+#: templates/p4l/record_view.html:206
+msgid "Address"
+msgstr "Address"
+
+#: templates/p4l/record_view.html:207
+msgid "Display"
+msgstr "Display"
+
+#: templates/p4l/record_view.html:215
+msgid "record type"
+msgstr "record type"
+
+#: templates/p4l/record_view.html:219
+msgid "audiences"
+msgstr "audiences"
+
+#: templates/p4l/record_view.html:223
+msgid "is document part"
+msgstr "is document part"
+
+#: templates/p4l/record_view.html:227
+msgid "is hidden"
+msgstr "is hidden"
+
+#: templates/p4l/record_view.html:231
+msgid "is restricted"
+msgstr "is restricted"
+
 #: templates/p4l/translations.html:3
 msgid "Add"
 msgstr "Add"
@@ -416,5 +406,5 @@
 msgid "Password"
 msgstr "Password"
 
-msgid "Title"
-msgstr "Title"
+#~ msgid "Title"
+#~ msgstr "Title"
Binary file src/p4l/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/p4l/locale/fr/LC_MESSAGES/django.po	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/locale/fr/LC_MESSAGES/django.po	Wed Sep 25 22:14:51 2013 +0200
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-22 17:28-0500\n"
+"POT-Creation-Date: 2013-09-24 06:09-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,7 +17,7 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
-#: admin.py:10 forms.py:34 templates/p4l/p4l_record_view.html:55
+#: admin.py:10 forms.py:34 templates/p4l/record_view.html:56
 msgid "language"
 msgstr "langue"
 
@@ -54,276 +54,72 @@
 msgid "or"
 msgstr "ou"
 
-#: templates/p4l/p4l_base.html:35
+#: templates/p4l/base.html:35
 msgid "logout"
 msgstr "deconnection"
 
-#: templates/p4l/p4l_base.html:37 templates/registration/login.html:4
+#: templates/p4l/base.html:37 templates/registration/login.html:4
 #: templates/registration/login.html:27
 msgid "login"
 msgstr "connection"
 
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:10
+#: templates/p4l/home.html:6 templates/p4l/home.html.py:10
 msgid "Record List"
 msgstr "Liste notice"
 
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:30
-#: templates/p4l/p4l_home.html:70
+#: templates/p4l/home.html:6 templates/p4l/home.html.py:30
+#: templates/p4l/home.html:70
 msgid "Page"
 msgstr "Page"
 
-#: templates/p4l/p4l_home.html:14
+#: templates/p4l/home.html:14
 msgid "Query"
 msgstr "Requête"
 
-#: templates/p4l/p4l_home.html:19
+#: templates/p4l/home.html:19
 msgid "New record"
 msgstr "Nouvelle notice"
 
-#: templates/p4l/p4l_home.html:27 templates/p4l/p4l_home.html.py:67
+#: templates/p4l/home.html:27 templates/p4l/home.html.py:67
 msgid "Previous"
 msgstr "Préc."
 
-#: templates/p4l/p4l_home.html:30 templates/p4l/p4l_home.html.py:70
+#: templates/p4l/home.html:30 templates/p4l/home.html.py:70
 msgid "on"
 msgstr "sur"
 
-#: templates/p4l/p4l_home.html:33 templates/p4l/p4l_home.html.py:73
+#: templates/p4l/home.html:33 templates/p4l/home.html.py:73
 msgid "Next"
 msgstr "Suiv."
 
-#: templates/p4l/p4l_home.html:43 templates/p4l/p4l_record_view.html:35
+#: templates/p4l/home.html:43 templates/p4l/record_view.html:36
 msgid "identifier"
 msgstr "identifiant"
 
-#: templates/p4l/p4l_home.html:43 templates/p4l/p4l_record_view.html:63
+#: templates/p4l/home.html:43 templates/p4l/record_view.html:64
 msgid "titles"
 msgstr "titres"
 
-#: templates/p4l/p4l_home.html:43
+#: templates/p4l/home.html:43
 msgid "dates"
 msgstr "dates"
 
-#: templates/p4l/p4l_home.html:43
+#: templates/p4l/home.html:43
 msgid "actions"
 msgstr "actions"
 
-#: templates/p4l/p4l_home.html:59
+#: templates/p4l/home.html:59
 msgid "No record"
 msgstr "Pas de notice"
 
-#: templates/p4l/p4l_record_view.html:6
-#: templates/p4l/record_update_form.html:5
+#: templates/p4l/record_update_form.html:5 templates/p4l/record_view.html:7
 msgid "Record"
 msgstr "Notice"
 
-#: templates/p4l/p4l_record_view.html:6
-#: templates/p4l/record_update_form.html:5
+#: templates/p4l/record_update_form.html:5 templates/p4l/record_view.html:7
 msgid "View"
 msgstr "Vue"
 
-#: templates/p4l/p4l_record_view.html:10
-#: templates/p4l/p4l_record_view.html:236 templates/p4l/translations.html:21
-msgid "Edit the record"
-msgstr "Modifier la notice"
-
-#: templates/p4l/p4l_record_view.html:11
-#: templates/p4l/p4l_record_view.html:237
-#: templates/p4l/record_update_form.html:61
-#: templates/p4l/record_update_form.html:249
-msgid ""
-"Are your sure you want to delete this record ? This action is irreversible."
-msgstr ""
-"Êtes-vous sûr sur vouloir effacer cette notice ? Cette action est "
-"irréversible."
-
-#: templates/p4l/p4l_record_view.html:11
-#: templates/p4l/p4l_record_view.html:237
-#: templates/p4l/record_update_form.html:61
-#: templates/p4l/record_update_form.html:249
-msgid "Delete the record"
-msgstr "Effacer la notice"
-
-#: templates/p4l/p4l_record_view.html:15
-msgid "property"
-msgstr "propriété"
-
-#: templates/p4l/p4l_record_view.html:15
-msgid "value"
-msgstr "valeur"
-
-#: templates/p4l/p4l_record_view.html:23
-msgid "subjects"
-msgstr "sujets"
-
-#: templates/p4l/p4l_record_view.html:27
-msgid "themes"
-msgstr "thèmes"
-
-#: templates/p4l/p4l_record_view.html:31
-msgid "countries"
-msgstr "pays"
-
-#: templates/p4l/p4l_record_view.html:39
-msgid "notes"
-msgstr "notes"
-
-#: templates/p4l/p4l_record_view.html:43
-msgid "issns"
-msgstr "issns"
-
-#: templates/p4l/p4l_record_view.html:47
-msgid "isbns"
-msgstr "isbns"
-
-#: templates/p4l/p4l_record_view.html:51
-msgid "document code"
-msgstr "code document"
-
-#: templates/p4l/p4l_record_view.html:59
-msgid "other languages"
-msgstr "autres langues"
-
-#: templates/p4l/p4l_record_view.html:67
-msgid "abstracts"
-msgstr "résumés"
-
-#: templates/p4l/p4l_record_view.html:71
-msgid "added titles"
-msgstr "titres ajoutés"
-
-#: templates/p4l/p4l_record_view.html:75
-msgid "titles main document"
-msgstr "titre doc. principal"
-
-#: templates/p4l/p4l_record_view.html:79
-msgid "edition statement"
-msgstr "déclatation pub."
-
-#: templates/p4l/p4l_record_view.html:83
-msgid "imprints"
-msgstr "impressions"
-
-#: templates/p4l/p4l_record_view.html:89
-msgid "City"
-msgstr "Ville"
-
-#: templates/p4l/p4l_record_view.html:90
-msgid "Publisher"
-msgstr "Éditeur"
-
-#: templates/p4l/p4l_record_view.html:91
-#: templates/p4l/p4l_record_view.html:137
-#: templates/p4l/p4l_record_view.html:182
-msgid "Date"
-msgstr "Date"
-
-#: templates/p4l/p4l_record_view.html:92
-#: templates/p4l/p4l_record_view.html:112
-msgid "Language"
-msgstr "Langue"
-
-#: templates/p4l/p4l_record_view.html:100
-msgid "collations"
-msgstr "paginations"
-
-#: templates/p4l/p4l_record_view.html:104
-msgid "volume issues"
-msgstr "volume de parution"
-
-#: templates/p4l/p4l_record_view.html:110
-#: templates/p4l/p4l_record_view.html:153
-msgid "Volume"
-msgstr "Volume"
-
-#: templates/p4l/p4l_record_view.html:111
-#: templates/p4l/p4l_record_view.html:135
-#: templates/p4l/p4l_record_view.html:180
-msgid "Number"
-msgstr "Nombre"
-
-#: templates/p4l/p4l_record_view.html:120
-msgid "project names"
-msgstr "noms de projet"
-
-#: templates/p4l/p4l_record_view.html:124
-msgid "periodicals"
-msgstr "périodiques"
-
-#: templates/p4l/p4l_record_view.html:128
-msgid "meetings"
-msgstr "réunion"
-
-#: templates/p4l/p4l_record_view.html:136
-#: templates/p4l/p4l_record_view.html:181
-msgid "Place"
-msgstr "Lieu"
-
-#: templates/p4l/p4l_record_view.html:138
-#: templates/p4l/p4l_record_view.html:183
-msgid "Year"
-msgstr "Année"
-
-#: templates/p4l/p4l_record_view.html:146
-msgid "series"
-msgstr "séries"
-
-#: templates/p4l/p4l_record_view.html:161
-msgid "authors"
-msgstr "auteurs"
-
-#: templates/p4l/p4l_record_view.html:165
-msgid "subject persons"
-msgstr "personnes sujets"
-
-#: templates/p4l/p4l_record_view.html:169
-msgid "subject corporate bodies"
-msgstr "personne morale sujets"
-
-#: templates/p4l/p4l_record_view.html:173
-msgid "subject meetings"
-msgstr "réunion sujets"
-
-#: templates/p4l/p4l_record_view.html:191
-msgid "corporate authors"
-msgstr "entités auteurs"
-
-#: templates/p4l/p4l_record_view.html:195
-msgid "corporate author label"
-msgstr "Libellé de l'auteur institutionnel"
-
-#: templates/p4l/p4l_record_view.html:199
-msgid "Urls"
-msgstr "Urls"
-
-#: templates/p4l/p4l_record_view.html:205
-msgid "Address"
-msgstr "Adresse"
-
-#: templates/p4l/p4l_record_view.html:206
-msgid "Display"
-msgstr "Affichage"
-
-#: templates/p4l/p4l_record_view.html:214
-msgid "record type"
-msgstr "type de notice"
-
-#: templates/p4l/p4l_record_view.html:218
-msgid "audiences"
-msgstr "audiences"
-
-#: templates/p4l/p4l_record_view.html:222
-msgid "is document part"
-msgstr "document partiel"
-
-#: templates/p4l/p4l_record_view.html:226
-msgid "is hidden"
-msgstr "caché"
-
-#: templates/p4l/p4l_record_view.html:230
-msgid "is restricted"
-msgstr "restreint"
-
 #: templates/p4l/record_update_form.html:52 templates/p4l/translations.html:4
 msgid "Save"
 msgstr "Enregistrer"
@@ -338,6 +134,200 @@
 msgid "View the record"
 msgstr "Voir la notice"
 
+#: templates/p4l/record_update_form.html:61
+#: templates/p4l/record_update_form.html:249 templates/p4l/record_view.html:12
+#: templates/p4l/record_view.html.py:238
+msgid ""
+"Are your sure you want to delete this record ? This action is irreversible."
+msgstr ""
+"Êtes-vous sûr sur vouloir effacer cette notice ? Cette action est "
+"irréversible."
+
+#: templates/p4l/record_update_form.html:61
+#: templates/p4l/record_update_form.html:249 templates/p4l/record_view.html:12
+#: templates/p4l/record_view.html.py:238
+msgid "Delete the record"
+msgstr "Effacer la notice"
+
+#: templates/p4l/record_view.html:11 templates/p4l/record_view.html.py:237
+#: templates/p4l/translations.html:21
+msgid "Edit the record"
+msgstr "Modifier la notice"
+
+#: templates/p4l/record_view.html:16
+msgid "property"
+msgstr "propriété"
+
+#: templates/p4l/record_view.html:16
+msgid "value"
+msgstr "valeur"
+
+#: templates/p4l/record_view.html:24
+msgid "subjects"
+msgstr "sujets"
+
+#: templates/p4l/record_view.html:28
+msgid "themes"
+msgstr "thèmes"
+
+#: templates/p4l/record_view.html:32
+msgid "countries"
+msgstr "pays"
+
+#: templates/p4l/record_view.html:40
+msgid "notes"
+msgstr "notes"
+
+#: templates/p4l/record_view.html:44
+msgid "issns"
+msgstr "issns"
+
+#: templates/p4l/record_view.html:48
+msgid "isbns"
+msgstr "isbns"
+
+#: templates/p4l/record_view.html:52
+msgid "document code"
+msgstr "code document"
+
+#: templates/p4l/record_view.html:60
+msgid "other languages"
+msgstr "autres langues"
+
+#: templates/p4l/record_view.html:68
+msgid "abstracts"
+msgstr "résumés"
+
+#: templates/p4l/record_view.html:72
+msgid "added titles"
+msgstr "titres ajoutés"
+
+#: templates/p4l/record_view.html:76
+msgid "titles main document"
+msgstr "titre doc. principal"
+
+#: templates/p4l/record_view.html:80
+msgid "edition statement"
+msgstr "déclatation pub."
+
+#: templates/p4l/record_view.html:84
+msgid "imprints"
+msgstr "impressions"
+
+#: templates/p4l/record_view.html:90
+msgid "City"
+msgstr "Ville"
+
+#: templates/p4l/record_view.html:91
+msgid "Publisher"
+msgstr "Éditeur"
+
+#: templates/p4l/record_view.html:92 templates/p4l/record_view.html.py:138
+#: templates/p4l/record_view.html:183
+msgid "Date"
+msgstr "Date"
+
+#: templates/p4l/record_view.html:93 templates/p4l/record_view.html.py:113
+msgid "Language"
+msgstr "Langue"
+
+#: templates/p4l/record_view.html:101
+msgid "collations"
+msgstr "paginations"
+
+#: templates/p4l/record_view.html:105
+msgid "volume issues"
+msgstr "volume de parution"
+
+#: templates/p4l/record_view.html:111 templates/p4l/record_view.html.py:154
+msgid "Volume"
+msgstr "Volume"
+
+#: templates/p4l/record_view.html:112 templates/p4l/record_view.html.py:136
+#: templates/p4l/record_view.html:181
+msgid "Number"
+msgstr "Nombre"
+
+#: templates/p4l/record_view.html:121
+msgid "project names"
+msgstr "noms de projet"
+
+#: templates/p4l/record_view.html:125
+msgid "periodicals"
+msgstr "périodiques"
+
+#: templates/p4l/record_view.html:129
+msgid "meetings"
+msgstr "réunion"
+
+#: templates/p4l/record_view.html:137 templates/p4l/record_view.html.py:182
+msgid "Place"
+msgstr "Lieu"
+
+#: templates/p4l/record_view.html:139 templates/p4l/record_view.html.py:184
+msgid "Year"
+msgstr "Année"
+
+#: templates/p4l/record_view.html:147
+msgid "series"
+msgstr "séries"
+
+#: templates/p4l/record_view.html:162
+msgid "authors"
+msgstr "auteurs"
+
+#: templates/p4l/record_view.html:166
+msgid "subject persons"
+msgstr "personnes sujets"
+
+#: templates/p4l/record_view.html:170
+msgid "subject corporate bodies"
+msgstr "personne morale sujets"
+
+#: templates/p4l/record_view.html:174
+msgid "subject meetings"
+msgstr "réunion sujets"
+
+#: templates/p4l/record_view.html:192
+msgid "corporate authors"
+msgstr "entités auteurs"
+
+#: templates/p4l/record_view.html:196
+msgid "corporate author label"
+msgstr "Libellé de l'auteur institutionnel"
+
+#: templates/p4l/record_view.html:200
+msgid "Urls"
+msgstr "Urls"
+
+#: templates/p4l/record_view.html:206
+msgid "Address"
+msgstr "Adresse"
+
+#: templates/p4l/record_view.html:207
+msgid "Display"
+msgstr "Affichage"
+
+#: templates/p4l/record_view.html:215
+msgid "record type"
+msgstr "type de notice"
+
+#: templates/p4l/record_view.html:219
+msgid "audiences"
+msgstr "audiences"
+
+#: templates/p4l/record_view.html:223
+msgid "is document part"
+msgstr "document partiel"
+
+#: templates/p4l/record_view.html:227
+msgid "is hidden"
+msgstr "caché"
+
+#: templates/p4l/record_view.html:231
+msgid "is restricted"
+msgstr "restreint"
+
 #: templates/p4l/translations.html:3
 msgid "Add"
 msgstr "Ajouter"
--- a/src/p4l/search/index.py	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/search/index.py	Wed Sep 25 22:14:51 2013 +0200
@@ -29,7 +29,7 @@
         else:
             missing_uris.append(uri)
             
-    new_labels = get_labels_for_uris(missing_uris, settings.RDF_SCHEMES['organization'], None, True)
+    new_labels = get_labels_for_uris(missing_uris, settings.RDF_SCHEMES['organizations'], None, True)
     for k,v in new_labels.iteritems():
         cache.set(safe_cache_key(k),v)
         res[k] = v
--- a/src/p4l/search/views.py	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/search/views.py	Wed Sep 25 22:14:51 2013 +0200
@@ -16,7 +16,7 @@
     
     def __init__(self, template=None, load_all=True, form_class=None, searchqueryset=None, context_class=RequestContext, results_per_page=None):
         record_searchQuerySet = SearchQuerySet().order_by('identifier')
-        template = "p4l/p4l_home.html"
+        template = "p4l/home.html"
         results_per_page= settings.NB_RECORDS_BY_PAGE
         form_class = RecordSearchForm
         SearchView.__init__(self, template=template, load_all=False, form_class=form_class, searchqueryset=record_searchQuerySet, context_class=context_class, results_per_page=results_per_page)
--- a/src/p4l/settings.py	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/settings.py	Wed Sep 25 22:14:51 2013 +0200
@@ -199,354 +199,17 @@
 }
 
 
-SPARQL_QUERY_ENDPOINT = "http://localhost:8080/openrdf-sesame/repositories/plan4learning"
-SPARQL_SUBJECT_QUERIES = {
-"filter" : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept.
-    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
-    ?uri skos:prefLabel ?label.
-    FILTER (lang(?label) = %s).
-    ?uri skos:prefLabel ?lab.
-    FILTER regex (str(?lab), ?reg, 'i').
-    FILTER (lang (?lab) = %s).
-    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
-    BIND (STRLEN(STR(?lab)) AS ?len)
-}
-ORDER BY ?place ?len ?lab
-""",
-"root" : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?type
-WHERE {
-    ?uri a skos:Collection ;
-    skos:inScheme <http://skos.um.es/unescothes/CS000> ;
-    skos:prefLabel|rdfs:label ?label ;
-    rdf:type ?type ;
-    FILTER (lang(?label) = %s). 
-    FILTER NOT EXISTS { [skos:member ?uri] }.
-}
-ORDER BY ?label
-""",
-"childs" : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?type
-WHERE {
-  ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
-  { ?uri a ?type
-    FILTER (?type = skos:Collection || ?type = skos:Concept) }.
-  ?root skos:narrower|skos:member ?uri.
-  ?uri skos:prefLabel|rdfs:label ?label.
-  FILTER (lang(?label) = %s).
-}
-ORDER BY ?label
-""",
-"child-count" : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT (COUNT(?uri) as ?nb)
-WHERE {
-    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
-    ?root skos:narrower|skos:member ?uri.
-}
-"""
-}
-SPARQL_THEME_QUERIES = {
-'filter' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept.
-    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
-    ?uri skos:prefLabel ?label.
-    FILTER (lang(?label) = %s).
-    ?uri skos:prefLabel ?lab.
-    FILTER regex (str(?lab), ?reg, 'i').
-    FILTER (lang (?lab) = %s).
-    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
-    BIND (STRLEN(STR(?lab)) AS ?len)
-}
-ORDER BY ?place ?len ?lab
-""",
-'root' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?type
-WHERE {
-    ?uri a skos:Collection ;
-    skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> ;    
-    skos:prefLabel|rdfs:label ?label ;
-    rdf:type ?type ;
-    FILTER (lang(?label) = %s). 
-    FILTER NOT EXISTS { [skos:member ?uri] }
-}
-ORDER BY ?label
-""",
-'childs' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?type
-WHERE {
-  ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
-  { ?uri a ?type
-    FILTER (?type = skos:Collection || ?type = skos:Concept) }.
-  ?root skos:narrower|skos:member ?uri.
-  ?uri skos:prefLabel|rdfs:label ?label.
-  FILTER (lang(?label) = %s).
-}
-ORDER BY ?label
-""",
-'child-count' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT (COUNT(?uri) as ?nb)
-WHERE {
-    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
-    ?root skos:narrower|skos:member ?uri.
-}
-"""
-}
-SPARQL_COUNTRY_QUERIES = {
-'filter' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept.
-    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> .
-    ?uri skos:prefLabel ?label.
-    FILTER (lang(?label) = %s).
-    ?uri skos:prefLabel ?lab.
-    FILTER regex (str(?lab), ?reg, 'i').
-    FILTER (lang (?lab) = %s).
-    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
-    BIND (STRLEN(STR(?lab)) AS ?len)
-}
-ORDER BY ?place ?len ?lab
-""",
-'root' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept ;
-    skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> ;    
-    skos:prefLabel ?label .
-    FILTER (lang(?label) = %s). 
-    FILTER NOT EXISTS { [skos:narrower ?uri] }
-}
-ORDER BY ?label
-""",
-'childs' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-  ?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> .
-  { ?uri a ?type
-    FILTER (?type = skos:Collection || ?type = skos:Concept) }.
-  ?root skos:narrower|skos:member ?uri.
-  ?uri skos:prefLabel|rdfs:label ?label.
-  FILTER (lang(?label) = %s).
-}
-ORDER BY ?label
-""",
-'child-count' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT (COUNT(?uri) as ?nb)
-WHERE {
-    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> .
-    ?root skos:narrower|skos:member ?uri.
-}
-"""
-}
-SPARQL_LANGUAGE_QUERIES = {
-'filter' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept.
-    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Languages> .
-    ?uri skos:prefLabel ?label.
-    FILTER (lang(?label) = %s).
-    ?uri skos:prefLabel ?lab.
-    FILTER regex (str(?lab), ?reg, 'i').
-    FILTER (lang (?lab) = %s).
-    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
-    BIND (STRLEN(STR(?lab)) AS ?len)
-}
-ORDER BY ?place ?len ?lab
-""",
-'root' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept ;
-    skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Languages> ;    
-    skos:prefLabel ?label .
-    FILTER (lang(?label) = %s). 
-    FILTER NOT EXISTS { [skos:narrower ?uri] }
-}
-ORDER BY ?label
-"""
-}
-SPARQL_PROJECT_QUERIES = {
-'filter' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?acro
-WHERE {
-    ?uri a skos:Concept.
-    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> .
-    ?uri skos:prefLabel ?label.
-    ?uri skos:prefLabel ?lab.
-    OPTIONAL { ?uri skos:altLabel ?acro }.
-    FILTER regex (str(?lab), ?reg, 'i').
-    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
-    BIND (STRLEN(STR(?lab)) AS ?len)
-}
-ORDER BY ?place ?len ?lab
-""",
-'root' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?acro
-WHERE {
-    ?uri a skos:Concept ;
-    skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> ;    
-    skos:prefLabel ?label .
-    OPTIONAL { ?uri skos:altLabel ?acro }
-}
-ORDER BY ?label
-"""
-}
-SPARQL_ORGANIZATION_QUERIES = {
-'filter' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?acro
-WHERE {
-    ?uri a skos:Concept.
-    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> .
-    ?uri skos:prefLabel ?label.
-    ?uri skos:prefLabel ?lab.
-    OPTIONAL { ?uri skos:altLabel ?acro }.
-    FILTER regex (str(?lab), ?reg, 'i').
-    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
-    BIND (STRLEN(STR(?lab)) AS ?len)
-}
-ORDER BY ?place ?len ?lab
-""",
-'root' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label ?acro
-WHERE {
-    ?uri a skos:Concept ;
-    skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> ;    
-    skos:prefLabel ?label .
-    OPTIONAL { ?uri skos:altLabel ?acro }
-}
-ORDER BY ?label
-"""
-}
-SPARQL_TYPE_QUERIES = {
-'filter' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept.
-    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> .
-    ?uri skos:prefLabel ?label.
-    FILTER (lang(?label) = %s).
-    ?uri skos:prefLabel ?lab.
-    FILTER regex (str(?lab), ?reg, 'i').
-    FILTER (lang (?lab) = %s).
-    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
-    BIND (STRLEN(STR(?lab)) AS ?len)
-}
-ORDER BY ?place ?len ?lab
-""",
-'root' : """
-PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
-PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX owl:<http://www.w3.org/2002/07/owl#>
-PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
-SELECT DISTINCT ?uri ?label
-WHERE {
-    ?uri a skos:Concept ;
-    skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> ;    
-    skos:prefLabel ?label .
-    FILTER (lang(?label) = %s). 
-    FILTER NOT EXISTS { [skos:narrower ?uri] }
-}
-ORDER BY ?label
-"""
-}
-SPARQL_AUDIENCE_QUERIES = {
-"filter" : "",
-"root" : "",
-"childs" : "",
-"child-count" : ""
-}
+
 
-RDF_SCHEMES = {
-    'organization': 'http://www.iiep.unesco.org/plan4learning/scheme/Organizations',
-    'audience': '',
-    'language': 'http://www.iiep.unesco.org/plan4learning/scheme/Languages',
-    'type': 'http://www.iiep.unesco.org/plan4learning/scheme/DocumentType',
-    'subject': 'http://skos.um.es/unescothes/CS000',
-    'theme': 'http://www.iiep.unesco.org/plan4learning/scheme/Themes',
-    'country': 'http://skos.um.es/unescothes/CS000/Countries',    
-    'project': 'http://www.iiep.unesco.org/plan4learning/scheme/Projects'
+RDF_SCHEMES = { 
+    'organizations': 'http://www.iiep.unesco.org/plan4learning/scheme/Organizations',
+    'audiences': '',
+    'languages': 'http://www.iiep.unesco.org/plan4learning/scheme/Languages',
+    'types': 'http://www.iiep.unesco.org/plan4learning/scheme/DocumentType',
+    'subjects': 'http://skos.um.es/unescothes/CS000',
+    'themes': 'http://www.iiep.unesco.org/plan4learning/scheme/Themes',
+    'countries': 'http://skos.um.es/unescothes/CS000/Countries',    
+    'projects': 'http://www.iiep.unesco.org/plan4learning/scheme/Projects'
 }
 
 REST_FRAMEWORK = {
@@ -566,195 +229,195 @@
 }
 
 LANGUAGES_LIST = [
-(u"French","fr"),
-(u"English","en"),
-(u"Spanish; Castilian","es"),
-(u"",""),
-(u"Abkhaz","ab"),
-(u"Afar","aa"),
-(u"Afrikaans","af"),
-(u"Akan","ak"),
-(u"Albanian","sq"),
-(u"Amharic","am"),
-(u"Arabic","ar"),
-(u"Aragonese","an"),
-(u"Armenian","hy"),
-(u"Assamese","as"),
-(u"Avaric","av"),
-(u"Avestan","ae"),
-(u"Aymara","ay"),
-(u"Azerbaijani","az"),
-(u"Bambara","bm"),
-(u"Bashkir","ba"),
-(u"Basque","eu"),
-(u"Belarusian","be"),
-(u"Bengali; Bangla","bn"),
-(u"Bihari","bh"),
-(u"Bislama","bi"),
-(u"Bosnian","bs"),
-(u"Breton","br"),
-(u"Bulgarian","bg"),
-(u"Burmese","my"),
-(u"Catalan","ca"),
-(u"Chamorro","ch"),
-(u"Chechen","ce"),
-(u"Chichewa; Chewa; Nyanja","ny"),
-(u"Chinese","zh"),
-(u"Chuvash","cv"),
-(u"Cornish","kw"),
-(u"Corsican","co"),
-(u"Cree","cr"),
-(u"Croatian","hr"),
-(u"Czech","cs"),
-(u"Danish","da"),
-(u"Divehi; Dhivehi; Maldivian;","dv"),
-(u"Dutch","nl"),
-(u"Dzongkha","dz"),
-(u"English","en"),
-(u"Esperanto","eo"),
-(u"Estonian","et"),
-(u"Ewe","ee"),
-(u"Faroese","fo"),
-(u"Fijian","fj"),
-(u"Finnish","fi"),
-(u"French","fr"),
-(u"Fula; Fulah; Pulaar; Pular","ff"),
-(u"Galician","gl"),
-(u"Ganda","lg"),
-(u"Georgian","ka"),
-(u"German","de"),
-(u"Greek Modern","el"),
-(u"Guarani","gn"),
-(u"Gujarati","gu"),
-(u"Haitian; Haitian Creole","ht"),
-(u"Hausa","ha"),
-(u"Hebrew","he"),
-(u"Herero","hz"),
-(u"Hindi","hi"),
-(u"Hiri Motu","ho"),
-(u"Hungarian","hu"),
-(u"Icelandic","is"),
-(u"Ido","io"),
-(u"Igbo","ig"),
-(u"Indonesian","id"),
-(u"Interlingua","ia"),
-(u"Interlingue","ie"),
-(u"Inuktitut","iu"),
-(u"Inupiaq","ik"),
-(u"Irish","ga"),
-(u"Italian","it"),
-(u"Japanese","ja"),
-(u"Javanese","jv"),
-(u"Kalaallisut; Greenlandic","kl"),
-(u"Kannada","kn"),
-(u"Kanuri","kr"),
-(u"Kashmiri","ks"),
-(u"Kazakh","kk"),
-(u"Khmer","km"),
-(u"Kikuyu; Gikuyu","ki"),
-(u"Kinyarwanda","rw"),
-(u"Kirundi","rn"),
-(u"Komi","kv"),
-(u"Kongo","kg"),
-(u"Korean","ko"),
-(u"Kurdish","ku"),
-(u"Kwanyama; Kuanyama","kj"),
-(u"Kyrgyz","ky"),
-(u"Lao","lo"),
-(u"Latin","la"),
-(u"Latvian","lv"),
-(u"Limburgish; Limburgan; Limburger","li"),
-(u"Lingala","ln"),
-(u"Lithuanian","lt"),
-(u"Luba-Katanga","lu"),
-(u"Luxembourgish; Letzeburgesch","lb"),
-(u"Macedonian","mk"),
-(u"Malagasy","mg"),
-(u"Malay","ms"),
-(u"Malayalam","ml"),
-(u"Maltese","mt"),
-(u"Manx","gv"),
-(u"Marathi","mr"),
-(u"Marshallese","mh"),
-(u"Mongolian","mn"),
-(u"Maori","mi"),
-(u"Nauru","na"),
-(u"Navajo; Navaho","nv"),
-(u"Ndonga","ng"),
-(u"Nepali","ne"),
-(u"North Ndebele","nd"),
-(u"Northern Sami","se"),
-(u"Norwegian","no"),
-(u"Norwegian Bokmal","nb"),
-(u"Norwegian Nynorsk","nn"),
-(u"Nuosu","ii"),
-(u"Occitan","oc"),
-(u"Ojibwe; Ojibwa","oj"),
-(u"Church Slavic; Church Slavonic","cu"),
-(u"Oriya","or"),
-(u"Oromo","om"),
-(u"Ossetian; Ossetic","os"),
-(u"Panjabi; Punjabi","pa"),
-(u"Pashto; Pushto","ps"),
-(u"Persian","fa"),
-(u"Polish","pl"),
-(u"Portuguese","pt"),
-(u"Pali","pi"),
-(u"Quechua","qu"),
-(u"Romanian; Moldavian","ro"),
-(u"Romansh","rm"),
-(u"Russian","ru"),
-(u"Samoan","sm"),
-(u"Sango","sg"),
+(u"French", "fr"),
+(u"English", "en"),
+(u"Spanish; Castilian", "es"),
+(u"", ""),
+(u"Abkhaz", "ab"),
+(u"Afar", "aa"),
+(u"Afrikaans", "af"),
+(u"Akan", "ak"),
+(u"Albanian", "sq"),
+(u"Amharic", "am"),
+(u"Arabic", "ar"),
+(u"Aragonese", "an"),
+(u"Armenian", "hy"),
+(u"Assamese", "as"),
+(u"Avaric", "av"),
+(u"Avestan", "ae"),
+(u"Aymara", "ay"),
+(u"Azerbaijani", "az"),
+(u"Bambara", "bm"),
+(u"Bashkir", "ba"),
+(u"Basque", "eu"),
+(u"Belarusian", "be"),
+(u"Bengali; Bangla", "bn"),
+(u"Bihari", "bh"),
+(u"Bislama", "bi"),
+(u"Bosnian", "bs"),
+(u"Breton", "br"),
+(u"Bulgarian", "bg"),
+(u"Burmese", "my"),
+(u"Catalan", "ca"),
+(u"Chamorro", "ch"),
+(u"Chechen", "ce"),
+(u"Chichewa; Chewa; Nyanja", "ny"),
+(u"Chinese", "zh"),
+(u"Chuvash", "cv"),
+(u"Cornish", "kw"),
+(u"Corsican", "co"),
+(u"Cree", "cr"),
+(u"Croatian", "hr"),
+(u"Czech", "cs"),
+(u"Danish", "da"),
+(u"Divehi; Dhivehi; Maldivian;", "dv"),
+(u"Dutch", "nl"),
+(u"Dzongkha", "dz"),
+(u"English", "en"),
+(u"Esperanto", "eo"),
+(u"Estonian", "et"),
+(u"Ewe", "ee"),
+(u"Faroese", "fo"),
+(u"Fijian", "fj"),
+(u"Finnish", "fi"),
+(u"French", "fr"),
+(u"Fula; Fulah; Pulaar; Pular", "ff"),
+(u"Galician", "gl"),
+(u"Ganda", "lg"),
+(u"Georgian", "ka"),
+(u"German", "de"),
+(u"Greek Modern", "el"),
+(u"Guarani", "gn"),
+(u"Gujarati", "gu"),
+(u"Haitian; Haitian Creole", "ht"),
+(u"Hausa", "ha"),
+(u"Hebrew", "he"),
+(u"Herero", "hz"),
+(u"Hindi", "hi"),
+(u"Hiri Motu", "ho"),
+(u"Hungarian", "hu"),
+(u"Icelandic", "is"),
+(u"Ido", "io"),
+(u"Igbo", "ig"),
+(u"Indonesian", "id"),
+(u"Interlingua", "ia"),
+(u"Interlingue", "ie"),
+(u"Inuktitut", "iu"),
+(u"Inupiaq", "ik"),
+(u"Irish", "ga"),
+(u"Italian", "it"),
+(u"Japanese", "ja"),
+(u"Javanese", "jv"),
+(u"Kalaallisut; Greenlandic", "kl"),
+(u"Kannada", "kn"),
+(u"Kanuri", "kr"),
+(u"Kashmiri", "ks"),
+(u"Kazakh", "kk"),
+(u"Khmer", "km"),
+(u"Kikuyu; Gikuyu", "ki"),
+(u"Kinyarwanda", "rw"),
+(u"Kirundi", "rn"),
+(u"Komi", "kv"),
+(u"Kongo", "kg"),
+(u"Korean", "ko"),
+(u"Kurdish", "ku"),
+(u"Kwanyama; Kuanyama", "kj"),
+(u"Kyrgyz", "ky"),
+(u"Lao", "lo"),
+(u"Latin", "la"),
+(u"Latvian", "lv"),
+(u"Limburgish; Limburgan; Limburger", "li"),
+(u"Lingala", "ln"),
+(u"Lithuanian", "lt"),
+(u"Luba-Katanga", "lu"),
+(u"Luxembourgish; Letzeburgesch", "lb"),
+(u"Macedonian", "mk"),
+(u"Malagasy", "mg"),
+(u"Malay", "ms"),
+(u"Malayalam", "ml"),
+(u"Maltese", "mt"),
+(u"Manx", "gv"),
+(u"Marathi", "mr"),
+(u"Marshallese", "mh"),
+(u"Mongolian", "mn"),
+(u"Maori", "mi"),
+(u"Nauru", "na"),
+(u"Navajo; Navaho", "nv"),
+(u"Ndonga", "ng"),
+(u"Nepali", "ne"),
+(u"North Ndebele", "nd"),
+(u"Northern Sami", "se"),
+(u"Norwegian", "no"),
+(u"Norwegian Bokmal", "nb"),
+(u"Norwegian Nynorsk", "nn"),
+(u"Nuosu", "ii"),
+(u"Occitan", "oc"),
+(u"Ojibwe; Ojibwa", "oj"),
+(u"Church Slavic; Church Slavonic", "cu"),
+(u"Oriya", "or"),
+(u"Oromo", "om"),
+(u"Ossetian; Ossetic", "os"),
+(u"Panjabi; Punjabi", "pa"),
+(u"Pashto; Pushto", "ps"),
+(u"Persian", "fa"),
+(u"Polish", "pl"),
+(u"Portuguese", "pt"),
+(u"Pali", "pi"),
+(u"Quechua", "qu"),
+(u"Romanian; Moldavian", "ro"),
+(u"Romansh", "rm"),
+(u"Russian", "ru"),
+(u"Samoan", "sm"),
+(u"Sango", "sg"),
 (u"Sanskrit (Samskrta),sa"),
-(u"Sardinian","sc"),
-(u"Scottish Gaelic; Gaelic","gd"),
-(u"Serbian","sr"),
-(u"Shona","sn"),
-(u"Sindhi","sd"),
-(u"Sinhala; Sinhalese","si"),
-(u"Slovak","sk"),
-(u"Slovene","sl"),
-(u"Somali","so"),
-(u"South Azerbaijani","az"),
-(u"South Ndebele","nr"),
-(u"Southern Sotho","st"),
-(u"Spanish; Castilian","es"),
-(u"Sundanese","su"),
-(u"Swahili","sw"),
-(u"Swati","ss"),
-(u"Swedish","sv"),
-(u"Tagalog","tl"),
-(u"Tahitian","ty"),
-(u"Tajik","tg"),
-(u"Tamil","ta"),
-(u"Tatar","tt"),
-(u"Telugu","te"),
-(u"Thai","th"),
-(u"Tibetan","bo"),
-(u"Tigrinya","ti"),
-(u"Tonga","to"),
-(u"Tsonga","ts"),
-(u"Tswana","tn"),
-(u"Turkish","tr"),
-(u"Turkmen","tk"),
-(u"Twi","tw"),
-(u"Ukrainian","uk"),
-(u"Urdu","ur"),
-(u"Uyghur; Uighur","ug"),
-(u"Uzbek","uz"),
-(u"Venda","ve"),
-(u"Vietnamese","vi"),
-(u"Volapuk","vo"),
-(u"Walloon","wa"),
-(u"Welsh","cy"),
-(u"Western Frisian","fy"),
-(u"Wolof","wo"),
-(u"Xhosa","xh"),
-(u"Yiddish","yi"),
-(u"Yoruba","yo"),
-(u"Zhuang; Chuang","za"),
-(u"Zulu","zu")]
+(u"Sardinian", "sc"),
+(u"Scottish Gaelic; Gaelic", "gd"),
+(u"Serbian", "sr"),
+(u"Shona", "sn"),
+(u"Sindhi", "sd"),
+(u"Sinhala; Sinhalese", "si"),
+(u"Slovak", "sk"),
+(u"Slovene", "sl"),
+(u"Somali", "so"),
+(u"South Azerbaijani", "az"),
+(u"South Ndebele", "nr"),
+(u"Southern Sotho", "st"),
+(u"Spanish; Castilian", "es"),
+(u"Sundanese", "su"),
+(u"Swahili", "sw"),
+(u"Swati", "ss"),
+(u"Swedish", "sv"),
+(u"Tagalog", "tl"),
+(u"Tahitian", "ty"),
+(u"Tajik", "tg"),
+(u"Tamil", "ta"),
+(u"Tatar", "tt"),
+(u"Telugu", "te"),
+(u"Thai", "th"),
+(u"Tibetan", "bo"),
+(u"Tigrinya", "ti"),
+(u"Tonga", "to"),
+(u"Tsonga", "ts"),
+(u"Tswana", "tn"),
+(u"Turkish", "tr"),
+(u"Turkmen", "tk"),
+(u"Twi", "tw"),
+(u"Ukrainian", "uk"),
+(u"Urdu", "ur"),
+(u"Uyghur; Uighur", "ug"),
+(u"Uzbek", "uz"),
+(u"Venda", "ve"),
+(u"Vietnamese", "vi"),
+(u"Volapuk", "vo"),
+(u"Walloon", "wa"),
+(u"Welsh", "cy"),
+(u"Western Frisian", "fy"),
+(u"Wolof", "wo"),
+(u"Xhosa", "xh"),
+(u"Yiddish", "yi"),
+(u"Yoruba", "yo"),
+(u"Zhuang; Chuang", "za"),
+(u"Zulu", "zu")]
 
 from config import *  # @UnusedWildImport
 
@@ -767,4 +430,356 @@
 if not "LOGIN_REDIRECT_URL" in locals():
     LOGIN_REDIRECT_URL = SRC_BASE_URL
 if not "LOGOUT_REDIRECT_URL" in locals():
-    LOGOUT_REDIRECT_URL = SRC_BASE_URL + 'auth/login'     
+    LOGOUT_REDIRECT_URL = SRC_BASE_URL + 'auth/login'
+
+if not "SPARQL_QUERY_ENDPOINT" in locals():    
+    SPARQL_QUERY_ENDPOINT = "http://localhost:8080/openrdf-sesame/repositories/plan4learning"
+
+if not "SPARQL_REF_QUERIES" in locals():
+    SPARQL_REF_QUERIES = {
+        'subjects': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            'filter' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept.
+                    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
+                    ?uri skos:prefLabel ?label.
+                    FILTER (lang(?label) = {lang}).
+                    ?uri skos:prefLabel ?lab.
+                    FILTER regex (str(?lab), ?reg, 'i').
+                    FILTER (lang (?lab) = {lang}).
+                    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
+                    BIND (STRLEN(STR(?lab)) AS ?len)
+                }}
+                ORDER BY ?place ?len ?lab
+            """,
+            "root" : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?type
+                WHERE {{
+                    ?uri a skos:Collection ;
+                         skos:inScheme <http://skos.um.es/unescothes/CS000> ;
+                         skos:prefLabel|rdfs:label ?label ;
+                         rdf:type ?type .
+                    FILTER (lang(?label) = {lang}). 
+                    FILTER NOT EXISTS {{ [skos:member ?uri] }}.
+                }}
+                ORDER BY ?label
+            """,
+            "childs" : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?type
+                WHERE {{
+                  ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
+                  {{ ?uri a ?type
+                    FILTER (?type = skos:Collection || ?type = skos:Concept) }}.
+                  ?root skos:narrower|skos:member ?uri.
+                  ?uri skos:prefLabel|rdfs:label ?label.
+                  FILTER (lang(?label) = {lang}).
+                }}
+                ORDER BY ?label
+            """,
+            "child-count" : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT (COUNT(?uri) as ?nb)
+                WHERE {{
+                    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
+                    ?root skos:narrower|skos:member ?uri.
+                }}
+            """
+        },
+        'themes': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            'filter' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept.
+                    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
+                    ?uri skos:prefLabel ?label.
+                    FILTER (lang(?label) = {lang}).
+                    ?uri skos:prefLabel ?lab.
+                    FILTER regex (str(?lab), ?reg, 'i').
+                    FILTER (lang (?lab) = {lang}).
+                    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
+                    BIND (STRLEN(STR(?lab)) AS ?len)
+                }}
+                ORDER BY ?place ?len ?lab
+            """,
+            'root' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?type
+                WHERE {{
+                    ?uri a skos:Collection ;
+                         skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> ;    
+                         skos:prefLabel|rdfs:label ?label ;
+                         rdf:type ?type .
+                    FILTER (lang(?label) = {lang}). 
+                    FILTER NOT EXISTS {{ [skos:member ?uri] }}
+                }}
+                ORDER BY ?label
+            """,
+            'childs' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?type
+                WHERE {{
+                  ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
+                  {{ ?uri a ?type
+                    FILTER (?type = skos:Collection || ?type = skos:Concept) }}.
+                  ?root skos:narrower|skos:member ?uri.
+                  ?uri skos:prefLabel|rdfs:label ?label.
+                  FILTER (lang(?label) = {lang}).
+                }}
+                ORDER BY ?label
+            """,
+            'child-count' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT (COUNT(?uri) as ?nb)
+                WHERE {{
+                    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
+                    ?root skos:narrower|skos:member ?uri.
+                }}
+            """
+        },
+        'countries': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            'filter' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept.
+                    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> .
+                    ?uri skos:prefLabel ?label.
+                    FILTER (lang(?label) = {lang}).
+                    ?uri skos:prefLabel ?lab.
+                    FILTER regex (str(?lab), ?reg, 'i').
+                    FILTER (lang (?lab) = {lang}).
+                    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
+                    BIND (STRLEN(STR(?lab)) AS ?len)
+                }}
+                ORDER BY ?place ?len ?lab
+            """,
+            'root' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept ;
+                         skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> ;    
+                         skos:prefLabel ?label .
+                    FILTER (lang(?label) = {lang}). 
+                    FILTER NOT EXISTS {{ [skos:narrower ?uri] }}
+                }}
+                ORDER BY ?label
+            """,
+            'childs' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                  ?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> .
+                  {{ ?uri a ?type
+                    FILTER (?type = skos:Collection || ?type = skos:Concept) }}.
+                  ?root skos:narrower|skos:member ?uri.
+                  ?uri skos:prefLabel|rdfs:label ?label.
+                  FILTER (lang(?label) = {lang}).
+                }}
+                ORDER BY ?label
+            """,
+            'child-count' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT (COUNT(?uri) as ?nb)
+                WHERE {{
+                    ?uri skos:inScheme <http://skos.um.es/unescothes/CS000/Countries> .
+                    ?root skos:narrower|skos:member ?uri.
+                }}
+            """
+        },
+        'languages': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            'filter' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept.
+                    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Languages> .
+                    ?uri skos:prefLabel ?label.
+                    FILTER (lang(?label) = {lang}).
+                    ?uri skos:prefLabel ?lab.
+                    FILTER regex (str(?lab), ?reg, 'i').
+                    FILTER (lang (?lab) = {lang}).
+                    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
+                    BIND (STRLEN(STR(?lab)) AS ?len)
+                }}
+                ORDER BY ?place ?len ?lab
+            """,
+            'root' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept ;
+                         skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Languages> ;    
+                         skos:prefLabel ?label .
+                    FILTER (lang(?label) = {lang}). 
+                    FILTER NOT EXISTS {{ [skos:narrower ?uri] }}
+                }}
+                ORDER BY ?label
+            """
+        },
+        'projects': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            'filter' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?acro
+                WHERE {{
+                    ?uri a skos:Concept.
+                    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> .
+                    ?uri skos:prefLabel ?label.
+                    ?uri skos:prefLabel ?lab.
+                    OPTIONAL {{ ?uri skos:altLabel ?acro }}.
+                    FILTER regex (str(?lab), ?reg, 'i').
+                    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
+                    BIND (STRLEN(STR(?lab)) AS ?len)
+                }}
+                ORDER BY ?place ?len ?lab
+            """,
+            'root' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?acro
+                WHERE {{
+                    ?uri a skos:Concept ;
+                    skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Projects> ;    
+                    skos:prefLabel ?label .
+                    OPTIONAL {{ ?uri skos:altLabel ?acro }}
+                }}
+                ORDER BY ?label
+            """
+        },
+        'organizations': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            'filter' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?acro
+                WHERE {{
+                    ?uri a skos:Concept.
+                    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> .
+                    ?uri skos:prefLabel ?label.
+                    ?uri skos:prefLabel ?lab.
+                    OPTIONAL {{ ?uri skos:altLabel ?acro }}.
+                    FILTER regex (str(?lab), ?reg, 'i').
+                    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
+                    BIND (STRLEN(STR(?lab)) AS ?len)
+                }}
+                ORDER BY ?place ?len ?lab
+            """,
+            'root' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label ?acro
+                WHERE {{
+                    ?uri a skos:Concept ;
+                         skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Organizations> ;    
+                         skos:prefLabel ?label .
+                    OPTIONAL {{ ?uri skos:altLabel ?acro }}
+                }}
+                ORDER BY ?label
+            """
+        },
+        'types': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            'filter' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept.
+                    ?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> .
+                    ?uri skos:prefLabel ?label.
+                    FILTER (lang(?label) = {lang}).
+                    ?uri skos:prefLabel ?lab.
+                    FILTER regex (str(?lab), ?reg, 'i').
+                    FILTER (lang (?lab) = {lang}).
+                    BIND (STRLEN(STRBEFORE (str(?lab), ?reg)) AS ?place).
+                    BIND (STRLEN(STR(?lab)) AS ?len)
+                }}
+                ORDER BY ?place ?len ?lab
+            """,
+            'root' : """
+                PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
+                PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                PREFIX owl:<http://www.w3.org/2002/07/owl#>
+                PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
+                SELECT DISTINCT ?uri ?label
+                WHERE {{
+                    ?uri a skos:Concept ;
+                         skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/DocumentType> ;    
+                         skos:prefLabel ?label .
+                    FILTER (lang(?label) = {lang}). 
+                    FILTER NOT EXISTS {{ [skos:narrower ?uri] }}
+                }}
+                ORDER BY ?label
+            """
+        },
+        'audiences': {
+            'url' : SPARQL_QUERY_ENDPOINT,
+            "filter" : "",
+            "root" : "",
+            "childs" : "",
+            "child-count" : ""
+        }
+    }         
--- a/src/p4l/static/p4l/js/p4l.js	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/static/p4l/js/p4l.js	Wed Sep 25 22:14:51 2013 +0200
@@ -5,7 +5,7 @@
 
 app.service("Api", function($resource, context) {
     this.record = $resource(context.urls.record_api,
-            {},
+            {recordId: context.record_id},
             {
                 get: {
                     method: "GET",
@@ -20,7 +20,12 @@
 });
 
 app.service("RecordModel", function(Api, context) {
-    this.record = Api.record.get({recordId: context.record_id});
+    if(context.record == null) {
+        this.record = Api.record.get();
+    }
+    else {
+        this.record = new Api.record(context.record);
+    }
     this.uriLabels = context.uri_labels;
 });
 
@@ -174,11 +179,9 @@
       },
       link: function($scope, $element, $attrs) {
     	  // Get queries attributes from $scope listname and context query dict
-    	  var attr_dict = context.query_dicts[$scope.listname];
+    	  var attr_dict = context.query_dicts[$scope.listname];    	  
     	  for (var k in attr_dict){
-			  if (attr_dict.hasOwnProperty(k)) {
-			      $scope[k] = attr_dict[k];
-			  }
+    	      $scope[k] = attr_dict[k];
 		  }
 		  $scope.formVisible = false;
     	  // initalize autocomplete and browse thesaurus events
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p4l/templates/p4l/base.html	Wed Sep 25 22:14:51 2013 +0200
@@ -0,0 +1,68 @@
+{% load static %}
+{% load i18n %}
+<!doctype html>
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="{{LANGUAGE_CODE}}"> <![endif]-->
+<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="{{LANGUAGE_CODE}}"> <![endif]-->
+<!--[if IE 8]>    <html class="no-js lt-ie9" lang="{{LANGUAGE_CODE}}"> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="{{LANGUAGE_CODE}}"> <!--<![endif]-->
+<head>
+  {% block head %}
+  <meta charset="utf-8">
+  {% endblock %}
+  <title>Plan4Learning - {% block page_title %}{% endblock %}</title>
+  {% block css_common %}
+  <link rel="stylesheet" href="{% static 'p4l/lib/bootstrap/css/bootstrap.min.css' %}">
+  <link rel="stylesheet" href="{% static 'p4l/css/p4l.css' %}">
+  {% endblock %}
+  {% block css_page %}
+  {% endblock %}
+</head>
+<body>
+{% block body %}
+	<header class="navbar navbar-inverse" role="banner">
+	  {% block header %}
+	  <div class="container">
+	    <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
+	      <ul class="nav navbar-nav">
+	        <li>
+	          <a href="{% url 'p4l_home' %}">Plan 4 Learning</a>
+	        </li>
+	      </ul>
+          <ul class="nav navbar-nav" style="float:right;">
+            {% if user.is_authenticated %}
+              <li><a>{{ user.username }}</a></li>
+              {% if user.is_staff %}<li><a href="{% url 'admin:index' %}" >admin</a></li>{% endif %}
+              <li><a href="{% url 'logout' %}?next={% url 'p4l_home' %}" >{% trans 'logout' %}</a></li>
+            {% else %}
+              <li><a href="{% url 'login' %}" >{% trans 'login' %}</a></li>
+            {% endif %}
+          </ul>
+	    </nav>
+	  </div>
+	  {% endblock %}
+	</header>
+	<div class="container">
+    {% block content %}
+    {% endblock %}
+	</div>
+    <footer class="container">
+      {% block footer %}
+        <div class="col-md-12 text-right" id='langselect'>
+            <form action="{% url 'django.views.i18n.set_language' %}" method="post" id="lang_form">
+            {% csrf_token %}
+            {% get_language_info_list for LANGUAGES as languages %}
+            {% for language in languages %}
+                <input type="submit" name="language" class="flag flag-{{ language.code }}{% if language.code == LANGUAGE_CODE %} selected{% endif %}" value="{{ language.code }}" title="{{ language.name_local }}" />
+            {% endfor %}
+            </form>
+        </div>
+      {% endblock %}
+    </footer>
+    {% block js_common %}
+    <!--script type="text/javascript" src="{% static 'p4l/js/bootstrap.min.js' %}"></script-->
+    {% endblock %}
+    {% block js_page %}
+    {% endblock %}
+{% endblock %}
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p4l/templates/p4l/home.html	Wed Sep 25 22:14:51 2013 +0200
@@ -0,0 +1,78 @@
+{% extends "p4l/base.html" %}
+{% load static %}
+{% load i18n %}
+{% load p4lstringfilters %}
+
+{% block page_title %}{% trans 'Record List' %} - {% trans 'Page' %} {{ page.number }}{% endblock %}
+
+{% block content %}
+<div class="row">
+	<h3 class="col-md-6">{% trans 'Record List' %}</h3>
+	<div class="col-md-6 text-right">
+	  <form method="GET" class="form-inline" role="form">
+	    <div class="form-group">
+	      <input id="id_title" class="form-control" type="text" placeholder="{% trans 'Query' %}" name="q" value="{{query}}"/>
+	    </div>
+	    <div class="form-group">
+	      <button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></button>
+	    </div>
+      - <a class="btn btn-default" href="{% url 'p4l_record_new' %}">{% trans 'New record' %} <i class="glyphicon glyphicon-plus-sign"></i></a>
+	  </form>
+	</div>
+</div>
+ <div class="pagination pull-right">
+ {% if page.has_previous or page.has_next %}
+    <span class="page-links">
+        {% if page.has_previous %}
+            <a href="?page={{ page.previous_page_number }}&q={{query}}">{% trans 'Previous' %}</a>
+        {% endif %}
+        <span class="page-current">
+            {% trans 'Page' %} {{ page.number }} {% trans 'on' %} {{ paginator.num_pages }}
+        </span>
+        {% if page.has_next %}
+            <a href="?page={{ page.next_page_number }}&q={{query}}">{% trans 'Next' %}</a>
+        {% endif %}
+    </span>
+{% else %}
+    <span>&nbsp;</span>
+{% endif %}    
+</div>
+
+<table class="table">
+  <thead>
+    <tr><td>{% trans 'identifier' %}</td><td>{% trans 'titles' %}</td><td>{% trans 'dates' %}</td><td class="two_buttons">{% trans 'actions' %}</td></tr>
+  </thead>
+  <tbody>
+  {% for result in page.object_list %}
+    <tr>
+      <td>{{ result.get_stored_fields.identifier }}</td>
+      <td><ul>{% for t in result.get_stored_fields.titles_src %}
+          <li>{{ t }}</li>
+          {% endfor %}</ul></td>
+      <td>{{ result.get_stored_fields.years|join:", "}}</td>
+      <td>
+        <a class="btn btn-default" href="{% url 'p4l_record_view' slug=result.get_stored_fields.identifier %}"><i class="glyphicon glyphicon-eye-open"></i></a>
+        <a class="btn btn-default" href="{% url 'p4l_record_edit' slug=result.get_stored_fields.identifier %}?previous={{request.get_full_path|urlencode}}"><i class="glyphicon glyphicon-pencil"></i></a>
+      </td>
+    </tr>
+  {% empty %}
+    <tr><td>{% trans 'No record' %}</td></tr>
+  {% endfor %}
+  </tbody>
+</table>
+{% if is_paginated %}
+<div class="pagination pull-right">
+    <span class="page-links">
+        {% if page.has_previous %}
+            <a href="?page={{ page.previous_page_number }}{% for k,v in filter_params.items %}&{{k}}={{v}}{% endfor %}">{% trans 'Previous' %}</a>
+        {% endif %}
+        <span class="page-current">
+            {% trans 'Page' %} {{ page.number }} {% trans 'on' %} {{ page.paginator.num_pages }}
+        </span>
+        {% if page.has_next %}
+            <a href="?page={{ page.next_page_number }}{% for k,v in filter_params.items %}&{{k}}={{v}}{% endfor %}">{% trans 'Next' %}</a>
+        {% endif %}
+    </span>
+</div>
+{% endif %}
+{% endblock %}
\ No newline at end of file
--- a/src/p4l/templates/p4l/p4l_base.html	Mon Sep 23 00:38:16 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-{% load static %}
-{% load i18n %}
-<!doctype html>
-<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="{{LANGUAGE_CODE}}"> <![endif]-->
-<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="{{LANGUAGE_CODE}}"> <![endif]-->
-<!--[if IE 8]>    <html class="no-js lt-ie9" lang="{{LANGUAGE_CODE}}"> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="{{LANGUAGE_CODE}}"> <!--<![endif]-->
-<head>
-  {% block head %}
-  <meta charset="utf-8">
-  {% endblock %}
-  <title>Plan4Learning - {% block page_title %}{% endblock %}</title>
-  {% block css_common %}
-  <link rel="stylesheet" href="{% static 'p4l/lib/bootstrap/css/bootstrap.min.css' %}">
-  <link rel="stylesheet" href="{% static 'p4l/css/p4l.css' %}">
-  {% endblock %}
-  {% block css_page %}
-  {% endblock %}
-</head>
-<body>
-{% block body %}
-	<header class="navbar navbar-inverse" role="banner">
-	  {% block header %}
-	  <div class="container">
-	    <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
-	      <ul class="nav navbar-nav">
-	        <li>
-	          <a href="{% url 'p4l_home' %}">Plan 4 Learning</a>
-	        </li>
-	      </ul>
-          <ul class="nav navbar-nav" style="float:right;">
-            {% if user.is_authenticated %}
-              <li><a>{{ user.username }}</a></li>
-              {% if user.is_staff %}<li><a href="{% url 'admin:index' %}" >admin</a></li>{% endif %}
-              <li><a href="{% url 'logout' %}?next={% url 'p4l_home' %}" >{% trans 'logout' %}</a></li>
-            {% else %}
-              <li><a href="{% url 'login' %}" >{% trans 'login' %}</a></li>
-            {% endif %}
-          </ul>
-	    </nav>
-	  </div>
-	  {% endblock %}
-	</header>
-	<div class="container">
-    {% block content %}
-    {% endblock %}
-	</div>
-    <footer class="container">
-      {% block footer %}
-        <div class="col-md-12 text-right" id='langselect'>
-            <form action="{% url 'django.views.i18n.set_language' %}" method="post" id="lang_form">
-            {% csrf_token %}
-            {% get_language_info_list for LANGUAGES as languages %}
-            {% for language in languages %}
-                <input type="submit" name="language" class="flag flag-{{ language.code }}{% if language.code == LANGUAGE_CODE %} selected{% endif %}" value="{{ language.code }}" title="{{ language.name_local }}" />
-            {% endfor %}
-            </form>
-        </div>
-      {% endblock %}
-    </footer>
-    {% block js_common %}
-    <!--script type="text/javascript" src="{% static 'p4l/js/bootstrap.min.js' %}"></script-->
-    {% endblock %}
-    {% block js_page %}
-    {% endblock %}
-{% endblock %}
-</body>
-</html>
\ No newline at end of file
--- a/src/p4l/templates/p4l/p4l_home.html	Mon Sep 23 00:38:16 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-{% extends "p4l/p4l_base.html" %}
-{% load static %}
-{% load i18n %}
-{% load p4lstringfilters %}
-
-{% block page_title %}{% trans 'Record List' %} - {% trans 'Page' %} {{ page.number }}{% endblock %}
-
-{% block content %}
-<div class="row">
-	<h3 class="col-md-6">{% trans 'Record List' %}</h3>
-	<div class="col-md-6 text-right">
-	  <form method="GET" class="form-inline" role="form">
-	    <div class="form-group">
-	      <input id="id_title" class="form-control" type="text" placeholder="{% trans 'Query' %}" name="q" value="{{query}}"/>
-	    </div>
-	    <div class="form-group">
-	      <button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></button>
-	    </div>
-      - <a class="btn btn-default" href="{% url 'p4l_record_new' %}">{% trans 'New record' %} <i class="glyphicon glyphicon-plus-sign"></i></a>
-	  </form>
-	</div>
-</div>
- <div class="pagination pull-right">
- {% if page.has_previous or page.has_next %}
-    <span class="page-links">
-        {% if page.has_previous %}
-            <a href="?page={{ page.previous_page_number }}&q={{query}}">{% trans 'Previous' %}</a>
-        {% endif %}
-        <span class="page-current">
-            {% trans 'Page' %} {{ page.number }} {% trans 'on' %} {{ paginator.num_pages }}
-        </span>
-        {% if page.has_next %}
-            <a href="?page={{ page.next_page_number }}&q={{query}}">{% trans 'Next' %}</a>
-        {% endif %}
-    </span>
-{% else %}
-    <span>&nbsp;</span>
-{% endif %}    
-</div>
-
-<table class="table">
-  <thead>
-    <tr><td>{% trans 'identifier' %}</td><td>{% trans 'titles' %}</td><td>{% trans 'dates' %}</td><td class="two_buttons">{% trans 'actions' %}</td></tr>
-  </thead>
-  <tbody>
-  {% for result in page.object_list %}
-    <tr>
-      <td>{{ result.get_stored_fields.identifier }}</td>
-      <td><ul>{% for t in result.get_stored_fields.titles_src %}
-          <li>{{ t }}</li>
-          {% endfor %}</ul></td>
-      <td>{{ result.get_stored_fields.years|join:", "}}</td>
-      <td>
-        <a class="btn btn-default" href="{% url 'p4l_record_view' slug=result.get_stored_fields.identifier %}"><i class="glyphicon glyphicon-eye-open"></i></a>
-        <a class="btn btn-default" href="{% url 'p4l_record_edit' slug=result.get_stored_fields.identifier %}?previous={{request.get_full_path|urlencode}}"><i class="glyphicon glyphicon-pencil"></i></a>
-      </td>
-    </tr>
-  {% empty %}
-    <tr><td>{% trans 'No record' %}</td></tr>
-  {% endfor %}
-  </tbody>
-</table>
-{% if is_paginated %}
-<div class="pagination pull-right">
-    <span class="page-links">
-        {% if page.has_previous %}
-            <a href="?page={{ page.previous_page_number }}{% for k,v in filter_params.items %}&{{k}}={{v}}{% endfor %}">{% trans 'Previous' %}</a>
-        {% endif %}
-        <span class="page-current">
-            {% trans 'Page' %} {{ page.number }} {% trans 'on' %} {{ page.paginator.num_pages }}
-        </span>
-        {% if page.has_next %}
-            <a href="?page={{ page.next_page_number }}{% for k,v in filter_params.items %}&{{k}}={{v}}{% endfor %}">{% trans 'Next' %}</a>
-        {% endif %}
-    </span>
-</div>
-{% endif %}
-{% endblock %}
\ No newline at end of file
--- a/src/p4l/templates/p4l/p4l_record_view.html	Mon Sep 23 00:38:16 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-{% extends "p4l/p4l_base.html" %}
-{% load static %}
-{% load i18n %}
-{% load p4lstringfilters %}
-
-{% block page_title %}{% trans 'Record' %} {{ record.identifier }} - {% trans 'View' %}{% endblock %}
-
-{% block content %}
-<div class="row text-right">
-    <a class="btn btn-default" href="{% url 'p4l_record_edit' slug=record.identifier %}?previous={{request.get_full_path|urlencode}}">{% trans 'Edit the record' %} <i class="glyphicon glyphicon-pencil"></i></a>
-    <a class="btn btn-default" href="{% url 'p4l_record_delete' slug=record.identifier %}" onclick="return confirm('{% trans 'Are your sure you want to delete this record ? This action is irreversible.' %}')">{% trans 'Delete the record' %} <i class="glyphicon glyphicon-trash"></i></a>
-</div>
-<table class="table record-table">
-  <thead>
-    <tr><td>{% trans 'property' %}</td><td>{% trans 'value' %}</td></tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>URI</td>
-      <td>{{ record.uri|default:'' }}</td>
-    </tr>
-    <tr>
-      <td>{% trans 'subjects' %}</td>
-      <td><ul>{% for k,v in subjects_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'themes' %}</td>
-      <td><ul>{% for k,v in themes_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'countries' %}</td>
-      <td><ul>{% for k,v in countries_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'identifier' %}</td>
-      <td>{{ record.identifier }}</td>
-    </tr>
-    <tr>
-      <td>{% trans 'notes' %}</td>
-      <td>{{ record.notes|default:'' }}</td>
-    </tr>
-    <tr>
-      <td>{% trans 'issns' %}</td>
-      <td><ul>{% for i in record.issns.all %}<li>{{ i.issn|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'isbns' %}</td>
-      <td><ul>{% for i in record.isbns.all %}<li>{{ i.isbn|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'document code' %}</td>
-      <td><ul>{% for i in record.documentCodes.all %}<li>{{ i.documentCode|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'language' %}</td>
-      <td>{% if record.language %}{{ language_label }} <small class="text-muted">({{ record.language.uri|default:'' }})</small>{% endif %}</td>
-    </tr>
-    <tr>
-      <td>{% trans 'other languages' %}</td>
-      <td><ul>{% for k,v in otherLanguages_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'titles' %}</td>
-      <td><ul>{% for i in record.titles.all %}<li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'abstracts' %}</td>
-      <td><ul>{% for i in record.abstracts.all %}<li>{{ i.abstract|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'added titles' %}</td>
-      <td><ul>{% for i in record.addedTitles.all %}<li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'titles main document' %}</td>
-      <td><ul>{% for i in record.titlesMainDocument.all %}<li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'edition statement' %}</td>
-      <td>{{ record.editionStatement|default:'' }}</td>
-    </tr>
-    <tr>
-      <td>{% trans 'imprints' %}</td>
-      <td>
-        <ul>
-          {% for i in record.imprints.all %}
-          <li>
-            <ul class="list-unstyled">
-              <li>{% trans 'City' %} : {{ i.imprintCity|default:'' }}</li>
-              <li>{% trans 'Publisher' %} : {{ i.publisher|default:'' }}</li>
-              <li>{% trans 'Date' %} : {{ i.imprintDate|default:'' }}</li>
-              <li>{% trans 'Language' %} : {{ i.lang|default:'' }}</li>
-            </ul>
-          </li>
-          {% endfor %}
-        </ul>
-      </td>
-    </tr>
-    <tr>
-      <td>{% trans 'collations' %}</td>
-      <td><ul>{% for i in record.collations.all %}<li>{{ i.collation|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'volume issues' %}</td>
-      <td>
-        <ul>
-          {% for i in record.volumeIssues.all %}
-          <li>
-            <ul class="list-unstyled">
-              <li>{% trans 'Volume' %} : {{ i.volume|default:'' }}</li>
-              <li>{% trans 'Number' %} : {{ i.number|default:'' }}</li>
-              <li>{% trans 'Language' %} : {{ i.lang|default:'' }}</li>
-            </ul>
-          </li>
-          {% endfor %}
-        </ul>
-      </td>
-    </tr>
-    <tr>
-      <td>{% trans 'project names' %}</td>
-      <td><ul>{% for k,v in projects_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'periodicals' %}</td>
-      <td><ul>{% for i in record.periodicals.all %}<li>{{ i.label|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'meetings' %}</td>
-      <td>
-        <ul>
-          {% for i in record.meetings.all %}
-          <li>
-            <ul class="list-unstyled">
-              <li>{{ i.label|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>
-              <li>{% trans 'Number' %} : {{ i.meetingNumber|default:'' }}</li>
-              <li>{% trans 'Place' %} : {{ i.meetingPlace|default:'' }}</li>
-              <li>{% trans 'Date' %} : {{ i.meetingDate|default:'' }}</li>
-              <li>{% trans 'Year' %} : {{ i.meetingYear|default:'' }}</li>
-            </ul>
-          </li>
-          {% endfor %}
-        </ul>
-      </td>
-    </tr>
-    <tr>
-      <td>{% trans 'series' %}</td>
-      <td>
-        <ul>
-          {% for i in record.series.all %}
-          <li>
-            <ul class="list-unstyled">
-              <li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>
-              {% if i.volume %}<li>{% trans 'Volume' %} : {{ i.volume|default:'' }}</li>{% endif %}
-            </ul>
-          </li>
-          {% endfor %}
-        </ul>
-      </td>
-    </tr>
-    <tr>
-      <td>{% trans 'authors' %}</td>
-      <td><ul>{% for i in record.authors.all %}<li>{{ i.name|default:'' }}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'subject persons' %}</td>
-      <td><ul>{% for i in record.subjectPersons.all %}<li>{{ i.name|default:'' }}</li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'subject corporate bodies' %}</td>
-      <td><ul>{% for k,v in subjectCorporateBodies_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'subject meetings' %}</td>
-      <td>
-        <ul>
-          {% for i in record.subjectMeetings.all %}
-          <li>
-            <ul class="list-unstyled">
-              <li>{{ i.label|default:'' }}</li>
-              <li>{% trans 'Number' %} : {{ i.meetingNumber|default:'' }}</li>
-              <li>{% trans 'Place' %} : {{ i.meetingPlace|default:'' }}</li>
-              <li>{% trans 'Date' %} : {{ i.meetingDate|default:'' }}</li>
-              <li>{% trans 'Year' %} : {{ i.meetingYear|default:'' }}</li>
-            </ul>
-          </li>
-          {% endfor %}
-        </ul>
-      </td>
-    </tr>
-    <tr>
-      <td>{% trans 'corporate authors' %}</td>
-      <td><ul>{% for k,v in corporateAuthors_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'corporate author label' %}</td>
-      <td>{{ record.corporateAuthorLabel|default:'' }}</td>
-    </tr>
-    <tr>
-      <td>{% trans 'Urls' %}</td>
-      <td>
-        <ul>
-          {% for i in record.urls.all %}
-          <li>
-            <ul class="list-unstyled">
-              <li>{% trans 'Address' %} : {% if i.address %}<a href="{{ i.address }}" target="_blank">{{ i.address }}</a>{% endif %}</li>
-              <li>{% trans 'Display' %} : {{ i.display|default:'' }}</li>
-            </ul>
-          </li>
-          {% endfor %}
-        </ul>
-      </td>
-    </tr>
-    <tr>
-      <td>{% trans 'record type' %}</td>
-      <td>{{ recordType_label }} <small class="text-muted">({{ record.recordType|default:'' }})</small></td>
-    </tr>
-    <tr>
-      <td>{% trans 'audiences' %}</td>
-      <td><ul>{% for k,v in audiences_labels.items %}<li>{{ v }} <small class="text-muted">({{ k }})</small></li>{% endfor %}</ul></td>
-    </tr>
-    <tr>
-      <td>{% trans 'is document part' %}</td>
-      <td><input type="checkbox" disabled="disabled" {% if record.isDocumentPart %}checked="checked"{% endif %} /></td>
-    </tr>
-    <tr>
-      <td>{% trans 'is hidden' %}</td>
-      <td><input type="checkbox" disabled="disabled" {% if record.isHidden %}checked="checked"{% endif %} /></td>
-    </tr>
-    <tr>
-      <td>{% trans 'is restricted' %}</td>
-      <td><input type="checkbox" disabled="disabled" {% if record.isRestricted %}checked="checked"{% endif %} /></td>
-    </tr>
-  </tbody>
-</table>
-<div class="row text-right">
-    <a class="btn btn-default" href="{% url 'p4l_record_edit' slug=record.identifier %}?previous={{request.get_full_path|urlencode}}">{% trans 'Edit the record' %} <i class="glyphicon glyphicon-pencil"></i></a>
-    <a class="btn btn-default" href="{% url 'p4l_record_delete' slug=record.identifier %}" onclick="return confirm('{% trans 'Are your sure you want to delete this record ? This action is irreversible.' %}')">{% trans 'Delete the record' %} <i class="glyphicon glyphicon-trash"></i></a>
-</div>
-{% endblock %}
\ No newline at end of file
--- a/src/p4l/templates/p4l/record_update_form.html	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/templates/p4l/record_update_form.html	Wed Sep 25 22:14:51 2013 +0200
@@ -1,4 +1,4 @@
-{% extends "p4l/p4l_base.html" %}
+{% extends "p4l/base.html" %}
 {% load static %}
 {% load i18n %}
 
@@ -23,6 +23,7 @@
 <script type="text/javascript">
     angular.module("recordApp")
         .value('context', {
+            record: angular.fromJson('{{object_json | safe | addslashes}}'),
             record_id: "{{record.identifier}}",
             uri_labels: angular.fromJson('{{uri_labels | safe | addslashes}}'),
             csrf_token: "{{ csrf_token }}",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p4l/templates/p4l/record_view.html	Wed Sep 25 22:14:51 2013 +0200
@@ -0,0 +1,240 @@
+{% extends "p4l/base.html" %}
+{% load static %}
+{% load i18n %}
+{% load p4lstringfilters %}
+{% load p4lutils %}
+
+{% block page_title %}{% trans 'Record' %} {{ record.identifier }} - {% trans 'View' %}{% endblock %}
+
+{% block content %}
+<div class="row text-right">
+    <a class="btn btn-default" href="{% url 'p4l_record_edit' slug=record.identifier %}?previous={{request.get_full_path|urlencode}}">{% trans 'Edit the record' %} <i class="glyphicon glyphicon-pencil"></i></a>
+    <a class="btn btn-default" href="{% url 'p4l_record_delete' slug=record.identifier %}" onclick="return confirm('{% trans 'Are your sure you want to delete this record ? This action is irreversible.' %}')">{% trans 'Delete the record' %} <i class="glyphicon glyphicon-trash"></i></a>
+</div>
+<table class="table record-table">
+  <thead>
+    <tr><td>{% trans 'property' %}</td><td>{% trans 'value' %}</td></tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td>URI</td>
+      <td>{{ record.uri|default:'' }}</td>
+    </tr>
+    <tr>
+      <td>{% trans 'subjects' %}</td>
+      <td><ul>{% for k in record.subjects.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'themes' %}</td>
+      <td><ul>{% for k in record.themes.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'countries' %}</td>
+      <td><ul>{% for k in record.countries.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'identifier' %}</td>
+      <td>{{ record.identifier }}</td>
+    </tr>
+    <tr>
+      <td>{% trans 'notes' %}</td>
+      <td>{{ record.notes|default:'' }}</td>
+    </tr>
+    <tr>
+      <td>{% trans 'issns' %}</td>
+      <td><ul>{% for i in record.issns.all %}<li>{{ i.issn|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'isbns' %}</td>
+      <td><ul>{% for i in record.isbns.all %}<li>{{ i.isbn|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'document code' %}</td>
+      <td><ul>{% for i in record.documentCodes.all %}<li>{{ i.documentCode|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'language' %}</td>
+      <td>{% if record.language %}{{ uri_labels | get_item:record.language.uri }} <small class="text-muted">({{ record.language.uri|default:'' }})</small>{% endif %}</td>
+    </tr>
+    <tr>
+      <td>{% trans 'other languages' %}</td>
+      <td><ul>{% for k in record.otherLanguages.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'titles' %}</td>
+      <td><ul>{% for i in record.titles.all %}<li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'abstracts' %}</td>
+      <td><ul>{% for i in record.abstracts.all %}<li>{{ i.abstract|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'added titles' %}</td>
+      <td><ul>{% for i in record.addedTitles.all %}<li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'titles main document' %}</td>
+      <td><ul>{% for i in record.titlesMainDocument.all %}<li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'edition statement' %}</td>
+      <td>{{ record.editionStatement|default:'' }}</td>
+    </tr>
+    <tr>
+      <td>{% trans 'imprints' %}</td>
+      <td>
+        <ul>
+          {% for i in record.imprints.all %}
+          <li>
+            <ul class="list-unstyled">
+              <li>{% trans 'City' %} : {{ i.imprintCity|default:'' }}</li>
+              <li>{% trans 'Publisher' %} : {{ i.publisher|default:'' }}</li>
+              <li>{% trans 'Date' %} : {{ i.imprintDate|default:'' }}</li>
+              <li>{% trans 'Language' %} : {{ i.lang|default:'' }}</li>
+            </ul>
+          </li>
+          {% endfor %}
+        </ul>
+      </td>
+    </tr>
+    <tr>
+      <td>{% trans 'collations' %}</td>
+      <td><ul>{% for i in record.collations.all %}<li>{{ i.collation|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'volume issues' %}</td>
+      <td>
+        <ul>
+          {% for i in record.volumeIssues.all %}
+          <li>
+            <ul class="list-unstyled">
+              <li>{% trans 'Volume' %} : {{ i.volume|default:'' }}</li>
+              <li>{% trans 'Number' %} : {{ i.number|default:'' }}</li>
+              <li>{% trans 'Language' %} : {{ i.lang|default:'' }}</li>
+            </ul>
+          </li>
+          {% endfor %}
+        </ul>
+      </td>
+    </tr>
+    <tr>
+      <td>{% trans 'project names' %}</td>
+      <td><ul>{% for k in record.projects.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'periodicals' %}</td>
+      <td><ul>{% for i in record.periodicals.all %}<li>{{ i.label|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'meetings' %}</td>
+      <td>
+        <ul>
+          {% for i in record.meetings.all %}
+          <li>
+            <ul class="list-unstyled">
+              <li>{{ i.label|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>
+              <li>{% trans 'Number' %} : {{ i.meetingNumber|default:'' }}</li>
+              <li>{% trans 'Place' %} : {{ i.meetingPlace|default:'' }}</li>
+              <li>{% trans 'Date' %} : {{ i.meetingDate|default:'' }}</li>
+              <li>{% trans 'Year' %} : {{ i.meetingYear|default:'' }}</li>
+            </ul>
+          </li>
+          {% endfor %}
+        </ul>
+      </td>
+    </tr>
+    <tr>
+      <td>{% trans 'series' %}</td>
+      <td>
+        <ul>
+          {% for i in record.series.all %}
+          <li>
+            <ul class="list-unstyled">
+              <li>{{ i.title|default:'' }}{% if i.lang %} <small class="text-muted">({{ i.lang }})</small>{% endif %}</li>
+              {% if i.volume %}<li>{% trans 'Volume' %} : {{ i.volume|default:'' }}</li>{% endif %}
+            </ul>
+          </li>
+          {% endfor %}
+        </ul>
+      </td>
+    </tr>
+    <tr>
+      <td>{% trans 'authors' %}</td>
+      <td><ul>{% for i in record.authors.all %}<li>{{ i.name|default:'' }}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'subject persons' %}</td>
+      <td><ul>{% for i in record.subjectPersons.all %}<li>{{ i.name|default:'' }}</li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'subject corporate bodies' %}</td>
+      <td><ul>{% for k in record.subjectCorporateBodies.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'subject meetings' %}</td>
+      <td>
+        <ul>
+          {% for i in record.subjectMeetings.all %}
+          <li>
+            <ul class="list-unstyled">
+              <li>{{ i.label|default:'' }}</li>
+              <li>{% trans 'Number' %} : {{ i.meetingNumber|default:'' }}</li>
+              <li>{% trans 'Place' %} : {{ i.meetingPlace|default:'' }}</li>
+              <li>{% trans 'Date' %} : {{ i.meetingDate|default:'' }}</li>
+              <li>{% trans 'Year' %} : {{ i.meetingYear|default:'' }}</li>
+            </ul>
+          </li>
+          {% endfor %}
+        </ul>
+      </td>
+    </tr>
+    <tr>
+      <td>{% trans 'corporate authors' %}</td>
+      <td><ul>{% for k in record.corporateAuthors.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'corporate author label' %}</td>
+      <td>{{ record.corporateAuthorLabel|default:'' }}</td>
+    </tr>
+    <tr>
+      <td>{% trans 'Urls' %}</td>
+      <td>
+        <ul>
+          {% for i in record.urls.all %}
+          <li>
+            <ul class="list-unstyled">
+              <li>{% trans 'Address' %} : {% if i.address %}<a href="{{ i.address }}" target="_blank">{{ i.address }}</a>{% endif %}</li>
+              <li>{% trans 'Display' %} : {{ i.display|default:'' }}</li>
+            </ul>
+          </li>
+          {% endfor %}
+        </ul>
+      </td>
+    </tr>
+    <tr>
+      <td>{% trans 'record type' %}</td>
+      <td>{{ uri_labels | get_item:record.recordType }} <small class="text-muted">({{ record.recordType|default:'' }})</small></td>
+    </tr>
+    <tr>
+      <td>{% trans 'audiences' %}</td>
+      <td><ul>{% for k in record.audiences.all %}<li>{{ uri_labels | get_item:k.uri }} <small class="text-muted">({{ k.uri }})</small></li>{% endfor %}</ul></td>
+    </tr>
+    <tr>
+      <td>{% trans 'is document part' %}</td>
+      <td><input type="checkbox" disabled="disabled" {% if record.isDocumentPart %}checked="checked"{% endif %} /></td>
+    </tr>
+    <tr>
+      <td>{% trans 'is hidden' %}</td>
+      <td><input type="checkbox" disabled="disabled" {% if record.hidden %}checked="checked"{% endif %} /></td>
+    </tr>
+    <tr>
+      <td>{% trans 'is restricted' %}</td>
+      <td><input type="checkbox" disabled="disabled" {% if record.restricted %}checked="checked"{% endif %} /></td>
+    </tr>
+  </tbody>
+</table>
+<div class="row text-right">
+    <a class="btn btn-default" href="{% url 'p4l_record_edit' slug=record.identifier %}?previous={{request.get_full_path|urlencode}}">{% trans 'Edit the record' %} <i class="glyphicon glyphicon-pencil"></i></a>
+    <a class="btn btn-default" href="{% url 'p4l_record_delete' slug=record.identifier %}" onclick="return confirm('{% trans 'Are your sure you want to delete this record ? This action is irreversible.' %}')">{% trans 'Delete the record' %} <i class="glyphicon glyphicon-trash"></i></a>
+</div>
+{% endblock %}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p4l/templatetags/p4lutils.py	Wed Sep 25 22:14:51 2013 +0200
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+'''
+Created on Sep 24, 2013
+
+@author: ymh
+'''
+from django.template import Library
+
+register = Library()
+
+
+@register.filter
+def get_item(dictionary, key):
+    return dictionary.get(key, "")
\ No newline at end of file
--- a/src/p4l/urls.py	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/urls.py	Wed Sep 25 22:14:51 2013 +0200
@@ -4,8 +4,7 @@
 from django.contrib.auth.decorators import login_required
 
 from p4l.search.views import RecordSearchView
-from p4l.views import (RecordDetailView, RecordEditView, RecordDeleteView, 
-    RecordNewView)
+from p4l.views import RecordDetailView, RecordEditView, RecordDeleteView
 
 
 js_info_dict = {
@@ -20,7 +19,7 @@
     url(r'^auth/', include(auth_urls)),
     url(r'^record/view/(?P<slug>\w+)$', login_required(RecordDetailView.as_view()), name='p4l_record_view'),
     url(r'^record/edit/(?P<slug>\w+)$', login_required(RecordEditView.as_view()), name='p4l_record_edit'),
-    url(r'^record/new$', login_required(RecordNewView.as_view()), name='p4l_record_new'),
+    url(r'^record/new$', login_required(RecordEditView.as_view(is_create_view=True)), name='p4l_record_new'),
     url(r'^record/delete/(?P<slug>\w+)$', login_required(RecordDeleteView.as_view()), name='p4l_record_delete'),
     url(r'^api/', include('p4l.api.urls')),
 
--- a/src/p4l/views.py	Mon Sep 23 00:38:16 2013 +0200
+++ b/src/p4l/views.py	Wed Sep 25 22:14:51 2013 +0200
@@ -4,25 +4,49 @@
 
 @author: tc
 '''
-from datetime import datetime
 import json
 import logging
+import time
 
 from django.conf import settings
 from django.shortcuts import redirect, get_object_or_404
 from django.views.generic import DetailView, View
+from rest_framework.renderers import UnicodeJSONRenderer
 
+from p4l.api.serializers import RecordSerializer
 from p4l.models import Record
 from p4l.utils import get_labels_for_uris
 
 
 logger = logging.getLogger(__name__)
 
+QUERY_FIELDS_TRANSLATION = {
+    'url': 'dataurl',
+    'filter': 'dataquery',
+    'root': 'datarootquery',
+    'childs': 'datachildsquery',
+    'child-count': 'datachildcountquery'                            
+}
+
+
+def get_record_uri_labels(record, lang):
+    uri_labels = get_labels_for_uris([s.uri for s in record.subjects.all()], settings.RDF_SCHEMES['subjects'], lang, False)
+    uri_labels.update(get_labels_for_uris([s.uri for s in record.themes.all()], settings.RDF_SCHEMES['themes'], lang, False))
+    uri_labels.update(get_labels_for_uris([s.uri for s in record.countries.all()], settings.RDF_SCHEMES['countries'], lang, False))
+    uri_labels.update(get_labels_for_uris([record.language.uri] if record.language else [], settings.RDF_SCHEMES['languages'], lang, False))
+    uri_labels.update(get_labels_for_uris([s.uri for s in record.otherLanguages.all()], settings.RDF_SCHEMES['languages'], lang, False))
+    uri_labels.update(get_labels_for_uris([s.uri for s in record.projectNames.all()], settings.RDF_SCHEMES['projects'], None, True))
+    uri_labels.update(get_labels_for_uris([s.uri for s in record.subjectCorporateBodies.all()], settings.RDF_SCHEMES['organizations'], None, True))
+    uri_labels.update(get_labels_for_uris([s.uri for s in record.corporateAuthors.all()], settings.RDF_SCHEMES['organizations'], None, True))
+    uri_labels.update(get_labels_for_uris([record.recordType] if record.recordType else [], settings.RDF_SCHEMES['types'], lang, False))
+    uri_labels.update(get_labels_for_uris([s.uri for s in record.audiences.all()], settings.RDF_SCHEMES['audiences'], None, True))
+    return uri_labels
+
 
 class RecordDetailView(DetailView):
     
     model = Record
-    template_name = "p4l/p4l_record_view.html"
+    template_name = "p4l/record_view.html"
     slug_field = "identifier"
     
     def get_context_data(self, **kwargs):
@@ -33,50 +57,9 @@
             lang = self.request.GET["lang"]
         elif hasattr(self.request, "LANGUAGE_CODE") and self.request.LANGUAGE_CODE in ["fr","en","es"]:
             lang = self.request.LANGUAGE_CODE
-        # self.object is the record entry
-        # We get the subjects'labels with the Thesaurus repository
-        uri_list = [s.uri for s in self.object.subjects.all()]
-        uris_labels = get_labels_for_uris(uri_list, "http://skos.um.es/unescothes/CS000", lang, False)
-        context['subjects_labels'] = uris_labels
-        # We get the themes'labels with the Themes repository
-        uri_list = [s.uri for s in self.object.themes.all()]
-        uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Themes", lang, False)
-        context['themes_labels'] = uris_labels
-        # We get the countries'labels with the Thesaurus repository
-        uri_list = [s.uri for s in self.object.countries.all()]
-        uris_labels = get_labels_for_uris(uri_list, "http://skos.um.es/unescothes/CS000/Countries", lang, False)
-        context['countries_labels'] = uris_labels
-        # We get the languages'labels with the Languages repository
-        if self.object.language:
-            uri_list = [self.object.language.uri]
-            uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Languages", lang, False)
-            context['language_label'] = uris_labels[self.object.language.uri]
-        # We get the other languages'labels with the Languages repository
-        uri_list = [s.uri for s in self.object.otherLanguages.all()]
-        uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Languages", lang, False)
-        context['otherLanguages_labels'] = uris_labels
-        # We get the project'labels with the Projects repository
-        uri_list = [s.uri for s in self.object.projectNames.all()]
-        uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Projects", None, True)
-        context['projects_labels'] = uris_labels
-        # We get the subjectCorporateBodies'labels with the Organizations repository
-        uri_list = [s.uri for s in self.object.subjectCorporateBodies.all()]
-        uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Organizations", None, True)
-        context['subjectCorporateBodies_labels'] = uris_labels
-        # We get the corporateAuthors'labels with the Organizations repository
-        uri_list = [s.uri for s in self.object.corporateAuthors.all()]
-        uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Organizations", None, True)
-        context['corporateAuthors_labels'] = uris_labels
-        # We get the recordType'labels with the DocumentType repository
-        if self.object.recordType:
-            uri_list = [self.object.recordType]
-            uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/DocumentType", lang, False)
-            context['recordType_label'] = uris_labels[self.object.recordType]
-        # Here, in the future, there will be the request for audiences thesaurus
-        context['audiences_labels'] = {}
-        #uri_list = [s.uri for s in self.object.audiences.all()]
-        #uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Audiences", lang, False)
-        #context['audiences_labels'] = uris_labels
+
+        context['uri_labels'] = get_record_uri_labels(self.object,lang)
+        
         
         return context
 
@@ -85,9 +68,41 @@
     template_name = 'p4l/record_update_form.html'
     model = Record
     slug_field = "identifier"
+    is_create_view = False
+    
+    def get_empty_object(self):
+        
+        obj = Record()
+        obj.id = -1
+        obj.identifier = "T" + str(int(time.time()))
+        obj.uri = "http://www.iiep.unesco.org/plan4learning/record/" + obj.identifier
+        
+        return obj
+    
+    
+    def get_object(self, *args, **kwargs):
+        """
+        Returns the object the view is displaying.
+
+        By default this requires `self.queryset` and a `pk` or `slug` argument
+        in the URLconf, but subclasses can override this to return any object.
+        """
+        if self.is_create_view:
+            return self.get_empty_object()
+        
+        return super(RecordEditView, self).get_object(*args, **kwargs)
+        
 
     def get_context_data(self, **kwargs):
-        context = DetailView.get_context_data(self, **kwargs)
+        
+        context = super(RecordEditView, self).get_context_data(**kwargs)
+        
+        if self.object:
+            serializer = RecordSerializer(self.object)
+            context['object_json'] = UnicodeJSONRenderer().render(serializer.data)
+        else:
+            context['object_json'] = "null"
+        
         # We get the language, "fr" by default
         lang = "fr"
         if "lang" in self.request.GET:
@@ -95,77 +110,12 @@
         elif hasattr(self.request, "LANGUAGE_CODE") and self.request.LANGUAGE_CODE in ["fr","en","es"]:
             lang = self.request.LANGUAGE_CODE
         
-        uri_labels = get_labels_for_uris([s.uri for s in self.object.subjects.all()], "http://skos.um.es/unescothes/CS000", lang, False)
-        uri_labels.update(get_labels_for_uris([s.uri for s in self.object.themes.all()], "http://www.iiep.unesco.org/plan4learning/scheme/Themes", lang, False))
-        uri_labels.update(get_labels_for_uris([s.uri for s in self.object.countries.all()], "http://skos.um.es/unescothes/CS000/Countries", lang, False))
-        uri_labels.update(get_labels_for_uris([self.object.language.uri] if self.object.language else [], "http://www.iiep.unesco.org/plan4learning/scheme/Languages", lang, False))
-        uri_labels.update(get_labels_for_uris([s.uri for s in self.object.otherLanguages.all()], "http://www.iiep.unesco.org/plan4learning/scheme/Languages", lang, False))
-        uri_labels.update(get_labels_for_uris([s.uri for s in self.object.projectNames.all()], "http://www.iiep.unesco.org/plan4learning/scheme/Projects", None, True))
-        uri_labels.update(get_labels_for_uris([s.uri for s in self.object.subjectCorporateBodies.all()], "http://www.iiep.unesco.org/plan4learning/scheme/Organizations", None, True))
-        uri_labels.update(get_labels_for_uris([s.uri for s in self.object.corporateAuthors.all()], "http://www.iiep.unesco.org/plan4learning/scheme/Organizations", None, True))
-        uri_labels.update(get_labels_for_uris([self.object.recordType] if self.object.recordType else [], "http://www.iiep.unesco.org/plan4learning/scheme/DocumentType", lang, False))
-        context['uri_labels'] = json.dumps(uri_labels)
+        context['uri_labels'] = json.dumps(get_record_uri_labels(self.object,lang))
         
         # lang must be like "XX" in the sparql request 
         lang = '"' + lang + '"'
-        query_dicts = {
-            'subjects': {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_SUBJECT_QUERIES["filter"] % (lang, lang),
-                'datarootquery': settings.SPARQL_SUBJECT_QUERIES["root"] % lang,
-                'datachildsquery': settings.SPARQL_SUBJECT_QUERIES["childs"] % lang,
-                'datachildcountquery': settings.SPARQL_SUBJECT_QUERIES["child-count"]
-            },
-            'themes' : {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_THEME_QUERIES["filter"] % (lang, lang),
-                'datarootquery': settings.SPARQL_THEME_QUERIES["root"] % lang,
-                'datachildsquery': settings.SPARQL_THEME_QUERIES["childs"] % lang,
-                'datachildcountquery': settings.SPARQL_THEME_QUERIES["child-count"]
-            },
-            'countries' : {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_COUNTRY_QUERIES["filter"] % (lang, lang),
-                'datarootquery': settings.SPARQL_COUNTRY_QUERIES["root"] % lang,
-                'datachildsquery': settings.SPARQL_COUNTRY_QUERIES["childs"] % lang,
-                'datachildcountquery': settings.SPARQL_COUNTRY_QUERIES["child-count"]
-            },
-            'languages' : {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_LANGUAGE_QUERIES["filter"] % (lang, lang),
-                'datarootquery': settings.SPARQL_LANGUAGE_QUERIES["root"] % lang,
-                'datachildsquery': "",
-                'datachildcountquery': ""
-            },
-            'projects' : {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_PROJECT_QUERIES["filter"],
-                'datarootquery': settings.SPARQL_PROJECT_QUERIES["root"],
-                'datachildsquery': "",
-                'datachildcountquery': ""
-            },
-            'organizations' : {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_ORGANIZATION_QUERIES["filter"],
-                'datarootquery': settings.SPARQL_ORGANIZATION_QUERIES["root"],
-                'datachildsquery': "",
-                'datachildcountquery': ""
-            },
-            'types' : {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_TYPE_QUERIES["filter"] % (lang, lang),
-                'datarootquery': settings.SPARQL_TYPE_QUERIES["root"] % lang,
-                'datachildsquery': "",
-                'datachildcountquery': ""
-            },
-            'audiences': {
-                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
-                'dataquery': settings.SPARQL_AUDIENCE_QUERIES["filter"],
-                'datarootquery': settings.SPARQL_AUDIENCE_QUERIES["root"],
-                'datachildsquery': settings.SPARQL_AUDIENCE_QUERIES["childs"],
-                'datachildcountquery': settings.SPARQL_AUDIENCE_QUERIES["child-count"]
-            }
-        }
+
+        query_dicts = dict([(k , dict([ (QUERY_FIELDS_TRANSLATION[key],value.format(lang=lang)) for key,value in v.items()  ])) for k,v in settings.SPARQL_REF_QUERIES.items()])
         context['query_dicts'] = json.dumps(query_dicts)
         
         # Languages list used in drop down list
@@ -174,15 +124,6 @@
         return context
 
 
-class RecordNewView(View):
-    def get(self, request, *args, **kwargs):
-        rec = Record()
-        rec.identifier = "T" + datetime.now().strftime("%Y%m%d%H%M%S")
-        rec.uri = "http://www.iiep.unesco.org/plan4learning/record/" + rec.identifier
-        rec.save()
-        return redirect('p4l_record_edit', rec.identifier)
-
-
 class RecordDeleteView(View):
     def get(self, request, slug, **kwargs):
         rec = get_object_or_404(Record, identifier=slug)