nanterre: ajout des traduction et filtres sur les jobs
This commit is contained in:
parent
5732cc61c4
commit
5a9cee7bf5
1
setup.py
1
setup.py
|
@ -106,6 +106,7 @@ setup(
|
|||
'djangorestframework<3.4',
|
||||
'pytz',
|
||||
'python-dateutil',
|
||||
'django-admin-rangefilter',
|
||||
],
|
||||
zip_safe=False,
|
||||
cmdclass={
|
||||
|
|
|
@ -1,139 +0,0 @@
|
|||
# French translation for zoo
|
||||
# Copyright (C) 2017 Entr'ouvert
|
||||
# This file is distributed under the same license as the zoo package.
|
||||
# Benjamin Dauvergne <bdauvergne@entrouvert.com>, 2017.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-01-31 13:25+0000\n"
|
||||
"PO-Revision-Date: 2017-01-31 14:27+01:00\n"
|
||||
"Last-Translator: Benjamin Dauvergne <bdauvergne@entrouvert.com>\n"
|
||||
"Language-Team: french<fr@li.org>\n"
|
||||
"Language: french\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: zoo_data/apps.py:7
|
||||
msgid "datas"
|
||||
msgstr "données"
|
||||
|
||||
#: zoo_data/models.py:19 zoo_data/models.py:98 zoo_data/models.py:145
|
||||
msgid "created"
|
||||
msgstr "créé"
|
||||
|
||||
#: zoo_data/models.py:21 zoo_data/models.py:115 zoo_data/models.py:162
|
||||
msgid "meta"
|
||||
msgstr "méta-données"
|
||||
|
||||
#: zoo_data/models.py:25 zoo_data/models.py:119 zoo_data/models.py:166
|
||||
#: zoo_data/models.py:188
|
||||
msgid "content"
|
||||
msgstr "contenu"
|
||||
|
||||
#: zoo_data/models.py:34 zoo_data/models.py:180
|
||||
msgid "transaction"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:35
|
||||
msgid "transactions"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:93 zoo_data/models.py:132 zoo_meta/models.py:26
|
||||
msgid "schema"
|
||||
msgstr "schéma"
|
||||
|
||||
#: zoo_data/models.py:104 zoo_data/models.py:151
|
||||
msgid "modified"
|
||||
msgstr "modifié"
|
||||
|
||||
#: zoo_data/models.py:108 zoo_data/models.py:155
|
||||
msgid "deleted"
|
||||
msgstr "supprimé"
|
||||
|
||||
#: zoo_data/models.py:125 zoo_data/models.py:177
|
||||
msgid "entity"
|
||||
msgstr "entité"
|
||||
|
||||
#: zoo_data/models.py:126
|
||||
msgid "entities"
|
||||
msgstr "entités"
|
||||
|
||||
#: zoo_data/models.py:135
|
||||
msgid "left"
|
||||
msgstr "gauche"
|
||||
|
||||
#: zoo_data/models.py:139
|
||||
msgid "right"
|
||||
msgstr "droit"
|
||||
|
||||
#: zoo_data/models.py:170
|
||||
msgid "relation"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:171
|
||||
msgid "relations"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:184
|
||||
msgid "timestamp"
|
||||
msgstr "horodatage"
|
||||
|
||||
#: zoo_data/models.py:192
|
||||
msgid "url"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:196
|
||||
msgid "log"
|
||||
msgstr "journal"
|
||||
|
||||
#: zoo_data/models.py:197
|
||||
msgid "logs"
|
||||
msgstr "journaux"
|
||||
|
||||
#: zoo_meta/apps.py:7
|
||||
msgid "metadatas"
|
||||
msgstr "métadonnées"
|
||||
|
||||
#: zoo_meta/models.py:20
|
||||
msgid "name"
|
||||
msgstr "nom"
|
||||
|
||||
#: zoo_meta/models.py:24
|
||||
msgid "slug"
|
||||
msgstr "nom court"
|
||||
|
||||
#: zoo_meta/models.py:29
|
||||
msgid "caption template"
|
||||
msgstr "canevas pour le libellé"
|
||||
|
||||
#: zoo_meta/models.py:129
|
||||
msgid "entity schema"
|
||||
msgstr "schéma d'entité"
|
||||
|
||||
#: zoo_meta/models.py:130
|
||||
msgid "entity schemas"
|
||||
msgstr "schéma des entités"
|
||||
|
||||
#: zoo_meta/models.py:136
|
||||
msgid "left schema"
|
||||
msgstr "schéma gauche"
|
||||
|
||||
#: zoo_meta/models.py:140
|
||||
msgid "right schema"
|
||||
msgstr "schéma droit"
|
||||
|
||||
#: zoo_meta/models.py:145
|
||||
msgid "is symmetric"
|
||||
msgstr "est symétrique"
|
||||
|
||||
#: zoo_meta/models.py:149
|
||||
msgid "relation schema"
|
||||
msgstr "schéma de relation"
|
||||
|
||||
#: zoo_meta/models.py:150
|
||||
msgid "relation schemas"
|
||||
msgstr "schémas des relations"
|
|
@ -58,6 +58,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.staticfiles',
|
||||
'django.contrib.postgres',
|
||||
'rest_framework',
|
||||
'rangefilter',
|
||||
'zoo.zoo_meta',
|
||||
'zoo.zoo_data',
|
||||
'zoo.zoo_nanterre',
|
||||
|
@ -129,7 +130,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/1.10/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
LANGUAGE_CODE = 'fr-fr'
|
||||
|
||||
TIME_ZONE = 'Europe/Paris'
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
from django.contrib import admin
|
||||
|
||||
from rangefilter.filter import DateTimeRangeFilter
|
||||
|
||||
from .models import Transaction, Entity, Relation, Log, Job
|
||||
from .widgets import JSONEditor
|
||||
|
||||
|
@ -112,7 +114,11 @@ class RelationAdmin(DataAdmin):
|
|||
class JobAdmin(JSONEditorMixin, admin.ModelAdmin):
|
||||
list_display = ['id', 'created', 'modified', 'state', 'transaction_id', 'classpath']
|
||||
raw_id_fields = ['transaction']
|
||||
list_filter = ['state']
|
||||
list_filter = [
|
||||
'state',
|
||||
('created', DateTimeRangeFilter),
|
||||
('modified', DateTimeRangeFilter),
|
||||
]
|
||||
date_hierarchy = 'created'
|
||||
actions = ['make_todo', 'make_unrecoverable_error', 'do']
|
||||
readonly_fields = ['_description']
|
||||
|
@ -135,6 +141,15 @@ class JobAdmin(JSONEditorMixin, admin.ModelAdmin):
|
|||
for job in queryset:
|
||||
job.do()
|
||||
|
||||
def get_list_filter(self, request):
|
||||
list_filter = super(JobAdmin, self).get_list_filter(request)
|
||||
|
||||
from django.apps import apps
|
||||
for app_config in apps.get_app_configs():
|
||||
if hasattr(app_config, 'get_job_list_filter'):
|
||||
list_filter = app_config.get_job_list_filter() + list_filter
|
||||
return list_filter
|
||||
|
||||
|
||||
class JobInlineAdmin(JSONEditorMixin, admin.TabularInline):
|
||||
model = Job
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
# French translation for zoo
|
||||
# Copyright (C) 2017 Entr'ouvert
|
||||
# This file is distributed under the same license as the zoo package.
|
||||
# Benjamin Dauvergne <bdauvergne@entrouvert.com>, 2017.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-09-06 16:19+0200\n"
|
||||
"PO-Revision-Date: 2017-01-31 14:27+01:00\n"
|
||||
"Last-Translator: Benjamin Dauvergne <bdauvergne@entrouvert.com>\n"
|
||||
"Language-Team: french<fr@li.org>\n"
|
||||
"Language: french\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: zoo_data/apps.py:23
|
||||
msgid "datas"
|
||||
msgstr "données"
|
||||
|
||||
#: zoo_data/models.py:43 zoo_data/models.py:116 zoo_data/models.py:163
|
||||
#: zoo_data/models.py:252
|
||||
msgid "created"
|
||||
msgstr "créé"
|
||||
|
||||
#: zoo_data/models.py:45 zoo_data/models.py:133 zoo_data/models.py:180
|
||||
msgid "meta"
|
||||
msgstr "méta-données"
|
||||
|
||||
#: zoo_data/models.py:49 zoo_data/models.py:137 zoo_data/models.py:184
|
||||
#: zoo_data/models.py:207 zoo_data/models.py:273
|
||||
msgid "content"
|
||||
msgstr "contenu"
|
||||
|
||||
#: zoo_data/models.py:64 zoo_data/models.py:199
|
||||
msgid "transaction"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:65
|
||||
msgid "transactions"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:111 zoo_data/models.py:150
|
||||
msgid "schema"
|
||||
msgstr "schéma"
|
||||
|
||||
#: zoo_data/models.py:122 zoo_data/models.py:169
|
||||
msgid "modified"
|
||||
msgstr "modifié"
|
||||
|
||||
#: zoo_data/models.py:126 zoo_data/models.py:173
|
||||
msgid "deleted"
|
||||
msgstr "supprimé"
|
||||
|
||||
#: zoo_data/models.py:143 zoo_data/models.py:195
|
||||
msgid "entity"
|
||||
msgstr "entité"
|
||||
|
||||
#: zoo_data/models.py:144
|
||||
msgid "entities"
|
||||
msgstr "entités"
|
||||
|
||||
#: zoo_data/models.py:153
|
||||
msgid "left"
|
||||
msgstr "gauche"
|
||||
|
||||
#: zoo_data/models.py:157
|
||||
msgid "right"
|
||||
msgstr "droit"
|
||||
|
||||
#: zoo_data/models.py:188
|
||||
msgid "relation"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:189
|
||||
msgid "relations"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:203
|
||||
msgid "timestamp"
|
||||
msgstr "horodatage"
|
||||
|
||||
#: zoo_data/models.py:211
|
||||
msgid "url"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:215
|
||||
msgid "log"
|
||||
msgstr "journal"
|
||||
|
||||
#: zoo_data/models.py:216
|
||||
msgid "logs"
|
||||
msgstr "journaux"
|
||||
|
||||
#: zoo_data/models.py:243
|
||||
msgid "todo"
|
||||
msgstr "à faire"
|
||||
|
||||
#: zoo_data/models.py:244
|
||||
msgid "success"
|
||||
msgstr "succés"
|
||||
|
||||
#: zoo_data/models.py:245
|
||||
msgid "error"
|
||||
msgstr "erreur"
|
||||
|
||||
#: zoo_data/models.py:246
|
||||
msgid "unrecoverable error"
|
||||
msgstr "erreur irrécupérable"
|
||||
|
||||
#: zoo_data/models.py:257
|
||||
msgid "sent"
|
||||
msgstr "envoyé"
|
||||
|
||||
#: zoo_data/models.py:268
|
||||
msgid "state"
|
||||
msgstr "statut"
|
||||
|
||||
#: zoo_data/models.py:369
|
||||
msgid "job"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_data/models.py:370
|
||||
msgid "jobs"
|
||||
msgstr ""
|
|
@ -0,0 +1,66 @@
|
|||
# French translation for zoo
|
||||
# Copyright (C) 2017 Entr'ouvert
|
||||
# This file is distributed under the same license as the zoo package.
|
||||
# Benjamin Dauvergne <bdauvergne@entrouvert.com>, 2017.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-09-06 16:19+0200\n"
|
||||
"PO-Revision-Date: 2017-01-31 14:27+01:00\n"
|
||||
"Last-Translator: Benjamin Dauvergne <bdauvergne@entrouvert.com>\n"
|
||||
"Language-Team: french<fr@li.org>\n"
|
||||
"Language: french\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: zoo_meta/apps.py:23
|
||||
msgid "metadatas"
|
||||
msgstr "métadonnées"
|
||||
|
||||
#: zoo_meta/models.py:36
|
||||
msgid "name"
|
||||
msgstr "nom"
|
||||
|
||||
#: zoo_meta/models.py:40
|
||||
msgid "slug"
|
||||
msgstr "nom court"
|
||||
|
||||
#: zoo_meta/models.py:42
|
||||
msgid "schema"
|
||||
msgstr "schéma"
|
||||
|
||||
#: zoo_meta/models.py:45
|
||||
msgid "caption template"
|
||||
msgstr "canevas pour le libellé"
|
||||
|
||||
#: zoo_meta/models.py:138
|
||||
msgid "entity schema"
|
||||
msgstr "schéma d'entité"
|
||||
|
||||
#: zoo_meta/models.py:139
|
||||
msgid "entity schemas"
|
||||
msgstr "schéma des entités"
|
||||
|
||||
#: zoo_meta/models.py:145
|
||||
msgid "left schema"
|
||||
msgstr "schéma gauche"
|
||||
|
||||
#: zoo_meta/models.py:149
|
||||
msgid "right schema"
|
||||
msgstr "schéma droit"
|
||||
|
||||
#: zoo_meta/models.py:154
|
||||
msgid "is symmetric"
|
||||
msgstr "est symétrique"
|
||||
|
||||
#: zoo_meta/models.py:158
|
||||
msgid "relation schema"
|
||||
msgstr "schéma de relation"
|
||||
|
||||
#: zoo_meta/models.py:159
|
||||
msgid "relation schemas"
|
||||
msgstr "schémas des relations"
|
|
@ -1,3 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# zoo - versatile objects management
|
||||
# Copyright (C) 2016 Entr'ouvert
|
||||
#
|
||||
|
@ -17,7 +18,7 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from .models import Duplicate
|
||||
from .utils import individu_caption
|
||||
from .utils import individu_caption, get_applications, get_application
|
||||
|
||||
|
||||
class DuplicateAdmin(admin.ModelAdmin):
|
||||
|
@ -32,3 +33,21 @@ class DuplicateAdmin(admin.ModelAdmin):
|
|||
return individu_caption(instance.second)
|
||||
|
||||
admin.site.register(Duplicate, DuplicateAdmin)
|
||||
|
||||
|
||||
class JobApplicationListFilter(admin.SimpleListFilter):
|
||||
title = u'application'
|
||||
|
||||
parameter_name = 'application'
|
||||
|
||||
def lookups(self, request, model_admin):
|
||||
l = []
|
||||
for app in get_applications(rsu_ws_url=True):
|
||||
app_dfn = get_application(app)
|
||||
l.append((app, app_dfn['name']))
|
||||
return l
|
||||
|
||||
def queryset(self, request, queryset):
|
||||
if self.value():
|
||||
queryset = queryset.filter(content__application_id=self.value())
|
||||
return queryset
|
||||
|
|
|
@ -29,7 +29,7 @@ class ZooNanterreConfig(AppConfig):
|
|||
|
||||
def synchronize(application, modeladmin, request, queryset):
|
||||
qs = queryset.filter(schema__slug=utils.INDIVIDU_ENT)
|
||||
messages = list(fragments.synchronize([application], qs))
|
||||
list(fragments.synchronize([application], qs))
|
||||
|
||||
actions = {}
|
||||
for application in utils.get_applications(rsu_ws_url=True):
|
||||
|
@ -37,3 +37,7 @@ class ZooNanterreConfig(AppConfig):
|
|||
name = u'Synchroniser %s' % app_dfn['name']
|
||||
actions[name] = (functools.partial(synchronize, application), name, name)
|
||||
return actions
|
||||
|
||||
def get_job_list_filter(self):
|
||||
from .admin import JobApplicationListFilter
|
||||
return [JobApplicationListFilter]
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
# French translation for zoo
|
||||
# Copyright (C) 2017 Entr'ouvert
|
||||
# This file is distributed under the same license as the zoo package.
|
||||
# Benjamin Dauvergne <bdauvergne@entrouvert.com>, 2017.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 0.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-09-06 16:19+0200\n"
|
||||
"PO-Revision-Date: 2017-01-31 14:27+01:00\n"
|
||||
"Last-Translator: Benjamin Dauvergne <bdauvergne@entrouvert.com>\n"
|
||||
"Language-Team: french<fr@li.org>\n"
|
||||
"Language: french\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: zoo_nanterre/apps.py:25
|
||||
msgid "Nanterre"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_nanterre/models.py:14
|
||||
msgid "new"
|
||||
msgstr "nouveau"
|
||||
|
||||
#: zoo_nanterre/models.py:15
|
||||
msgid "false positive"
|
||||
msgstr "faux positif"
|
||||
|
||||
#: zoo_nanterre/models.py:16 zoo_nanterre/models.py:45
|
||||
msgid "deduplicated"
|
||||
msgstr "dédupliqué"
|
||||
|
||||
#: zoo_nanterre/models.py:20
|
||||
msgid "created"
|
||||
msgstr "créé"
|
||||
|
||||
#: zoo_nanterre/models.py:24
|
||||
msgid "modified"
|
||||
msgstr "modifié"
|
||||
|
||||
#: zoo_nanterre/models.py:29
|
||||
msgid "first"
|
||||
msgstr "premier"
|
||||
|
||||
#: zoo_nanterre/models.py:33
|
||||
msgid "second"
|
||||
msgstr "second"
|
||||
|
||||
#: zoo_nanterre/models.py:39
|
||||
msgid "score"
|
||||
msgstr ""
|
||||
|
||||
#: zoo_nanterre/models.py:41
|
||||
msgid "state"
|
||||
msgstr "statut"
|
||||
|
||||
#: zoo_nanterre/models.py:48
|
||||
msgid "content"
|
||||
msgstr "contenu"
|
||||
|
||||
#: zoo_nanterre/models.py:76
|
||||
msgid "duplicate"
|
||||
msgstr "doublon"
|
||||
|
||||
#: zoo_nanterre/models.py:77
|
||||
msgid "duplicates"
|
||||
msgstr "doublons"
|
Loading…
Reference in New Issue