Files
invenio-theme-iform/invenio_theme_tugraz/views.py
mb 00145cc0ee enhancement
reduced recent_uploads to 5 records, added searchbar to frontpage. This closes #47
2020-07-21 14:28:29 +02:00

30 lines
732 B
Python

# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 mojib wali.
#
# invenio-theme-tugraz is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""invenio module for TUGRAZ theme."""
from flask import Blueprint, render_template
from flask_babelex import gettext as _
from .search import FrontpageRecordsSearch
blueprint = Blueprint(
'invenio_theme_tugraz',
__name__,
template_folder='templates',
static_folder='static',
)
@blueprint.route("/")
def index():
"""Render frontpage view."""
return render_template(
"invenio_theme_tugraz/index.html",
records=FrontpageRecordsSearch()[:5].sort('-_created').execute(),)