--- a/src/p4l/api/serializers.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/api/serializers.py Fri Sep 20 00:14:42 2013 +0200
@@ -117,7 +117,7 @@
'''
Serializer for record
'''
- language = ThesaurusSerializer(many=False, slug_field='uri')
+ 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')
@@ -125,6 +125,7 @@
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')
class Meta:
model = Record
@@ -132,11 +133,11 @@
read_only_fields = ('identifier', 'uri')
fields = ("identifier", "uri", "subjects", "notes", "otherLanguages",
"language", "editionStatement", "recordType", "isDocumentPart",
- "isMultilingual", "themes", "countries", "projectNames",
- "subjectCorporateBodies", "corporateAuthors", "imprints",
- "titles", "addedTitles", "issns", "isbns", "documentCodes",
+ "isHidden", "isRestricted", "themes", "countries", "projectNames",
+ "subjectCorporateBodies", "corporateAuthors", "corporateAuthorLabel",
+ "imprints", "titles", "addedTitles", "issns", "isbns", "documentCodes",
"abstracts", "titlesMainDocument", "collations", "volumeIssues",
"periodicals", "meetings", "subjectMeetings", "series",
- "authors", "subjectPersons", "urls")
+ "authors", "subjectPersons", "urls", "audiences")
--- a/src/p4l/locale/en/LC_MESSAGES/django.po Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/locale/en/LC_MESSAGES/django.po Fri Sep 20 00:14:42 2013 +0200
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-11 05:28-0500\n"
+"POT-Creation-Date: 2013-09-18 09:42-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:36 templates/p4l/p4l_record_view.html:51
+#: admin.py:10 forms.py:36 templates/p4l/p4l_record_view.html:55
msgid "language"
msgstr "language"
@@ -65,8 +65,8 @@
msgid "Record List"
msgstr "Record list"
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:29
-#: templates/p4l/p4l_home.html:66
+#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:30
+#: templates/p4l/p4l_home.html:67
msgid "Page"
msgstr "Page"
@@ -74,27 +74,41 @@
msgid "Title"
msgstr "Title"
-#: templates/p4l/p4l_home.html:26 templates/p4l/p4l_home.html.py:63
+#: templates/p4l/p4l_home.html:19
+#, fuzzy
+msgid "New record"
+msgstr "No record"
+
+#: templates/p4l/p4l_home.html:27 templates/p4l/p4l_home.html.py:64
msgid "Previous"
msgstr "Previous"
-#: templates/p4l/p4l_home.html:29 templates/p4l/p4l_home.html.py:66
+#: templates/p4l/p4l_home.html:30 templates/p4l/p4l_home.html.py:67
msgid "on"
msgstr "on"
-#: templates/p4l/p4l_home.html:32 templates/p4l/p4l_home.html.py:69
+#: templates/p4l/p4l_home.html:33 templates/p4l/p4l_home.html.py:70
msgid "Next"
msgstr "Next"
-#: templates/p4l/p4l_home.html:39 templates/p4l/p4l_record_view.html:59
+#: templates/p4l/p4l_home.html:40 templates/p4l/p4l_record_view.html:35
+msgid "identifier"
+msgstr "identifier"
+
+#: templates/p4l/p4l_home.html:40 templates/p4l/p4l_record_view.html:63
msgid "titles"
msgstr "titles"
-#: templates/p4l/p4l_home.html:39
+#: templates/p4l/p4l_home.html:40
+#, fuzzy
+msgid "dates"
+msgstr "Update"
+
+#: templates/p4l/p4l_home.html:40
msgid "actions"
msgstr "actions"
-#: templates/p4l/p4l_home.html:55
+#: templates/p4l/p4l_home.html:56
msgid "No record"
msgstr "No record"
@@ -108,181 +122,215 @@
msgid "View"
msgstr "View"
+#: templates/p4l/p4l_record_view.html:10
+#: templates/p4l/p4l_record_view.html:236 templates/p4l/translations.html:21
+#, fuzzy
+msgid "Edit the record"
+msgstr "Modify the record type"
+
#: templates/p4l/p4l_record_view.html:11
+#: templates/p4l/p4l_record_view.html:237
+#: templates/p4l/record_update_form.html:48
+#: templates/p4l/record_update_form.html:236
+msgid ""
+"Are your sure you want to delete this record ? This action est irreversible."
+msgstr ""
+
+#: templates/p4l/p4l_record_view.html:11
+#: templates/p4l/p4l_record_view.html:237
+#: templates/p4l/record_update_form.html:48
+#: templates/p4l/record_update_form.html:236
+#, fuzzy
+msgid "Delete the record"
+msgstr "Modify the record type"
+
+#: templates/p4l/p4l_record_view.html:15
msgid "property"
msgstr "property"
-#: templates/p4l/p4l_record_view.html:11
+#: templates/p4l/p4l_record_view.html:15
msgid "value"
msgstr "value"
-#: templates/p4l/p4l_record_view.html:19
+#: templates/p4l/p4l_record_view.html:23
msgid "subjects"
msgstr "subjects"
-#: templates/p4l/p4l_record_view.html:23
+#: templates/p4l/p4l_record_view.html:27
msgid "themes"
msgstr "themes"
-#: templates/p4l/p4l_record_view.html:27
+#: templates/p4l/p4l_record_view.html:31
msgid "countries"
msgstr "countries"
-#: templates/p4l/p4l_record_view.html:31
-msgid "identifier"
-msgstr "identifier"
-
-#: templates/p4l/p4l_record_view.html:35
+#: templates/p4l/p4l_record_view.html:39
msgid "notes"
msgstr "notes"
-#: templates/p4l/p4l_record_view.html:39
+#: templates/p4l/p4l_record_view.html:43
msgid "issns"
msgstr "issns"
-#: templates/p4l/p4l_record_view.html:43
+#: templates/p4l/p4l_record_view.html:47
msgid "isbns"
msgstr "isbns"
-#: templates/p4l/p4l_record_view.html:47
+#: templates/p4l/p4l_record_view.html:51
msgid "document code"
msgstr "document code"
-#: templates/p4l/p4l_record_view.html:55
+#: templates/p4l/p4l_record_view.html:59
msgid "other languages"
msgstr "other languages"
-#: templates/p4l/p4l_record_view.html:63
+#: templates/p4l/p4l_record_view.html:67
msgid "abstracts"
msgstr "abstracts"
-#: templates/p4l/p4l_record_view.html:67
+#: templates/p4l/p4l_record_view.html:71
msgid "added titles"
msgstr "addes titles"
-#: templates/p4l/p4l_record_view.html:71
+#: templates/p4l/p4l_record_view.html:75
msgid "titles main document"
msgstr "titles main document"
-#: templates/p4l/p4l_record_view.html:75
+#: templates/p4l/p4l_record_view.html:79
msgid "edition statement"
msgstr "edition statement"
-#: templates/p4l/p4l_record_view.html:79
+#: templates/p4l/p4l_record_view.html:83
msgid "imprints"
msgstr "imprints"
-#: templates/p4l/p4l_record_view.html:85
+#: templates/p4l/p4l_record_view.html:89
msgid "City"
msgstr "City"
-#: templates/p4l/p4l_record_view.html:86
+#: templates/p4l/p4l_record_view.html:90
msgid "Publisher"
msgstr "Publisher"
-#: templates/p4l/p4l_record_view.html:87
-#: templates/p4l/p4l_record_view.html:133
-#: templates/p4l/p4l_record_view.html:178
+#: 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:88
-#: templates/p4l/p4l_record_view.html:108
+#: templates/p4l/p4l_record_view.html:92
+#: templates/p4l/p4l_record_view.html:112
msgid "Language"
msgstr "Language"
-#: templates/p4l/p4l_record_view.html:96
+#: templates/p4l/p4l_record_view.html:100
msgid "collations"
msgstr "collations"
-#: templates/p4l/p4l_record_view.html:100
+#: templates/p4l/p4l_record_view.html:104
msgid "volume issues"
msgstr "volume issues"
-#: templates/p4l/p4l_record_view.html:106
-#: templates/p4l/p4l_record_view.html:149
+#: templates/p4l/p4l_record_view.html:110
+#: templates/p4l/p4l_record_view.html:153
msgid "Volume"
msgstr "Volume"
-#: templates/p4l/p4l_record_view.html:107
-#: templates/p4l/p4l_record_view.html:131
-#: templates/p4l/p4l_record_view.html:176
+#: 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:116
+#: templates/p4l/p4l_record_view.html:120
msgid "project names"
msgstr "project names"
-#: templates/p4l/p4l_record_view.html:120
+#: templates/p4l/p4l_record_view.html:124
msgid "periodicals"
msgstr "periodicals"
-#: templates/p4l/p4l_record_view.html:124
+#: templates/p4l/p4l_record_view.html:128
msgid "meetings"
msgstr "meetings"
-#: templates/p4l/p4l_record_view.html:132
-#: templates/p4l/p4l_record_view.html:177
+#: templates/p4l/p4l_record_view.html:136
+#: templates/p4l/p4l_record_view.html:181
msgid "Place"
msgstr "Place"
-#: templates/p4l/p4l_record_view.html:134
-#: templates/p4l/p4l_record_view.html:179
+#: templates/p4l/p4l_record_view.html:138
+#: templates/p4l/p4l_record_view.html:183
msgid "Year"
msgstr "Year"
-#: templates/p4l/p4l_record_view.html:142
+#: templates/p4l/p4l_record_view.html:146
msgid "series"
msgstr "series"
-#: templates/p4l/p4l_record_view.html:157
+#: templates/p4l/p4l_record_view.html:161
msgid "authors"
msgstr "authors"
-#: templates/p4l/p4l_record_view.html:161
+#: templates/p4l/p4l_record_view.html:165
msgid "subject persons"
msgstr "subject persons"
-#: templates/p4l/p4l_record_view.html:165
+#: templates/p4l/p4l_record_view.html:169
msgid "subject corporate bodies"
msgstr "subject corporate bodies"
-#: templates/p4l/p4l_record_view.html:169
+#: templates/p4l/p4l_record_view.html:173
msgid "subject meetings"
msgstr "subject meetings"
-#: templates/p4l/p4l_record_view.html:187
+#: templates/p4l/p4l_record_view.html:191
msgid "corporate authors"
msgstr "corporate authors"
-#: templates/p4l/p4l_record_view.html:191
+#: templates/p4l/p4l_record_view.html:195
+#, fuzzy
+msgid "corporate author label"
+msgstr "corporate authors"
+
+#: templates/p4l/p4l_record_view.html:199
msgid "Urls"
msgstr "Urls"
-#: templates/p4l/p4l_record_view.html:197
+#: templates/p4l/p4l_record_view.html:205
msgid "Address"
msgstr "Address"
-#: templates/p4l/p4l_record_view.html:198
+#: templates/p4l/p4l_record_view.html:206
msgid "Display"
msgstr "Display"
-#: templates/p4l/p4l_record_view.html:199
-msgid "Access level"
-msgstr "Access level"
-
-#: templates/p4l/p4l_record_view.html:207
+#: templates/p4l/p4l_record_view.html:214
msgid "record type"
msgstr "record type"
-#: templates/p4l/p4l_record_view.html:211
+#: templates/p4l/p4l_record_view.html:218
+msgid "audiences"
+msgstr ""
+
+#: templates/p4l/p4l_record_view.html:222
msgid "is document part"
msgstr "is document part"
-#: templates/p4l/p4l_record_view.html:215
-msgid "is multilingual"
-msgstr "is multilingual"
+#: templates/p4l/p4l_record_view.html:226
+msgid "is hidden"
+msgstr ""
+
+#: templates/p4l/p4l_record_view.html:230
+msgid "is restricted"
+msgstr ""
+
+#: templates/p4l/record_update_form.html:47
+#: templates/p4l/record_update_form.html:235
+#: templates/p4l/translations.html:20
+#, fuzzy
+msgid "View the record"
+msgstr "Modify the record type"
#: templates/p4l/translations.html:3
msgid "Add"
@@ -321,30 +369,35 @@
msgstr "Add a new organization"
#: templates/p4l/translations.html:12
+#, fuzzy
+msgid "Add a new audience"
+msgstr "Add a new subject"
+
+#: templates/p4l/translations.html:13
msgid "Modify the language"
msgstr "Modify the language"
-#: templates/p4l/translations.html:13
+#: templates/p4l/translations.html:14
msgid "Modify the record type"
msgstr "Modify the record type"
-#: templates/p4l/translations.html:14
+#: templates/p4l/translations.html:15
msgid "title"
msgstr "title"
-#: templates/p4l/translations.html:15
+#: templates/p4l/translations.html:16
msgid "abstract"
msgstr "abstract"
-#: templates/p4l/translations.html:16
+#: templates/p4l/translations.html:17
msgid "collation"
msgstr "collation"
-#: templates/p4l/translations.html:17
+#: templates/p4l/translations.html:18
msgid "label"
msgstr "label"
-#: templates/p4l/translations.html:18
+#: templates/p4l/translations.html:19
msgid "name"
msgstr "name"
@@ -359,3 +412,9 @@
#: templates/registration/login.html:20 templates/registration/login.html:22
msgid "Password"
msgstr "Password"
+
+#~ msgid "Access level"
+#~ msgstr "Access level"
+
+#~ msgid "is multilingual"
+#~ msgstr "is multilingual"
--- a/src/p4l/locale/es/LC_MESSAGES/django.po Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/locale/es/LC_MESSAGES/django.po Fri Sep 20 00:14:42 2013 +0200
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-11 05:28-0500\n"
+"POT-Creation-Date: 2013-09-18 09:42-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:36 templates/p4l/p4l_record_view.html:51
+#: admin.py:10 forms.py:36 templates/p4l/p4l_record_view.html:55
msgid "language"
msgstr "language"
@@ -66,8 +66,8 @@
msgid "Record List"
msgstr "Record list"
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:29
-#: templates/p4l/p4l_home.html:66
+#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:30
+#: templates/p4l/p4l_home.html:67
msgid "Page"
msgstr "Page"
@@ -75,27 +75,41 @@
msgid "Title"
msgstr "Title"
-#: templates/p4l/p4l_home.html:26 templates/p4l/p4l_home.html.py:63
+#: templates/p4l/p4l_home.html:19
+#, fuzzy
+msgid "New record"
+msgstr "No record"
+
+#: templates/p4l/p4l_home.html:27 templates/p4l/p4l_home.html.py:64
msgid "Previous"
msgstr "Previous"
-#: templates/p4l/p4l_home.html:29 templates/p4l/p4l_home.html.py:66
+#: templates/p4l/p4l_home.html:30 templates/p4l/p4l_home.html.py:67
msgid "on"
msgstr "on"
-#: templates/p4l/p4l_home.html:32 templates/p4l/p4l_home.html.py:69
+#: templates/p4l/p4l_home.html:33 templates/p4l/p4l_home.html.py:70
msgid "Next"
msgstr "Next"
-#: templates/p4l/p4l_home.html:39 templates/p4l/p4l_record_view.html:59
+#: templates/p4l/p4l_home.html:40 templates/p4l/p4l_record_view.html:35
+msgid "identifier"
+msgstr "identifier"
+
+#: templates/p4l/p4l_home.html:40 templates/p4l/p4l_record_view.html:63
msgid "titles"
msgstr "titles"
-#: templates/p4l/p4l_home.html:39
+#: templates/p4l/p4l_home.html:40
+#, fuzzy
+msgid "dates"
+msgstr "Update"
+
+#: templates/p4l/p4l_home.html:40
msgid "actions"
msgstr "actions"
-#: templates/p4l/p4l_home.html:55
+#: templates/p4l/p4l_home.html:56
msgid "No record"
msgstr "No record"
@@ -109,181 +123,215 @@
msgid "View"
msgstr "View"
+#: templates/p4l/p4l_record_view.html:10
+#: templates/p4l/p4l_record_view.html:236 templates/p4l/translations.html:21
+#, fuzzy
+msgid "Edit the record"
+msgstr "Modify the record type"
+
#: templates/p4l/p4l_record_view.html:11
+#: templates/p4l/p4l_record_view.html:237
+#: templates/p4l/record_update_form.html:48
+#: templates/p4l/record_update_form.html:236
+msgid ""
+"Are your sure you want to delete this record ? This action est irreversible."
+msgstr ""
+
+#: templates/p4l/p4l_record_view.html:11
+#: templates/p4l/p4l_record_view.html:237
+#: templates/p4l/record_update_form.html:48
+#: templates/p4l/record_update_form.html:236
+#, fuzzy
+msgid "Delete the record"
+msgstr "Modify the record type"
+
+#: templates/p4l/p4l_record_view.html:15
msgid "property"
msgstr "property"
-#: templates/p4l/p4l_record_view.html:11
+#: templates/p4l/p4l_record_view.html:15
msgid "value"
msgstr "value"
-#: templates/p4l/p4l_record_view.html:19
+#: templates/p4l/p4l_record_view.html:23
msgid "subjects"
msgstr "subjects"
-#: templates/p4l/p4l_record_view.html:23
+#: templates/p4l/p4l_record_view.html:27
msgid "themes"
msgstr "themes"
-#: templates/p4l/p4l_record_view.html:27
+#: templates/p4l/p4l_record_view.html:31
msgid "countries"
msgstr "countries"
-#: templates/p4l/p4l_record_view.html:31
-msgid "identifier"
-msgstr "identifier"
-
-#: templates/p4l/p4l_record_view.html:35
+#: templates/p4l/p4l_record_view.html:39
msgid "notes"
msgstr "notes"
-#: templates/p4l/p4l_record_view.html:39
+#: templates/p4l/p4l_record_view.html:43
msgid "issns"
msgstr "issns"
-#: templates/p4l/p4l_record_view.html:43
+#: templates/p4l/p4l_record_view.html:47
msgid "isbns"
msgstr "isbns"
-#: templates/p4l/p4l_record_view.html:47
+#: templates/p4l/p4l_record_view.html:51
msgid "document code"
msgstr "document code"
-#: templates/p4l/p4l_record_view.html:55
+#: templates/p4l/p4l_record_view.html:59
msgid "other languages"
msgstr "other languages"
-#: templates/p4l/p4l_record_view.html:63
+#: templates/p4l/p4l_record_view.html:67
msgid "abstracts"
msgstr "abstracts"
-#: templates/p4l/p4l_record_view.html:67
+#: templates/p4l/p4l_record_view.html:71
msgid "added titles"
msgstr "addes titles"
-#: templates/p4l/p4l_record_view.html:71
+#: templates/p4l/p4l_record_view.html:75
msgid "titles main document"
msgstr "titles main document"
-#: templates/p4l/p4l_record_view.html:75
+#: templates/p4l/p4l_record_view.html:79
msgid "edition statement"
msgstr "edition statement"
-#: templates/p4l/p4l_record_view.html:79
+#: templates/p4l/p4l_record_view.html:83
msgid "imprints"
msgstr "imprints"
-#: templates/p4l/p4l_record_view.html:85
+#: templates/p4l/p4l_record_view.html:89
msgid "City"
msgstr "City"
-#: templates/p4l/p4l_record_view.html:86
+#: templates/p4l/p4l_record_view.html:90
msgid "Publisher"
msgstr "Publisher"
-#: templates/p4l/p4l_record_view.html:87
-#: templates/p4l/p4l_record_view.html:133
-#: templates/p4l/p4l_record_view.html:178
+#: 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:88
-#: templates/p4l/p4l_record_view.html:108
+#: templates/p4l/p4l_record_view.html:92
+#: templates/p4l/p4l_record_view.html:112
msgid "Language"
msgstr "Language"
-#: templates/p4l/p4l_record_view.html:96
+#: templates/p4l/p4l_record_view.html:100
msgid "collations"
msgstr "collations"
-#: templates/p4l/p4l_record_view.html:100
+#: templates/p4l/p4l_record_view.html:104
msgid "volume issues"
msgstr "volume issues"
-#: templates/p4l/p4l_record_view.html:106
-#: templates/p4l/p4l_record_view.html:149
+#: templates/p4l/p4l_record_view.html:110
+#: templates/p4l/p4l_record_view.html:153
msgid "Volume"
msgstr "Volume"
-#: templates/p4l/p4l_record_view.html:107
-#: templates/p4l/p4l_record_view.html:131
-#: templates/p4l/p4l_record_view.html:176
+#: 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:116
+#: templates/p4l/p4l_record_view.html:120
msgid "project names"
msgstr "project names"
-#: templates/p4l/p4l_record_view.html:120
+#: templates/p4l/p4l_record_view.html:124
msgid "periodicals"
msgstr "periodicals"
-#: templates/p4l/p4l_record_view.html:124
+#: templates/p4l/p4l_record_view.html:128
msgid "meetings"
msgstr "meetings"
-#: templates/p4l/p4l_record_view.html:132
-#: templates/p4l/p4l_record_view.html:177
+#: templates/p4l/p4l_record_view.html:136
+#: templates/p4l/p4l_record_view.html:181
msgid "Place"
msgstr "Place"
-#: templates/p4l/p4l_record_view.html:134
-#: templates/p4l/p4l_record_view.html:179
+#: templates/p4l/p4l_record_view.html:138
+#: templates/p4l/p4l_record_view.html:183
msgid "Year"
msgstr "Year"
-#: templates/p4l/p4l_record_view.html:142
+#: templates/p4l/p4l_record_view.html:146
msgid "series"
msgstr "series"
-#: templates/p4l/p4l_record_view.html:157
+#: templates/p4l/p4l_record_view.html:161
msgid "authors"
msgstr "authors"
-#: templates/p4l/p4l_record_view.html:161
+#: templates/p4l/p4l_record_view.html:165
msgid "subject persons"
msgstr "subject persons"
-#: templates/p4l/p4l_record_view.html:165
+#: templates/p4l/p4l_record_view.html:169
msgid "subject corporate bodies"
msgstr "subject corporate bodies"
-#: templates/p4l/p4l_record_view.html:169
+#: templates/p4l/p4l_record_view.html:173
msgid "subject meetings"
msgstr "subject meetings"
-#: templates/p4l/p4l_record_view.html:187
+#: templates/p4l/p4l_record_view.html:191
msgid "corporate authors"
msgstr "corporate authors"
-#: templates/p4l/p4l_record_view.html:191
+#: templates/p4l/p4l_record_view.html:195
+#, fuzzy
+msgid "corporate author label"
+msgstr "corporate authors"
+
+#: templates/p4l/p4l_record_view.html:199
msgid "Urls"
msgstr "Urls"
-#: templates/p4l/p4l_record_view.html:197
+#: templates/p4l/p4l_record_view.html:205
msgid "Address"
msgstr "Address"
-#: templates/p4l/p4l_record_view.html:198
+#: templates/p4l/p4l_record_view.html:206
msgid "Display"
msgstr "Display"
-#: templates/p4l/p4l_record_view.html:199
-msgid "Access level"
-msgstr "Access level"
-
-#: templates/p4l/p4l_record_view.html:207
+#: templates/p4l/p4l_record_view.html:214
msgid "record type"
msgstr "record type"
-#: templates/p4l/p4l_record_view.html:211
+#: templates/p4l/p4l_record_view.html:218
+msgid "audiences"
+msgstr ""
+
+#: templates/p4l/p4l_record_view.html:222
msgid "is document part"
msgstr "is document part"
-#: templates/p4l/p4l_record_view.html:215
-msgid "is multilingual"
-msgstr "is multilingual"
+#: templates/p4l/p4l_record_view.html:226
+msgid "is hidden"
+msgstr ""
+
+#: templates/p4l/p4l_record_view.html:230
+msgid "is restricted"
+msgstr ""
+
+#: templates/p4l/record_update_form.html:47
+#: templates/p4l/record_update_form.html:235
+#: templates/p4l/translations.html:20
+#, fuzzy
+msgid "View the record"
+msgstr "Modify the record type"
#: templates/p4l/translations.html:3
msgid "Add"
@@ -322,30 +370,35 @@
msgstr "Add a new organization"
#: templates/p4l/translations.html:12
+#, fuzzy
+msgid "Add a new audience"
+msgstr "Add a new subject"
+
+#: templates/p4l/translations.html:13
msgid "Modify the language"
msgstr "Modify the language"
-#: templates/p4l/translations.html:13
+#: templates/p4l/translations.html:14
msgid "Modify the record type"
msgstr "Modify the record type"
-#: templates/p4l/translations.html:14
+#: templates/p4l/translations.html:15
msgid "title"
msgstr "title"
-#: templates/p4l/translations.html:15
+#: templates/p4l/translations.html:16
msgid "abstract"
msgstr "abstract"
-#: templates/p4l/translations.html:16
+#: templates/p4l/translations.html:17
msgid "collation"
msgstr "collation"
-#: templates/p4l/translations.html:17
+#: templates/p4l/translations.html:18
msgid "label"
msgstr "label"
-#: templates/p4l/translations.html:18
+#: templates/p4l/translations.html:19
msgid "name"
msgstr "name"
@@ -360,3 +413,9 @@
#: templates/registration/login.html:20 templates/registration/login.html:22
msgid "Password"
msgstr "Password"
+
+#~ msgid "Access level"
+#~ msgstr "Access level"
+
+#~ msgid "is multilingual"
+#~ msgstr "is multilingual"
Binary file src/p4l/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/p4l/locale/fr/LC_MESSAGES/django.po Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/locale/fr/LC_MESSAGES/django.po Fri Sep 20 00:14:42 2013 +0200
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-11 05:28-0500\n"
+"POT-Creation-Date: 2013-09-18 09:42-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,9 @@
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: admin.py:10 forms.py:36 templates/p4l/p4l_record_view.html:51
+#: admin.py:10
+#: forms.py:36
+#: templates/p4l/p4l_record_view.html:55
msgid "language"
msgstr "langue"
@@ -37,20 +39,22 @@
msgid "Search"
msgstr "Chercher"
-#: semantictree/forms/widgets.py:43 semantictree/forms/widgets.py:80
+#: semantictree/forms/widgets.py:43
+#: semantictree/forms/widgets.py:80
msgid ""
"\"data-url\", \"data-query\", \"data-root-query\", \"data-childs-query\" and "
"\"data-child-count-query\" must be set in CharField configuration"
-msgstr ""
-"\"data-url\", \"data-query\", \"data-root-query\", \"data-childs-query\" et "
+msgstr "\"data-url\", \"data-query\", \"data-root-query\", \"data-childs-query\" et "
"\"data-child-count-query\" doivent être renseignés dans la configuration "
"CharField"
-#: semantictree/forms/widgets.py:44 semantictree/forms/widgets.py:81
+#: semantictree/forms/widgets.py:44
+#: semantictree/forms/widgets.py:81
msgid "Browse"
msgstr "Parcourir"
-#: semantictree/forms/widgets.py:49 semantictree/forms/widgets.py:86
+#: semantictree/forms/widgets.py:49
+#: semantictree/forms/widgets.py:86
msgid "or"
msgstr "ou"
@@ -58,17 +62,20 @@
msgid "logout"
msgstr "deconnection"
-#: templates/p4l/p4l_base.html:37 templates/registration/login.html:4
+#: templates/p4l/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/p4l_home.html:6
+#: templates/p4l/p4l_home.html.py:10
msgid "Record List"
msgstr "Liste notice"
-#: templates/p4l/p4l_home.html:6 templates/p4l/p4l_home.html.py:29
-#: templates/p4l/p4l_home.html:66
+#: templates/p4l/p4l_home.html:6
+#: templates/p4l/p4l_home.html.py:30
+#: templates/p4l/p4l_home.html:67
msgid "Page"
msgstr "Page"
@@ -76,27 +83,44 @@
msgid "Title"
msgstr "Titre"
-#: templates/p4l/p4l_home.html:26 templates/p4l/p4l_home.html.py:63
+#: templates/p4l/p4l_home.html:19
+msgid "New record"
+msgstr "Nouvelle notice"
+
+#: templates/p4l/p4l_home.html:27
+#: templates/p4l/p4l_home.html.py:64
msgid "Previous"
msgstr "Préc."
-#: templates/p4l/p4l_home.html:29 templates/p4l/p4l_home.html.py:66
+#: templates/p4l/p4l_home.html:30
+#: templates/p4l/p4l_home.html.py:67
msgid "on"
msgstr "sur"
-#: templates/p4l/p4l_home.html:32 templates/p4l/p4l_home.html.py:69
+#: templates/p4l/p4l_home.html:33
+#: templates/p4l/p4l_home.html.py:70
msgid "Next"
msgstr "Suiv."
-#: templates/p4l/p4l_home.html:39 templates/p4l/p4l_record_view.html:59
+#: templates/p4l/p4l_home.html:40
+#: templates/p4l/p4l_record_view.html:35
+msgid "identifier"
+msgstr "identifiant"
+
+#: templates/p4l/p4l_home.html:40
+#: templates/p4l/p4l_record_view.html:63
msgid "titles"
msgstr "titres"
-#: templates/p4l/p4l_home.html:39
+#: templates/p4l/p4l_home.html:40
+msgid "dates"
+msgstr "dates"
+
+#: templates/p4l/p4l_home.html:40
msgid "actions"
msgstr "actions"
-#: templates/p4l/p4l_home.html:55
+#: templates/p4l/p4l_home.html:56
msgid "No record"
msgstr "Pas de notice"
@@ -110,181 +134,213 @@
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:48
+#: templates/p4l/record_update_form.html:236
+msgid ""
+"Are your sure you want to delete this record ? This action est 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:48
+#: templates/p4l/record_update_form.html:236
+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:11
+#: templates/p4l/p4l_record_view.html:15
msgid "value"
msgstr "valeur"
-#: templates/p4l/p4l_record_view.html:19
+#: templates/p4l/p4l_record_view.html:23
msgid "subjects"
msgstr "sujets"
-#: templates/p4l/p4l_record_view.html:23
+#: templates/p4l/p4l_record_view.html:27
msgid "themes"
msgstr "thèmes"
-#: templates/p4l/p4l_record_view.html:27
+#: templates/p4l/p4l_record_view.html:31
msgid "countries"
msgstr "pays"
-#: templates/p4l/p4l_record_view.html:31
-msgid "identifier"
-msgstr "identifiant"
-
-#: templates/p4l/p4l_record_view.html:35
+#: templates/p4l/p4l_record_view.html:39
msgid "notes"
msgstr "notes"
-#: templates/p4l/p4l_record_view.html:39
+#: templates/p4l/p4l_record_view.html:43
msgid "issns"
msgstr "issns"
-#: templates/p4l/p4l_record_view.html:43
+#: templates/p4l/p4l_record_view.html:47
msgid "isbns"
msgstr "isbns"
-#: templates/p4l/p4l_record_view.html:47
+#: templates/p4l/p4l_record_view.html:51
msgid "document code"
msgstr "code document"
-#: templates/p4l/p4l_record_view.html:55
+#: templates/p4l/p4l_record_view.html:59
msgid "other languages"
msgstr "autres langues"
-#: templates/p4l/p4l_record_view.html:63
+#: templates/p4l/p4l_record_view.html:67
msgid "abstracts"
msgstr "résumés"
-#: templates/p4l/p4l_record_view.html:67
+#: templates/p4l/p4l_record_view.html:71
msgid "added titles"
msgstr "titres ajoutés"
-#: templates/p4l/p4l_record_view.html:71
+#: templates/p4l/p4l_record_view.html:75
msgid "titles main document"
msgstr "titre doc. principal"
-#: templates/p4l/p4l_record_view.html:75
+#: templates/p4l/p4l_record_view.html:79
msgid "edition statement"
msgstr "déclatation pub."
-#: templates/p4l/p4l_record_view.html:79
+#: templates/p4l/p4l_record_view.html:83
msgid "imprints"
msgstr "impressions"
-#: templates/p4l/p4l_record_view.html:85
+#: templates/p4l/p4l_record_view.html:89
msgid "City"
msgstr "Ville"
-#: templates/p4l/p4l_record_view.html:86
+#: templates/p4l/p4l_record_view.html:90
msgid "Publisher"
msgstr "Éditeur"
-#: templates/p4l/p4l_record_view.html:87
-#: templates/p4l/p4l_record_view.html:133
-#: templates/p4l/p4l_record_view.html:178
+#: 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:88
-#: templates/p4l/p4l_record_view.html:108
+#: templates/p4l/p4l_record_view.html:92
+#: templates/p4l/p4l_record_view.html:112
msgid "Language"
msgstr "Langue"
-#: templates/p4l/p4l_record_view.html:96
+#: templates/p4l/p4l_record_view.html:100
msgid "collations"
msgstr "paginations"
-#: templates/p4l/p4l_record_view.html:100
+#: templates/p4l/p4l_record_view.html:104
msgid "volume issues"
msgstr "volume de parution"
-#: templates/p4l/p4l_record_view.html:106
-#: templates/p4l/p4l_record_view.html:149
+#: templates/p4l/p4l_record_view.html:110
+#: templates/p4l/p4l_record_view.html:153
msgid "Volume"
msgstr "Volume"
-#: templates/p4l/p4l_record_view.html:107
-#: templates/p4l/p4l_record_view.html:131
-#: templates/p4l/p4l_record_view.html:176
+#: 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:116
+#: templates/p4l/p4l_record_view.html:120
msgid "project names"
msgstr "noms de projet"
-#: templates/p4l/p4l_record_view.html:120
+#: templates/p4l/p4l_record_view.html:124
msgid "periodicals"
msgstr "périodiques"
-#: templates/p4l/p4l_record_view.html:124
+#: templates/p4l/p4l_record_view.html:128
msgid "meetings"
msgstr "réunion"
-#: templates/p4l/p4l_record_view.html:132
-#: templates/p4l/p4l_record_view.html:177
+#: templates/p4l/p4l_record_view.html:136
+#: templates/p4l/p4l_record_view.html:181
msgid "Place"
msgstr "Lieu"
-#: templates/p4l/p4l_record_view.html:134
-#: templates/p4l/p4l_record_view.html:179
+#: 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:142
+#: templates/p4l/p4l_record_view.html:146
msgid "series"
msgstr "séries"
-#: templates/p4l/p4l_record_view.html:157
+#: templates/p4l/p4l_record_view.html:161
msgid "authors"
msgstr "auteurs"
-#: templates/p4l/p4l_record_view.html:161
+#: templates/p4l/p4l_record_view.html:165
msgid "subject persons"
msgstr "personnes sujets"
-#: templates/p4l/p4l_record_view.html:165
+#: templates/p4l/p4l_record_view.html:169
msgid "subject corporate bodies"
msgstr "personne morale sujets"
-#: templates/p4l/p4l_record_view.html:169
+#: templates/p4l/p4l_record_view.html:173
msgid "subject meetings"
msgstr "réunion sujets"
-#: templates/p4l/p4l_record_view.html:187
+#: templates/p4l/p4l_record_view.html:191
msgid "corporate authors"
msgstr "entités auteurs"
-#: templates/p4l/p4l_record_view.html:191
+#: 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:197
+#: templates/p4l/p4l_record_view.html:205
msgid "Address"
msgstr "Adresse"
-#: templates/p4l/p4l_record_view.html:198
+#: templates/p4l/p4l_record_view.html:206
msgid "Display"
msgstr "Affichage"
-#: templates/p4l/p4l_record_view.html:199
-msgid "Access level"
-msgstr "Niveau d'accès"
-
-#: templates/p4l/p4l_record_view.html:207
+#: templates/p4l/p4l_record_view.html:214
msgid "record type"
msgstr "type de notice"
-#: templates/p4l/p4l_record_view.html:211
+#: 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:215
-msgid "is multilingual"
-msgstr "multilingue"
+#: 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:47
+#: templates/p4l/record_update_form.html:235
+#: templates/p4l/translations.html:20
+msgid "View the record"
+msgstr "Voir la notice"
#: templates/p4l/translations.html:3
msgid "Add"
@@ -323,30 +379,34 @@
msgstr "Ajouter une nouvelle organisation"
#: templates/p4l/translations.html:12
+msgid "Add a new audience"
+msgstr "Ajouter une nouvelle audience"
+
+#: templates/p4l/translations.html:13
msgid "Modify the language"
msgstr "Modifier la langue"
-#: templates/p4l/translations.html:13
+#: templates/p4l/translations.html:14
msgid "Modify the record type"
msgstr "Modifier le type de notice"
-#: templates/p4l/translations.html:14
+#: templates/p4l/translations.html:15
msgid "title"
msgstr "titre"
-#: templates/p4l/translations.html:15
+#: templates/p4l/translations.html:16
msgid "abstract"
msgstr "résumé"
-#: templates/p4l/translations.html:16
+#: templates/p4l/translations.html:17
msgid "collation"
msgstr "pagination"
-#: templates/p4l/translations.html:17
+#: templates/p4l/translations.html:18
msgid "label"
msgstr "label"
-#: templates/p4l/translations.html:18
+#: templates/p4l/translations.html:19
msgid "name"
msgstr "Nom"
@@ -354,10 +414,13 @@
msgid "Sorry, that's not a valid username or password."
msgstr "Désolé, utilisateur ou mot de passe invalide"
-#: templates/registration/login.html:14 templates/registration/login.html:16
+#: templates/registration/login.html:14
+#: templates/registration/login.html:16
msgid "Username"
msgstr "Utilisateur"
-#: templates/registration/login.html:20 templates/registration/login.html:22
+#: templates/registration/login.html:20
+#: templates/registration/login.html:22
msgid "Password"
msgstr "Mot de passe"
+
--- a/src/p4l/management/commands/import_record.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/management/commands/import_record.py Fri Sep 20 00:14:42 2013 +0200
@@ -132,8 +132,14 @@
record.notes = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:notes ?o .}", bindings={'s':URIRef(record.uri)})
record.recordType = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s dct:type ?o .}", bindings={'s':URIRef(record.uri)})
record.isDocumentPart = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:isDocumentPart ?o .}", bindings={'s':URIRef(record.uri)}, convert=self.convert_bool)
- record.isMultilingual = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:isMultilingual ?o .}", bindings={'s':URIRef(record.uri)}, convert=self.convert_bool)
+ record.hidden = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:hidden ?o .}", bindings={'s':URIRef(record.uri)}, convert=self.convert_bool)
+ if record.hidden is None:
+ record.hidden = False
+ record.restricted = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:restricted ?o .}", bindings={'s':URIRef(record.uri)}, convert=self.convert_bool)
+ if record.restricted is None:
+ record.restricted = False
record.editionStatement = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:editionStatement ?o .}", bindings={'s':URIRef(record.uri)})
+ record.corporateAuthorLabel = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s iiep:corporateAuthorLabel ?o .}", bindings={'s':URIRef(record.uri)})
language = self.extract_single_value_form_graph(graph,"SELECT DISTINCT ?o WHERE { ?s dct:language ?o .}", bindings={'s':URIRef(record.uri)})
if language:
@@ -148,6 +154,7 @@
self.add_to_related_collection(record.authors, graph, ['name'], "SELECT ?o WHERE { ?s iiep:author ?o .}", bindings={'s':URIRef(record.uri)})
self.add_to_related_collection(record.subjectPersons, graph, ['name'], "SELECT ?o WHERE { ?s iiep:subjectPerson ?o .}", bindings={'s':URIRef(record.uri)})
self.add_to_related_collection(record.projectNames, graph, ['uri'], "SELECT ?o WHERE { ?s iiep:projectName ?o . }")
+ self.add_to_related_collection(record.audiences, graph, ['uri'], "SELECT ?o WHERE { ?s dct:audience ?o .}", bindings={'s':URIRef(record.uri)})
self.add_to_related_collection(
record.periodicals,
@@ -277,8 +284,8 @@
self.add_to_related_collection(
record.urls,
graph,
- ['address', 'display', 'accessLevel'],
- "SELECT ?a ?d ?al WHERE { [ iiep:url ?bnode ]. OPTIONAL { ?bnode iiep:address ?a }. OPTIONAL { ?bnode iiep:display ?d }. OPTIONAL { ?bnode iiep:accessLevel ?al }.}",
+ ['address', 'display'],
+ "SELECT ?a ?d WHERE { [ iiep:url ?bnode ]. OPTIONAL { ?bnode iiep:address ?a }. OPTIONAL { ?bnode iiep:display ?d }.}",
)
return record
--- a/src/p4l/migrations/0001_initial.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/migrations/0001_initial.py Fri Sep 20 00:14:42 2013 +0200
@@ -49,7 +49,6 @@
('record', self.gf('django.db.models.fields.related.ForeignKey')(related_name='urls', to=orm['p4l.Record'])),
('address', self.gf('django.db.models.fields.CharField')(max_length=2048, db_index=True)),
('display', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=2048, null=True, blank=True)),
- ('accessLevel', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=512, null=True, blank=True)),
))
db.send_create_signal('p4l', ['Url'])
@@ -74,6 +73,13 @@
))
db.send_create_signal('p4l', ['Country'])
+ # Adding model 'Audience'
+ db.create_table(u'p4l_audience', (
+ (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('uri', self.gf('django.db.models.fields.URLField')(unique=True, max_length=2048, db_index=True)),
+ ))
+ db.send_create_signal('p4l', ['Audience'])
+
# Adding model 'Isbn'
db.create_table(u'p4l_isbn', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
@@ -221,9 +227,11 @@
('notes', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
('language', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['p4l.Language'], null=True, blank=True)),
('editionStatement', self.gf('django.db.models.fields.CharField')(max_length=1024, null=True, blank=True)),
- ('recordType', self.gf('django.db.models.fields.URLField')(max_length=2048)),
+ ('corporateAuthorLabel', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=2048, null=True, blank=True)),
+ ('recordType', self.gf('django.db.models.fields.URLField')(max_length=2048, null=True, blank=True)),
('isDocumentPart', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('isMultilingual', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('hidden', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('restricted', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('p4l', ['Record'])
@@ -283,6 +291,14 @@
))
db.create_unique(u'p4l_record_corporateAuthors', ['record_id', 'corporateauthor_id'])
+ # Adding M2M table for field audiences on 'Record'
+ db.create_table(u'p4l_record_audiences', (
+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+ ('record', models.ForeignKey(orm['p4l.record'], null=False)),
+ ('audience', models.ForeignKey(orm['p4l.audience'], null=False))
+ ))
+ db.create_unique(u'p4l_record_audiences', ['record_id', 'audience_id'])
+
# Adding model 'User'
db.create_table(u'p4l_user', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
@@ -342,6 +358,9 @@
# Deleting model 'Country'
db.delete_table(u'p4l_country')
+ # Deleting model 'Audience'
+ db.delete_table(u'p4l_audience')
+
# Deleting model 'Isbn'
db.delete_table(u'p4l_isbn')
@@ -411,6 +430,9 @@
# Removing M2M table for field corporateAuthors on 'Record'
db.delete_table('p4l_record_corporateAuthors')
+ # Removing M2M table for field audiences on 'Record'
+ db.delete_table('p4l_record_audiences')
+
# Deleting model 'User'
db.delete_table(u'p4l_user')
@@ -456,6 +478,11 @@
'record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'addedTitles'", 'to': "orm['p4l.Record']"}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'db_index': 'True'})
},
+ 'p4l.audience': {
+ 'Meta': {'object_name': 'Audience'},
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'uri': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '2048', 'db_index': 'True'})
+ },
'p4l.author': {
'Meta': {'object_name': 'Author'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
@@ -539,18 +566,21 @@
},
'p4l.record': {
'Meta': {'object_name': 'Record'},
+ 'audiences': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['p4l.Audience']", 'symmetrical': 'False'}),
+ 'corporateAuthorLabel': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}),
'corporateAuthors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'recordsCorporateAuthor'", 'symmetrical': 'False', 'to': "orm['p4l.CorporateAuthor']"}),
'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['p4l.Country']", 'symmetrical': 'False'}),
'editionStatement': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),
+ 'hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'identifier': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
'isDocumentPart': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'isMultilingual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'language': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['p4l.Language']", 'null': 'True', 'blank': 'True'}),
'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'otherLanguages': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'otherLanguage_record'", 'symmetrical': 'False', 'to': "orm['p4l.Language']"}),
'projectNames': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['p4l.ProjectName']", 'symmetrical': 'False'}),
- 'recordType': ('django.db.models.fields.URLField', [], {'max_length': '2048'}),
+ 'recordType': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}),
+ 'restricted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'subjectCorporateBodies': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'recordsSubjectCorporateBody'", 'symmetrical': 'False', 'to': "orm['p4l.CorporateAuthor']"}),
'subjects': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['p4l.Subject']", 'symmetrical': 'False'}),
'themes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['p4l.Theme']", 'symmetrical': 'False'}),
@@ -606,7 +636,6 @@
},
'p4l.url': {
'Meta': {'object_name': 'Url'},
- 'accessLevel': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '512', 'null': 'True', 'blank': 'True'}),
'address': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'db_index': 'True'}),
'display': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
--- a/src/p4l/models/data.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/models/data.py Fri Sep 20 00:14:42 2013 +0200
@@ -28,7 +28,6 @@
record = models.ForeignKey('p4l.Record', related_name="urls", db_index=True)
address = models.CharField(max_length=2048, blank=False, null=False, db_index=True) #iiep:address
display = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:display
- accessLevel = models.CharField(max_length=512, blank=True, null=True, db_index=True) #iiep:accessLevel
class Subject(P4lModel):
@@ -37,8 +36,10 @@
class Theme(P4lModel):
uri = models.URLField(max_length=2048, unique=True, db_index=True)
+class Country(P4lModel):
+ uri = models.URLField(max_length=2048, unique=True, db_index=True)
-class Country(P4lModel):
+class Audience(P4lModel):
uri = models.URLField(max_length=2048, unique=True, db_index=True)
@@ -154,11 +155,14 @@
subjectCorporateBodies = models.ManyToManyField('p4l.CorporateAuthor', related_name='recordsSubjectCorporateBody') #iiep:subjectCorporateBody # <Organizations>
#subjectMeetings = foreign key from 'p4l.SubjectMeeting' #iiep:subjectMeeting
corporateAuthors = models.ManyToManyField('p4l.CorporateAuthor', related_name='recordsCorporateAuthor') #iiep:subjectCorporateBody # <Organizations>
+ corporateAuthorLabel = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:corporateAuthorLabel
#urls foreign Key from Url #iiep:url
- recordType = models.URLField(max_length=2048) #dct:type # <DocumentType>
+ audiences = models.ManyToManyField('p4l.Audience') #dct:audience # Unknown thesaurus
+ recordType = models.URLField(max_length=2048, blank=True, null=True) #dct:type # <DocumentType>
isDocumentPart = models.BooleanField() #iiep:isDocumentPart
- isMultilingual = models.BooleanField() #iiep:isMultilingual
+ hidden = models.BooleanField(default=False) #iiep:hidden
+ restricted = models.BooleanField(default=False) #iiep:restricted
def get_imprints_years(self):
return sorted(set([i.imprintDate for i in self.imprints.all() if i.imprintDate]))
--- a/src/p4l/settings.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/settings.py Fri Sep 20 00:14:42 2013 +0200
@@ -200,13 +200,14 @@
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
+SELECT DISTINCT ?uri ?label ?type
WHERE {
?uri a skos:Collection ;
- skos:inScheme <http://skos.um.es/unescothes/CS000> ;
- skos:prefLabel|rdfs:label ?label .
+ 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] }
+ FILTER NOT EXISTS { [skos:member ?uri] }.
}
ORDER BY ?label
""",
@@ -215,7 +216,7 @@
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
+SELECT DISTINCT ?uri ?label ?type
WHERE {
?uri skos:inScheme <http://skos.um.es/unescothes/CS000> .
{ ?uri a ?type
@@ -263,11 +264,12 @@
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
+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 .
+ skos:prefLabel|rdfs:label ?label ;
+ rdf:type ?type ;
FILTER (lang(?label) = %s).
FILTER NOT EXISTS { [skos:member ?uri] }
}
@@ -278,7 +280,7 @@
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
+SELECT DISTINCT ?uri ?label ?type
WHERE {
?uri skos:inScheme <http://www.iiep.unesco.org/plan4learning/scheme/Themes> .
{ ?uri a ?type
@@ -406,12 +408,13 @@
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
+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)
@@ -423,11 +426,12 @@
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
+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
"""
@@ -438,12 +442,13 @@
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
+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)
@@ -455,11 +460,12 @@
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
+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
"""
@@ -500,7 +506,12 @@
ORDER BY ?label
"""
}
-
+SPARQL_AUDIENCE_QUERIES = {
+"filter" : "",
+"root" : "",
+"childs" : "",
+"child-count" : ""
+}
REST_FRAMEWORK = {
# Use hyperlinked styles by default.
--- a/src/p4l/static/p4l/css/semantictree.css Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/static/p4l/css/semantictree.css Fri Sep 20 00:14:42 2013 +0200
@@ -19,6 +19,9 @@
ul .ui-autocomplete {
max-height: 300px;
}
+.thin-button{
+ padding-top: 3px;
+}
/*
.ng-scope {
border: 1px dashed red;
--- a/src/p4l/static/p4l/js/semantictree.js Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/static/p4l/js/semantictree.js Fri Sep 20 00:14:42 2013 +0200
@@ -23,10 +23,11 @@
success: function( data ) {
// build response
response( $.map( data["results"]["bindings"], function( item ) {
- //console.log(item["uri"]["value"] + " = " + item["label"]["value"]);
+ // If acronym
+ var s = (("acro" in item)?(item["acro"]["value"] + ". "):"") + item["label"]["value"];
return {
- label: item["label"]["value"],
- value: item["label"]["value"] + " (" + item["uri"]["value"] + ")"
+ label: s,
+ value: s + " (" + item["uri"]["value"] + ")"
}
}));
}
@@ -43,7 +44,7 @@
angular.element(this).controller('ngModel').$setViewValue(uri);
},
minLength: 2
- });
+ });
}
@@ -73,8 +74,9 @@
var root_query = $("#id_"+input_name).attr("data-root-query");
var childs_query = $("#id_"+input_name).attr("data-childs-query");
var child_count_query = $("#id_"+input_name).attr("data-child-count-query");
- $('#term-tree-'+input_name)
- .jstree({
+ // We load the tree only once
+ if(!$('#term-tree-'+input_name).hasClass("jstree")){
+ $('#term-tree-'+input_name).jstree({
themes: {
theme: "apple",
dots: true,
@@ -113,7 +115,7 @@
query: child_count_query,
$root: "<"+uri+">"
},
- headers: {
+ headers: {
Accept: "application/sparql-results+json;charset=UTF-8"
},
async: false,
@@ -122,23 +124,35 @@
}
});
}
+ // Test if the node is a collection and not selectable
+ var attr = {'rel':'default'};
+ if("type" in b[i]){
+ type_uri = b[i]["type"]["value"];
+ // type uri in kind of http://www[...]#Concept or http://www[...]#Collection
+ if(type_uri.substr(type_uri.indexOf("#") + 1).toLowerCase()=="collection"){
+ attr = {'rel':'leaf'};
+ }
+ }
+ // If acronym :
+ var s = (("acro" in b[i])?(b[i]["acro"]["value"] + ". "):"") + b[i]["label"]["value"];
// nb of child > 0 : state closed if yes, no state if not.
if(nb>0){
mytree.push({
"data" : {
- "title" : b[i]["label"]["value"] + " (" + nb + ") "
+ "title" : s + " (" + nb + ") "
},
"state" : "closed",
- "metadata" : {uri: "<"+uri+">", label:b[i]["label"]["value"]}
- //"language" : "en"
+ "metadata" : {uri: "<"+uri+">", label:s},
+ "attr": attr
});
}
else{
mytree.push({
"data" : {
- "title" : b[i]["label"]["value"]
+ "title" : s
},
- "metadata" : {uri: "<"+uri+">", label:b[i]["label"]["value"]}
+ "metadata" : {uri: "<"+uri+">", label:s},
+ "attr": attr
});
}
}
@@ -151,14 +165,17 @@
},
progressive_render: true
},
- plugins : [ "themes", "json_data", "ui"]
+ types : {
+ types: {
+ "leaf" : {
+ 'hover_node' : false,
+ 'select_node': function () {return false;}
+ }
+ }
+ },
+ plugins : [ "themes", "json_data", "ui", "types"]
});
- },
- close: function( event, ui ) {
- //console.log("close");
- // this is the span with class="dialog" and id="dialog-inputname"
- var input_name = this.id.substr(7);
- $.jstree._reference($('#term-tree-'+input_name)).destroy();
+ }
},
buttons: [
{
@@ -241,4 +258,11 @@
init_autocomplete();
init_browse();
init_tagit_autocomplete();
+ // Close dialogs on click/focus. focus can not be listened because of obvious loop problem.
+ $(document).on('click', '.semantic-tree', function() {
+ $(".dialog").dialog("close");
+ if(!$(this).is(":focus")){
+ $(this).focus();
+ }
+ });
});
\ No newline at end of file
--- a/src/p4l/static/p4l/templates/addSemanticUriForm.html Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/static/p4l/templates/addSemanticUriForm.html Fri Sep 20 00:14:42 2013 +0200
@@ -10,15 +10,15 @@
<div class="form-group col-md-8">
<input id="id_{{ $id }}" ng-model="addUriText" class="semantic-tree form-control col-md-10" type="text" placeholder="{{ placeholder }}"
data-url="{{ dataurl }}" data-query="{{ dataquery }}" data-root-query="{{ datarootquery }}"
- data-childs-query="{{ datachildsquery }}" data-child-count-query="{{ datachildcountquery }}" />
+ data-childs-query="{{ datachildsquery }}" data-child-count-query="{{ datachildcountquery }}" ng-disabled="dataquery==''" />
{{ 'or' | translate}}
<span id="dialog-link-container-{{ $id }}" class="dialog-link-container ui-state-default ui-corner-all">
- <a href="#" id="dialog-link-{{ $id }}" class="btn dialog-link" title="Browse">{{'Browse' | translate}}</a>
+ <a href="#" id="dialog-link-{{ $id }}" class="btn dialog-link thin-button" title="Browse" ng-class="{disabled: datarootquery==''}" >{{'Browse' | translate}}</a>
</span>
<span id="dialog-{{ $id }}" class="dialog" title="Select term"><span id="term-tree-{{ $id }}"></span></span>
</div>
<div class="form-group">
- <button type="submit" class="btn btn-primary" ng-click="addUriToList()">{{'Add' | translate}}</button>
+ <button type="submit" class="btn btn-primary" ng-click="addUriToList()" ng-class="{disabled: dataquery==''}">{{'Add' | translate}}</button>
</div>
</form>
</div>
\ No newline at end of file
--- a/src/p4l/static/p4l/templates/urlDisp.html Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/static/p4l/templates/urlDisp.html Fri Sep 20 00:14:42 2013 +0200
@@ -1,5 +1,4 @@
<span>
-<div class="col-md-5 break-word"><a href="{{ obj.address }}" target="_blank">{{ obj.address }}</a></div>
+<div class="col-md-7 break-word"><a href="{{ obj.address }}" target="_blank">{{ obj.address }}</a></div>
<div class="col-md-2">{{ obj.display }}</div>
-<div class="col-md-2">{{ obj.accessLevel }}</div>
</span>
\ No newline at end of file
--- a/src/p4l/static/p4l/templates/urlForm.html Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/static/p4l/templates/urlForm.html Fri Sep 20 00:14:42 2013 +0200
@@ -7,8 +7,4 @@
<label for="display-{{$id}}">{{'display'|translate}}</label>
<input type="text" placeholder="{{'display'|translate}}" ng_model="editedObj.display" id="display-{{$id}}" class="form-control"/>
</div>
- <div class="form-group">
- <label for="accessLevel-{{$id}}">{{'Access Level'|translate}}</label>
- <input type="text" placeholder="{{'Access Level'|translate}}" ng_model="editedObj.accessLevel" id="accessLevel-{{$id}}" class="form-control"/>
- </div>
</form>
\ No newline at end of file
--- a/src/p4l/templates/p4l/p4l_home.html Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/templates/p4l/p4l_home.html Fri Sep 20 00:14:42 2013 +0200
@@ -7,8 +7,8 @@
{% block content %}
<div class="row">
- <h3 class="col-md-8">{% trans 'Record List' %}</h3>
- <div class="col-md-4 text-right">
+ <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 'Title' %}" name="title" required="required"/>
@@ -16,6 +16,7 @@
<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>
--- a/src/p4l/templates/p4l/p4l_record_view.html Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/templates/p4l/p4l_record_view.html Fri Sep 20 00:14:42 2013 +0200
@@ -8,6 +8,7 @@
{% 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 est irreversible.' %}')">{% trans 'Delete the record' %} <i class="glyphicon glyphicon-trash"></i></a>
</div>
<table class="table record-table">
<thead>
@@ -191,6 +192,10 @@
<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>
@@ -199,7 +204,6 @@
<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>
- <li>{% trans 'Access level' %} : {{ i.accessLevel|default:'' }}</li>
</ul>
</li>
{% endfor %}
@@ -211,16 +215,25 @@
<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 multilingual' %}</td>
- <td><input type="checkbox" disabled="disabled" {% if record.isMultilingual %}checked="checked"{% endif %} /></td>
+ <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 est 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 Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/templates/p4l/record_update_form.html Fri Sep 20 00:14:42 2013 +0200
@@ -45,6 +45,7 @@
{% block content %}
<div class="row text-right">
<a class="btn btn-default" href="{% url 'p4l_record_view' slug=record.identifier %}">{% trans 'View the record' %} <i class="glyphicon glyphicon-eye-open"></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 est irreversible.' %}')">{% trans 'Delete the record' %} <i class="glyphicon glyphicon-trash"></i></a>
</div>
{% verbatim %}
<div ng-app="recordApp" ng-controller="RecordCtrl" ng-cloak>
@@ -188,22 +189,34 @@
<td><add-sem-uri list="record.corporateAuthors" listname="organizations" placeholder="{{'Add a new organization' | translate}}"></add-sem-uri></td>
</tr>
<tr>
+ <td>{{ 'corporate author label' | translate }}</td>
+ <td><input type="text" class="form-control" ng-model="record.corporateAuthorLabel" /></td>
+ </tr>
+ <tr>
<td>{{ 'Urls' | translate }}</td>
<td><object-list form-template="urlForm" disp-template="urlDisp" object-list="record.urls"
- object-fields='["address", "display", "accessLevel"]' table="true"
- size-fields='[5, 2, 2]' label-fields='["Address", "Display", "Access level"]'></object-list></td>
+ object-fields='["address", "display"]' table="true"
+ size-fields='[7, 2]' label-fields='["Address", "Display"]'></object-list></td>
</tr>
<tr>
<td>{{ 'record type' | translate }}</td>
<td><simple-sem-uri val="record.recordType" listname="types" placeholder="{{'Modify the record type' | translate}}"></simple-sem-uri></td>
</tr>
<tr>
+ <td>{{ 'audiences' | translate }}</td>
+ <td><add-sem-uri list="record.audiences" listname="audiences" placeholder="{{'Add a new audience' | translate}}"></add-sem-uri></td>
+ </tr>
+ <tr>
<td>{{ 'is document part' | translate }}</td>
<td><input type="checkbox" ng-model="record.isDocumentPart" /></td>
</tr>
<tr>
- <td>{{ 'is multilingual' | translate }}</td>
- <td><input type="checkbox" ng-model="record.isMultilingual" /></td>
+ <td>{{ 'is hidden' | translate }}</td>
+ <td><input type="checkbox" ng-model="record.isHidden" /></td>
+ </tr>
+ <tr>
+ <td>{{ 'is restricted' | translate }}</td>
+ <td><input type="checkbox" ng-model="record.isRestricted" /></td>
</tr>
</tbody>
</table>
@@ -220,5 +233,6 @@
{% endverbatim %}
<div class="row text-right">
<a class="btn btn-default" href="{% url 'p4l_record_view' slug=record.identifier %}">{% trans 'View the record' %} <i class="glyphicon glyphicon-eye-open"></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 est 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/translations.html Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/templates/p4l/translations.html Fri Sep 20 00:14:42 2013 +0200
@@ -9,10 +9,13 @@
{% trans 'Add a new language' %}
{% trans 'Add a new project' %}
{% trans 'Add a new organization' %}
+{% trans 'Add a new audience' %}
{% trans 'Modify the language' %}
{% trans 'Modify the record type' %}
{% trans 'title' %}
{% trans 'abstract' %}
{% trans 'collation' %}
{% trans 'label' %}
-{% trans 'name' %}
\ No newline at end of file
+{% trans 'name' %}
+{% trans 'View the record' %}
+{% trans 'Edit the record' %}
\ No newline at end of file
--- a/src/p4l/urls.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/urls.py Fri Sep 20 00:14:42 2013 +0200
@@ -2,7 +2,8 @@
from django.contrib import admin
from django.contrib.auth import urls as auth_urls
from django.contrib.auth.decorators import login_required
-from p4l.views import RecordListView, RecordDetailView, RecordEditView
+from p4l.views import RecordListView, RecordDetailView, RecordEditView, RecordDeleteView,\
+ RecordNewView
js_info_dict = {
'packages': ('p4l',),
@@ -16,6 +17,8 @@
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/delete/(?P<slug>\w+)$', login_required(RecordDeleteView.as_view()), name='p4l_record_delete'),
url(r'^api/', include('p4l.api.urls')),
url(r'^i18n/', include('django.conf.urls.i18n')),
--- a/src/p4l/utils.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/utils.py Fri Sep 20 00:14:42 2013 +0200
@@ -86,8 +86,8 @@
filter_str = ""
for i,uri in enumerate(uri_list):
res_dict[uri] = ""
- filter_str += (" || ?uri = <" + uri + ">") if i else ("?uri = <" + uri + ">")
-
+ uri = uri.replace(" ", "") # avoid bug when only few urls are not good
+ filter_str += (" || ?uri = <" + uri + ">") if i else ("?uri = <" + uri + ">")
# We request the labels
res = requests.get(
settings.SPARQL_QUERY_ENDPOINT,
@@ -110,7 +110,7 @@
first_label = b['label']['value']
else:
if 'acro' in b and 'value' in b['acro']:
- first_label = b['acro']['value'] + " : " + b['label']['value']
+ first_label = b['acro']['value'] + ". " + b['label']['value']
else:
first_label = b['label']['value']
if lang in tmp_dict or first_label:
--- a/src/p4l/views.py Fri Sep 20 00:03:31 2013 +0200
+++ b/src/p4l/views.py Fri Sep 20 00:14:42 2013 +0200
@@ -4,9 +4,10 @@
@author: tc
'''
-
+from datetime import datetime
from django.conf import settings
-from django.views.generic import ListView, DetailView
+from django.views.generic import ListView, DetailView, View
+from django.shortcuts import redirect, get_object_or_404
from p4l.forms import RecordFilterForm
from p4l.models import Record
from p4l.utils import get_labels_for_uris
@@ -95,6 +96,11 @@
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
return context
@@ -175,6 +181,13 @@
'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"]
}
}
context['query_dicts'] = json.dumps(query_dicts)
@@ -183,5 +196,20 @@
context['languages_list'] = json.dumps(settings.LANGUAGES_LIST)
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)
+ rec.delete()
+ return redirect('p4l_home')
\ No newline at end of file