mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-22 20:51:58 +00:00
global: refactor upon release changes
resource_type: change in index and values of resource type. func: that will serialize list of records.
This commit is contained in:
@@ -64,9 +64,9 @@
|
||||
|
||||
<!--Resource type badge-->
|
||||
<span class="ui label grey" data-tooltip="{{_('Resource type')}}" data-inverted>
|
||||
{{r.metadata.resource_type | cast_to_dict | vocabulary_title('resource_type') }}
|
||||
{{ r.ui.resource_type.title_l10n }}
|
||||
</span>
|
||||
|
||||
|
||||
<span class="ui label access-status {{ r.ui.access_status.id }}" data-tooltip="{{ r.ui.access_status.description_l10n }}" data-inverted="">
|
||||
{% if r.ui.access_status.icon %}<i class="icon {{ r.ui.access_status.icon }}"></i>{% endif %}
|
||||
{{ r.ui.access_status.title_l10n }}
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user