# HG changeset patch # User cavaliet # Date 1379515798 -7200 # Node ID 0d54489e8b266112e63db271ee3a029c4db0fcf4 # Parent 7b6ca4ca3f671eae53bf49fb963af2be2508af08 add audiences diff -r 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/locale/en/LC_MESSAGES/django.po --- a/src/p4l/locale/en/LC_MESSAGES/django.po Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/locale/en/LC_MESSAGES/django.po Wed Sep 18 16:49:58 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-16 09:15-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" @@ -123,23 +123,23 @@ msgstr "View" #: templates/p4l/p4l_record_view.html:10 -#: templates/p4l/p4l_record_view.html:225 templates/p4l/translations.html:20 +#: 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:226 +#: templates/p4l/p4l_record_view.html:237 #: templates/p4l/record_update_form.html:48 -#: templates/p4l/record_update_form.html:224 +#: 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:226 +#: templates/p4l/p4l_record_view.html:237 #: templates/p4l/record_update_form.html:48 -#: templates/p4l/record_update_form.html:224 +#: templates/p4l/record_update_form.html:236 #, fuzzy msgid "Delete the record" msgstr "Modify the record type" @@ -289,36 +289,45 @@ msgstr "corporate authors" #: 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:201 +#: templates/p4l/p4l_record_view.html:205 msgid "Address" msgstr "Address" -#: templates/p4l/p4l_record_view.html:202 +#: templates/p4l/p4l_record_view.html:206 msgid "Display" msgstr "Display" -#: templates/p4l/p4l_record_view.html:203 -msgid "Access level" -msgstr "Access level" - -#: templates/p4l/p4l_record_view.html:211 +#: templates/p4l/p4l_record_view.html:214 msgid "record type" msgstr "record type" -#: templates/p4l/p4l_record_view.html:215 +#: 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:219 -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:223 -#: templates/p4l/translations.html:19 +#: templates/p4l/record_update_form.html:235 +#: templates/p4l/translations.html:20 #, fuzzy msgid "View the record" msgstr "Modify the record type" @@ -360,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" @@ -398,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 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/locale/es/LC_MESSAGES/django.po --- a/src/p4l/locale/es/LC_MESSAGES/django.po Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/locale/es/LC_MESSAGES/django.po Wed Sep 18 16:49:58 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-16 09:15-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" @@ -124,23 +124,23 @@ msgstr "View" #: templates/p4l/p4l_record_view.html:10 -#: templates/p4l/p4l_record_view.html:225 templates/p4l/translations.html:20 +#: 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:226 +#: templates/p4l/p4l_record_view.html:237 #: templates/p4l/record_update_form.html:48 -#: templates/p4l/record_update_form.html:224 +#: 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:226 +#: templates/p4l/p4l_record_view.html:237 #: templates/p4l/record_update_form.html:48 -#: templates/p4l/record_update_form.html:224 +#: templates/p4l/record_update_form.html:236 #, fuzzy msgid "Delete the record" msgstr "Modify the record type" @@ -290,36 +290,45 @@ msgstr "corporate authors" #: 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:201 +#: templates/p4l/p4l_record_view.html:205 msgid "Address" msgstr "Address" -#: templates/p4l/p4l_record_view.html:202 +#: templates/p4l/p4l_record_view.html:206 msgid "Display" msgstr "Display" -#: templates/p4l/p4l_record_view.html:203 -msgid "Access level" -msgstr "Access level" - -#: templates/p4l/p4l_record_view.html:211 +#: templates/p4l/p4l_record_view.html:214 msgid "record type" msgstr "record type" -#: templates/p4l/p4l_record_view.html:215 +#: 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:219 -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:223 -#: templates/p4l/translations.html:19 +#: templates/p4l/record_update_form.html:235 +#: templates/p4l/translations.html:20 #, fuzzy msgid "View the record" msgstr "Modify the record type" @@ -361,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" @@ -399,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 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/locale/fr/LC_MESSAGES/django.mo Binary file src/p4l/locale/fr/LC_MESSAGES/django.mo has changed diff -r 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/locale/fr/LC_MESSAGES/django.po --- a/src/p4l/locale/fr/LC_MESSAGES/django.po Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/locale/fr/LC_MESSAGES/django.po Wed Sep 18 16:49:58 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-16 09:15-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" @@ -135,24 +135,24 @@ msgstr "Vue" #: templates/p4l/p4l_record_view.html:10 -#: templates/p4l/p4l_record_view.html:225 -#: templates/p4l/translations.html:20 +#: 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:226 +#: templates/p4l/p4l_record_view.html:237 #: templates/p4l/record_update_form.html:48 -#: templates/p4l/record_update_form.html:224 +#: 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:226 +#: templates/p4l/p4l_record_view.html:237 #: templates/p4l/record_update_form.html:48 -#: templates/p4l/record_update_form.html:224 +#: templates/p4l/record_update_form.html:236 msgid "Delete the record" msgstr "Effacer la notice" @@ -301,36 +301,44 @@ msgstr "entités auteurs" #: templates/p4l/p4l_record_view.html:195 +msgid "corporate author label" +msgstr "Libellé de l'auteur institutionnel" + +#: templates/p4l/p4l_record_view.html:199 msgid "Urls" msgstr "Urls" -#: templates/p4l/p4l_record_view.html:201 +#: templates/p4l/p4l_record_view.html:205 msgid "Address" msgstr "Adresse" -#: templates/p4l/p4l_record_view.html:202 +#: templates/p4l/p4l_record_view.html:206 msgid "Display" msgstr "Affichage" -#: templates/p4l/p4l_record_view.html:203 -msgid "Access level" -msgstr "Niveau d'accès" - -#: templates/p4l/p4l_record_view.html:211 +#: templates/p4l/p4l_record_view.html:214 msgid "record type" msgstr "type de notice" -#: templates/p4l/p4l_record_view.html:215 +#: 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:219 -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:223 -#: templates/p4l/translations.html:19 +#: templates/p4l/record_update_form.html:235 +#: templates/p4l/translations.html:20 msgid "View the record" msgstr "Voir la notice" @@ -371,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" diff -r 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/settings.py --- a/src/p4l/settings.py Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/settings.py Wed Sep 18 16:49:58 2013 +0200 @@ -506,7 +506,12 @@ ORDER BY ?label """ } - +SPARQL_AUDIENCE_QUERIES = { +"filter" : "", +"root" : "", +"childs" : "", +"child-count" : "" +} REST_FRAMEWORK = { # Use hyperlinked styles by default. diff -r 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/static/p4l/css/semantictree.css --- a/src/p4l/static/p4l/css/semantictree.css Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/static/p4l/css/semantictree.css Wed Sep 18 16:49:58 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 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/static/p4l/templates/addSemanticUriForm.html --- a/src/p4l/static/p4l/templates/addSemanticUriForm.html Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/static/p4l/templates/addSemanticUriForm.html Wed Sep 18 16:49:58 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 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/templates/p4l/p4l_record_view.html --- a/src/p4l/templates/p4l/p4l_record_view.html Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/templates/p4l/p4l_record_view.html Wed Sep 18 16:49:58 2013 +0200 @@ -215,6 +215,10 @@ {{ recordType_label }} ({{ record.recordType|default:'' }}) + {% trans 'audiences' %} +
    {% for k,v in audiences_labels.items %}
  • {{ v }} ({{ k }})
  • {% endfor %}
+ + {% trans 'is document part' %} diff -r 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/templates/p4l/record_update_form.html --- a/src/p4l/templates/p4l/record_update_form.html Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/templates/p4l/record_update_form.html Wed Sep 18 16:49:58 2013 +0200 @@ -203,6 +203,10 @@ + {{ 'audiences' | translate }} + + + {{ 'is document part' | translate }} diff -r 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/templates/p4l/translations.html --- a/src/p4l/templates/p4l/translations.html Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/templates/p4l/translations.html Wed Sep 18 16:49:58 2013 +0200 @@ -9,6 +9,7 @@ {% 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' %} diff -r 7b6ca4ca3f67 -r 0d54489e8b26 src/p4l/views.py --- a/src/p4l/views.py Wed Sep 18 15:51:57 2013 +0200 +++ b/src/p4l/views.py Wed Sep 18 16:49:58 2013 +0200 @@ -96,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 @@ -176,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)