ui: display access badge

index: UIJSONSerializer is used in order to serialize the elasticsearch results
This commit is contained in:
rekt-hard
2021-05-06 09:46:25 +02:00
committed by GitHub
parent e47b2b169a
commit 34ecce4842
2 changed files with 10 additions and 1 deletions

View File

@@ -66,6 +66,11 @@
<span class="ui label teal" title="{{_('Resource type')}}">
{{r.metadata.resource_type | cast_to_dict | vocabulary_title('resource_type') }}
</span>
<span class="ui label small 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 }}
</span>
<span class="label record-version">
<!--TODO: add subtype--->

View File

@@ -63,9 +63,13 @@ def ui_blueprint(app):
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=FrontpageRecordsSearch()[:5].sort("-created").execute(),
records=records
)