mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2026-01-01 08:41:57 +00:00
migrate:upon the changes to the datamodel.
modified the frontpage to render the latest datamodel schema.
This commit is contained in:
@@ -21,5 +21,5 @@ class FrontpageRecordsSearch(RecordsSearch):
|
||||
class Meta:
|
||||
"""Default index and filter for frontpage search."""
|
||||
|
||||
index = "records"
|
||||
default_filter = Q("query_string", query=("access_right:open "))
|
||||
index = "rdmrecords"
|
||||
default_filter = Q("query_string", query=("access.access_right:open"))
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
{%- for r in records %}
|
||||
{%- set creation_date = r._created|from_isodatetime -%}
|
||||
{%- set record_url = url_for('invenio_records_ui.recid', pid_value=r['recid']) %}
|
||||
{%- set record_url = url_for('invenio_records_ui.recid', pid_value=r['id']) %}
|
||||
|
||||
<article>
|
||||
<!--TODO:
|
||||
@@ -50,7 +50,7 @@
|
||||
<div class="badges">
|
||||
<!--Publication date badge-->
|
||||
<span class="ui label teal" title="{{_('Publication date')}}">
|
||||
{{ r.publication_date }}
|
||||
{{ r.metadata.publication_date }}
|
||||
</span>
|
||||
|
||||
<!--Version badge-->
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
<!--Resource type badge-->
|
||||
<span class="ui label grey" title="{{_('Resource type')}}">
|
||||
{{r.resource_type | cast_to_dict | vocabulary_title('resource_type') }}
|
||||
{{r.metadata.resource_type | cast_to_dict | vocabulary_title('resource_type') }}
|
||||
</span>
|
||||
|
||||
<span class="label record-version">
|
||||
@@ -70,17 +70,17 @@
|
||||
|
||||
<h4>
|
||||
<a href="{{ record_url }}">
|
||||
{{r.titles[0].title}}
|
||||
{{r.metadata.titles[0].title}}
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
<p>
|
||||
{{ creators(r.creators) }}
|
||||
{{ creators(r.metadata.creators) }}
|
||||
</p>
|
||||
|
||||
<p class="hidden-xs">
|
||||
<a href="{{record_url}}">
|
||||
{{ r.descriptions[0].description | striptags | truncate(300) }}
|
||||
{{ r.metadata.descriptions[0].description | striptags | truncate(300) }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
<div class="right floated column">
|
||||
<span class="access-right">
|
||||
{{ r.access_right | make_dict_like('access_right') | vocabulary_title('access_right') | lower }}
|
||||
{{ r.access.access_right | make_dict_like('access_right') | vocabulary_title('access_right') | lower }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ def index():
|
||||
"""Render frontpage view."""
|
||||
return render_template(
|
||||
"invenio_theme_tugraz/index.html",
|
||||
records=FrontpageRecordsSearch()[:5].sort("-_created").execute(),
|
||||
records=FrontpageRecordsSearch()[:5].sort("-created").execute(),
|
||||
) # pragma: no cover
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user