diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html index 424ca0f..ffc6bba 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html @@ -64,9 +64,9 @@ - {{r.metadata.resource_type | cast_to_dict | vocabulary_title('resource_type') }} + {{ r.ui.resource_type.title_l10n }} - + {% if r.ui.access_status.icon %}{% endif %} {{ r.ui.access_status.title_l10n }} diff --git a/invenio_theme_tugraz/views.py b/invenio_theme_tugraz/views.py index b8fa9cd..4ac0c95 100644 --- a/invenio_theme_tugraz/views.py +++ b/invenio_theme_tugraz/views.py @@ -61,15 +61,21 @@ def ui_blueprint(app): return blueprint +def records_serializer(records=None): + """Serialize list of records.""" + record_list = [] + for record in records: + record_list.append(UIJSONSerializer().serialize_object_to_dict(record.to_dict())) + return record_list + + def index(): """Frontpage.""" records = FrontpageRecordsSearch()[:5].sort("-created").execute() - for r in records: - r = UIJSONSerializer().serialize_object_to_dict(r.to_dict()) return render_template( "invenio_theme_tugraz/index.html", - records=records + records=records_serializer(records) ) diff --git a/invenio_theme_tugraz/webpack.py b/invenio_theme_tugraz/webpack.py index 4fb8f5c..070f241 100644 --- a/invenio_theme_tugraz/webpack.py +++ b/invenio_theme_tugraz/webpack.py @@ -30,7 +30,7 @@ theme = WebpackThemeBundle( 'prop-types': '^15.7.2', 'react-dnd': '^11.1.3', 'react-dnd-html5-backend': '^11.1.3', - 'react-invenio-deposit': '^0.13.5', + 'react-invenio-deposit': '^0.14.0', 'react-invenio-forms': '^0.7.0', 'react-dropzone': "^11.0.3", 'yup': '^0.27.0',