API Docs

Invenio standard theme.

class invenio_theme.ext.InvenioTheme(app=None, **kwargs)[source]

Invenio theme extension.

Extension initialization.

Parameters:
  • app – An instance of Flask.
  • **kwargs – Keyword arguments are passed to init_app method.
init_app(app, **kwargs)[source]

Initialize application object.

Parameters:app – An instance of Flask.
init_config(app)[source]

Initialize configuration.

Parameters:app – An instance of Flask.

Bundles

JS/CSS bundles for theme.

You include one of the bundles in a page like the example below (using js bundle as an example):

{%- asset "invenio_theme.bundles:js" %}
<script src="{{ASSET_URL}}"  type="text/javascript"></script>
{%- end asset %}
class invenio_theme.bundles.LazyNpmBundle(*contents, **options)[source]

Magically evaluate lazy strings as file names.

Initialize the named bundle.

Parameters:
  • name (str) – name of the bundle
  • npm (dict) – npm dependencies
contents

Create strings from lazy strings.

invenio_theme.bundles.admin_css = <NpmBundle output=gen/styles.admin.%(version)s.css, filters=[<webassets.filter.node_sass.NodeSCSS object>, <invenio_assets.filters.CleanCSSFilter object>], contents=('scss/invenio_theme/admin.scss',)>

Default style for admin interface.

invenio_theme.bundles.admin_js = <NpmBundle output=gen/admin.%(version)s.js, filters=[<webassets.filter.jsmin.JSMin object>], contents=('node_modules/jquery/jquery.js', 'node_modules/moment/moment.js', 'node_modules/select2/dist/js/select2.full.js', 'node_modules/bootstrap-sass/assets/javascripts/bootstrap.js', 'node_modules/admin-lte/dist/js/app.js')>

AdminJS contains JQuery, Moment, Select2, Bootstrap, and Admin-LTE.

invenio_theme.bundles.admin_lte_css

Admin LTE CSS.

invenio_theme.bundles.css = <NpmBundle output=gen/styles.%(version)s.css, filters=[<webassets.filter.node_sass.NodeSCSS object>, <invenio_assets.filters.CleanCSSFilter object>], contents=('scss/invenio_theme/styles.scss',)>

Default CSS bundle with Bootstrap and Font-Awesome.

invenio_theme.bundles.js = <Bundle output=gen/packed.%(version)s.js, filters=[<webassets.filter.jsmin.JSMin object>], contents=(<NpmBundle output=None, filters=[<webassets.filter.uglifyjs.UglifyJS object>], contents=('node_modules/almond/almond.js', 'js/settings.js')>, <Bundle output=gen/base.%(version)s.js, filters=[<webassets.filter.requirejs.RequireJSFilter object>], contents=('js/base.js',)>)>

Default JavaScript bundle with Almond, JQuery and RequireJS.

invenio_theme.bundles.lazy_skin()[source]

Generate skin path.

Handlers

Invenio error handlers.

invenio_theme.views.index()[source]

Simplistic front page view.

invenio_theme.views.insufficient_permissions(e)[source]

Error handler to show a 403.html page in case of a 403 error.

invenio_theme.views.internal_error(e)[source]

Error handler to show a 500.html page in case of a 500 error.

invenio_theme.views.page_not_found(e)[source]

Error handler to show a 404.html page in case of a 404 error.

invenio_theme.views.unauthorized(e)[source]

Error handler to show a 401.html page in case of a 401 error.