Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
limbra
limbra
Commits
2003ca58
Commit
2003ca58
authored
Apr 25, 2017
by
LE GAC Renaud
Browse files
Activate lazy translation.
parent
ef29272b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
25 deletions
+33
-25
controllers/metrics.py
controllers/metrics.py
+2
-2
controllers/wizards.py
controllers/wizards.py
+7
-3
models/main.py
models/main.py
+1
-1
modules/ui_viewport.py
modules/ui_viewport.py
+9
-9
views/harvest/edit_insert.html
views/harvest/edit_insert.html
+3
-2
views/harvest/layout.html
views/harvest/layout.html
+5
-4
views/wizards/check_validate.html
views/wizards/check_validate.html
+4
-3
views/wizards/compare_publications.html
views/wizards/compare_publications.html
+2
-1
No files found.
controllers/metrics.py
View file @
2003ca58
...
...
@@ -4,7 +4,7 @@
import
json
import
re
from
plugin_dbui
import
inline_alert
,
Selector
from
plugin_dbui
import
inline_alert
,
JSONEncoder
,
Selector
from
pydal.helpers.methods
import
smart_query
from
reporting_tools
import
get_converter
,
repr_team_project
...
...
@@ -126,6 +126,6 @@ def index():
if
cfg
[
'data'
][
i
][
0
]
in
cvt_labels
:
cfg
[
'data'
][
i
][
0
]
=
cvt_labels
[
cfg
[
'data'
][
i
][
0
]]
return
dict
(
cfg_store
=
json
.
dumps
(
cfg
),
return
dict
(
cfg_store
=
json
.
dumps
(
cfg
,
cls
=
JSONEncoder
),
team_project
=
repr_team_project
(
db
,
selector
),
selector
=
selector
)
controllers/wizards.py
View file @
2003ca58
...
...
@@ -10,10 +10,11 @@ from gluon.storage import Storage
from
harvest_tools
import
DRY_RUN
from
invenio_tools
import
CdsException
,
load_record
,
Marc12Exception
from
plugin_dbui
import
(
CALLBACK_ERRORS
,
inline_alert
,
is_foreign_field
,
get_foreign_field
,
get_id
,
inline_alert
,
is_foreign_field
,
JSONEncoder
,
Selector
,
to_fields
)
...
...
@@ -182,7 +183,10 @@ def check_validate():
return
dict
(
counters
=
counters
,
logs
=
logs
,
publications_fields
=
json
.
dumps
(
to_fields
(
db
.
publications
)),
publications_fields
=
json
.
dumps
(
to_fields
(
db
.
publications
),
cls
=
JSONEncoder
),
selector
=
selector
)
...
...
models/main.py
View file @
2003ca58
...
...
@@ -74,7 +74,7 @@ current.auth = auth
T
.
set_current_languages
(
"en"
,
"en-gb"
,
"en-us"
)
# mother tongue
T
.
force
(
"fr-fr"
)
# user language
T
.
lazy
=
False
# immediate translation
T
.
lazy
=
True
# immediate translation
# ............................................................................
#
...
...
modules/ui_viewport.py
View file @
2003ca58
...
...
@@ -309,9 +309,9 @@ class ViewportUi(object):
timeout
=
ONE_HOUR
)
add_child
=
node
.
add_child
add_child
(
T
(
"run a free harvester"
),
free_panel
)
add_child
(
T
(
"run a harvester"
),
harvester_panel
)
add_child
(
T
(
"run all harvesters"
),
run_all_panel
)
add_child
(
T
(
"run a free harvester"
,
lazy
=
False
),
free_panel
)
add_child
(
T
(
"run a harvester"
,
lazy
=
False
),
harvester_panel
)
add_child
(
T
(
"run all harvesters"
,
lazy
=
False
),
run_all_panel
)
node
.
sort_children
()
...
...
@@ -343,7 +343,7 @@ class ViewportUi(object):
loader
=
dict
(
autoLoad
=
True
,
renderer
=
"html"
,
url
=
URL
(
"plugin_dbui"
,
"documentations_
table
"
))
url
=
URL
(
"plugin_dbui"
,
"documentations_
list
"
))
doc_panel
=
Panel
(
loader
=
loader
,
...
...
@@ -479,15 +479,15 @@ class ViewportUi(object):
baseUrl
=
URL
(
"harvest"
,
"insert_marcxml"
))
add_child
=
node
.
add_child
add_child
(
T
(
"extract authors"
),
author_panel
)
add_child
(
T
(
"extract authors"
,
lazy
=
False
),
author_panel
)
if
session
.
role
==
ADMIN
:
add_child
(
T
(
"check and validate"
),
check_panel
)
add_child
(
T
(
"check and validate"
,
lazy
=
False
),
check_panel
)
else
:
add_child
(
T
(
"check"
),
check_panel
)
add_child
(
T
(
"check"
,
lazy
=
False
),
check_panel
)
add_child
(
T
(
"edit and insert"
),
edit_panel
)
add_child
(
T
(
"insert MARCXML"
),
marc12_panel
)
add_child
(
T
(
"edit and insert"
,
lazy
=
False
),
edit_panel
)
add_child
(
T
(
"insert MARCXML"
,
lazy
=
False
),
marc12_panel
)
node
.
sort_children
()
...
...
views/harvest/edit_insert.html
View file @
2003ca58
...
...
@@ -7,12 +7,13 @@
#
#--------------------------------------------------------------------------
import json
from plugin_dbui import JSONEncoder
}}
<script
type=
"text/javascript"
>
var
cfg
=
{{
=
XML
(
json
.
dumps
(
cfg
))}},
values
=
{{
=
XML
(
json
.
dumps
(
values
))}},
var
cfg
=
{{
=
XML
(
json
.
dumps
(
cfg
,
cls
=
JSONEncoder
))}},
values
=
{{
=
XML
(
json
.
dumps
(
values
,
cls
=
JSONEncoder
))}},
form
,
win
;
// create the form and load values
...
...
views/harvest/layout.html
View file @
2003ca58
...
...
@@ -17,9 +17,10 @@
# - export python variable to the javascript
#
#--------------------------------------------------------------------------
import gluon
import json
from datetime import datetime
from gluon.storage import Storage
from plugin_dbui import JSONEncoder
#
# configure the Ext.data.Array for the statistics
...
...
@@ -64,7 +65,7 @@
cfg['data'].append(stat)
pass
cfg_statStore = json.dumps(cfg)
cfg_statStore = json.dumps(cfg
, cls=JSONEncoder
)
#
# configure the Ext.data.Array for the logs
...
...
@@ -87,7 +88,7 @@
for row in logs:
cfg['data'].append([row.action,
row.collection,
json.dumps(row.harvester),
json.dumps(row.harvester
, cls=JSONEncoder
),
row.harvester.host,
row.record_id,
row.synonym,
...
...
@@ -97,7 +98,7 @@
row.year])
pass
cfg_logsStore = json.dumps(cfg)
cfg_logsStore = json.dumps(cfg
, cls=JSONEncoder
)
#
# Write the Title on the HTML page
...
...
views/wizards/check_validate.html
View file @
2003ca58
...
...
@@ -22,6 +22,7 @@
#--------------------------------------------------------------------------
import json
from datetime import datetime
from plugin_dbui import JSONEncoder
#
# create the URL to compare id and ids
...
...
@@ -82,7 +83,7 @@
cfg['data'].append(record)
pass
cfg_statStore = json.dumps(cfg)
cfg_statStore = json.dumps(cfg
, cls=JSONEncoder
)
#.........................................................................
#
...
...
@@ -113,7 +114,7 @@
pass
pass
cfg_logsStore = json.dumps(cfg)
cfg_logsStore = json.dumps(cfg
, cls=JSONEncoder
)
#.........................................................................
#
...
...
@@ -140,7 +141,7 @@
pass
pass
publications_fields = json.dumps(items)
publications_fields = json.dumps(items
, cls=JSONEncoder
)
#.........................................................................
#
...
...
views/wizards/compare_publications.html
View file @
2003ca58
...
...
@@ -13,6 +13,7 @@
#
#--------------------------------------------------------------------------
import json
from plugin_dbui import JSONEncoder
#
# configure the Ext.data.Array
...
...
@@ -25,7 +26,7 @@
cfg['data'] = data
cfg_store = json.dumps(cfg)
cfg_store = json.dumps(cfg
, cls=JSONEncoder
)
#
# unique identifier for the DIV block associated to a grid
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment