mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2026-07-28 08:52:06 +01: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:
|
class Meta:
|
||||||
"""Default index and filter for frontpage search."""
|
"""Default index and filter for frontpage search."""
|
||||||
|
|
||||||
index = "records"
|
index = "rdmrecords"
|
||||||
default_filter = Q("query_string", query=("access_right:open "))
|
default_filter = Q("query_string", query=("access.access_right:open"))
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
{%- for r in records %}
|
{%- for r in records %}
|
||||||
{%- set creation_date = r._created|from_isodatetime -%}
|
{%- 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>
|
<article>
|
||||||
<!--TODO:
|
<!--TODO:
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<div class="badges">
|
<div class="badges">
|
||||||
<!--Publication date badge-->
|
<!--Publication date badge-->
|
||||||
<span class="ui label teal" title="{{_('Publication date')}}">
|
<span class="ui label teal" title="{{_('Publication date')}}">
|
||||||
{{ r.publication_date }}
|
{{ r.metadata.publication_date }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!--Version badge-->
|
<!--Version badge-->
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
<!--Resource type badge-->
|
<!--Resource type badge-->
|
||||||
<span class="ui label grey" title="{{_('Resource type')}}">
|
<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>
|
||||||
|
|
||||||
<span class="label record-version">
|
<span class="label record-version">
|
||||||
@@ -70,17 +70,17 @@
|
|||||||
|
|
||||||
<h4>
|
<h4>
|
||||||
<a href="{{ record_url }}">
|
<a href="{{ record_url }}">
|
||||||
{{r.titles[0].title}}
|
{{r.metadata.titles[0].title}}
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{ creators(r.creators) }}
|
{{ creators(r.metadata.creators) }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="hidden-xs">
|
<p class="hidden-xs">
|
||||||
<a href="{{record_url}}">
|
<a href="{{record_url}}">
|
||||||
{{ r.descriptions[0].description | striptags | truncate(300) }}
|
{{ r.metadata.descriptions[0].description | striptags | truncate(300) }}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
<div class="right floated column">
|
<div class="right floated column">
|
||||||
<span class="access-right">
|
<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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ def index():
|
|||||||
"""Render frontpage view."""
|
"""Render frontpage view."""
|
||||||
return render_template(
|
return render_template(
|
||||||
"invenio_theme_tugraz/index.html",
|
"invenio_theme_tugraz/index.html",
|
||||||
records=FrontpageRecordsSearch()[:5].sort("-_created").execute(),
|
records=FrontpageRecordsSearch()[:5].sort("-created").execute(),
|
||||||
) # pragma: no cover
|
) # pragma: no cover
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user