# HG changeset patch # User ymh # Date 1379628882 -7200 # Node ID 53c9233a768471f09f75cca3c052949dd44a820b # Parent 71532a54d1c4df4bf062437e15a8a37accc70a8b# Parent 5b076700ac05b181d1ab50d7082b703a05494c0c Merge with 5b076700ac05b181d1ab50d7082b703a05494c0c diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/api/serializers.py --- 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") diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/locale/en/LC_MESSAGES/django.po --- 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 \n" "Language-Team: LANGUAGE \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" diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/locale/es/LC_MESSAGES/django.po --- 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 \n" "Language-Team: LANGUAGE \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" diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/locale/fr/LC_MESSAGES/django.mo Binary file src/p4l/locale/fr/LC_MESSAGES/django.mo has changed diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/locale/fr/LC_MESSAGES/django.po --- 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 \n" "Language-Team: LANGUAGE \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" + diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/management/commands/import_record.py --- 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 diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/migrations/0001_initial.py --- 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'}), diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/models/data.py --- 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 # #subjectMeetings = foreign key from 'p4l.SubjectMeeting' #iiep:subjectMeeting corporateAuthors = models.ManyToManyField('p4l.CorporateAuthor', related_name='recordsCorporateAuthor') #iiep:subjectCorporateBody # + 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 # + audiences = models.ManyToManyField('p4l.Audience') #dct:audience # Unknown thesaurus + recordType = models.URLField(max_length=2048, blank=True, null=True) #dct:type # 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])) diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/settings.py --- 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: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?type WHERE { ?uri a skos:Collection ; - skos:inScheme ; - skos:prefLabel|rdfs:label ?label . + skos:inScheme ; + 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: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?type WHERE { ?uri skos:inScheme . { ?uri a ?type @@ -263,11 +264,12 @@ PREFIX rdf: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?type WHERE { ?uri a skos:Collection ; skos:inScheme ; - 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: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?type WHERE { ?uri skos:inScheme . { ?uri a ?type @@ -406,12 +408,13 @@ PREFIX rdf: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?acro WHERE { ?uri a skos:Concept. ?uri skos:inScheme . ?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: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?acro WHERE { ?uri a skos:Concept ; skos:inScheme ; skos:prefLabel ?label . + OPTIONAL { ?uri skos:altLabel ?acro } } ORDER BY ?label """ @@ -438,12 +442,13 @@ PREFIX rdf: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?acro WHERE { ?uri a skos:Concept. ?uri skos:inScheme . ?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: PREFIX owl: PREFIX rdfs: -SELECT DISTINCT ?uri ?label +SELECT DISTINCT ?uri ?label ?acro WHERE { ?uri a skos:Concept ; skos:inScheme ; 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. diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/static/p4l/css/semantictree.css --- 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; diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/static/p4l/js/semantictree.js --- 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 diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/static/p4l/templates/addSemanticUriForm.html --- 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 @@
+ data-childs-query="{{ datachildsquery }}" data-child-count-query="{{ datachildcountquery }}" ng-disabled="dataquery==''" /> {{ 'or' | translate}} - {{'Browse' | translate}} + {{'Browse' | translate}}
- +
\ No newline at end of file diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/static/p4l/templates/urlDisp.html --- 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 @@ - +
{{ obj.display }}
-
{{ obj.accessLevel }}
\ No newline at end of file diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/static/p4l/templates/urlForm.html --- 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 @@ -
- - -
\ No newline at end of file diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/templates/p4l/p4l_home.html --- 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 %}
-

{% trans 'Record List' %}

-
+

{% trans 'Record List' %}

+
@@ -16,6 +16,7 @@
+ - {% trans 'New record' %}
diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/templates/p4l/p4l_record_view.html --- 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 %} @@ -191,6 +192,10 @@ + + + + + + + + - - + + + + + +
    {% for k,v in corporateAuthors_labels.items %}
  • {{ v }} ({{ k }})
  • {% endfor %}
{% trans 'corporate author label' %}{{ record.corporateAuthorLabel|default:'' }}
{% trans 'Urls' %}
    @@ -199,7 +204,6 @@
    • {% trans 'Address' %} : {% if i.address %}{{ i.address }}{% endif %}
    • {% trans 'Display' %} : {{ i.display|default:'' }}
    • -
    • {% trans 'Access level' %} : {{ i.accessLevel|default:'' }}
    {% endfor %} @@ -211,16 +215,25 @@
{{ recordType_label }} ({{ record.recordType|default:'' }})
{% trans 'audiences' %}
    {% for k,v in audiences_labels.items %}
  • {{ v }} ({{ k }})
  • {% endfor %}
{% trans 'is document part' %}
{% trans 'is multilingual' %}{% trans 'is hidden' %}
{% trans 'is restricted' %}
{% endblock %} \ No newline at end of file diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/templates/p4l/record_update_form.html --- 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 %} {% verbatim %}
@@ -188,22 +189,34 @@ + {{ 'corporate author label' | translate }} + + + {{ 'Urls' | translate }} + object-fields='["address", "display"]' table="true" + size-fields='[7, 2]' label-fields='["Address", "Display"]'> {{ 'record type' | translate }} + {{ 'audiences' | translate }} + + + {{ 'is document part' | translate }} - {{ 'is multilingual' | translate }} - + {{ 'is hidden' | translate }} + + + + {{ 'is restricted' | translate }} + @@ -220,5 +233,6 @@ {% endverbatim %} {% endblock %} \ No newline at end of file diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/templates/p4l/translations.html --- 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 diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/urls.py --- 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\w+)$', login_required(RecordDetailView.as_view()), name='p4l_record_view'), url(r'^record/edit/(?P\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\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')), diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/utils.py --- 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: diff -r 71532a54d1c4 -r 53c9233a7684 src/p4l/views.py --- 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