mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2026-08-01 02:12:06 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
924dde4fa7 | ||
|
|
204f7b81c3 | ||
|
|
10881c5627 |
@@ -26,7 +26,8 @@
|
|||||||
|
|
||||||
<!--Log in with SSO-->
|
<!--Log in with SSO-->
|
||||||
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
|
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
|
||||||
<div class="login-page-button">
|
<div class="ui divider"></div>
|
||||||
|
<div class="login-page-button ui fluid large button">
|
||||||
<a href="{{ url_for('sso_saml.sso', idp='idp') }}" class="inverted tiny image label">
|
<a href="{{ url_for('sso_saml.sso', idp='idp') }}" class="inverted tiny image label">
|
||||||
{% trans type='TUGRAZ' %} Log in with {{ type }}{% endtrans %}
|
{% trans type='TUGRAZ' %} Log in with {{ type }}{% endtrans %}
|
||||||
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="20px" />
|
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="20px" />
|
||||||
|
|||||||
@@ -45,7 +45,8 @@
|
|||||||
|
|
||||||
<!--Sigup with SSO-->
|
<!--Sigup with SSO-->
|
||||||
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
|
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
|
||||||
<div class="login-page-button">
|
<div class="ui divider"></div>
|
||||||
|
<div class="login-page-button ui fluid large button">
|
||||||
<a href="{{ url_for('sso_saml.sso', idp='idp') }}" class="inverted tiny image label">
|
<a href="{{ url_for('sso_saml.sso', idp='idp') }}" class="inverted tiny image label">
|
||||||
<span style="font-size: 18px;">{{ _('Sign up with TUGRAZ ') }}</span>
|
<span style="font-size: 18px;">{{ _('Sign up with TUGRAZ ') }}</span>
|
||||||
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="20px" />
|
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="20px" />
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ This file is imported by ``invenio_theme_tugraz.__init__``,
|
|||||||
and parsed by ``setup.py``.
|
and parsed by ``setup.py``.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "1.1.0"
|
__version__ = "1.2.0"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ def index():
|
|||||||
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
|
)
|
||||||
|
|
||||||
|
|
||||||
@blueprint.app_template_filter("make_dict_like")
|
@blueprint.app_template_filter("make_dict_like")
|
||||||
@@ -38,10 +38,10 @@ def make_dict_like(value: str, key: str) -> Dict[str, str]:
|
|||||||
|
|
||||||
in the form of a key -> value pair.
|
in the form of a key -> value pair.
|
||||||
"""
|
"""
|
||||||
return {key: value} # pragma: no cover
|
return {key: value}
|
||||||
|
|
||||||
|
|
||||||
@blueprint.app_template_filter("cast_to_dict")
|
@blueprint.app_template_filter("cast_to_dict")
|
||||||
def cast_to_dict(attr_dict):
|
def cast_to_dict(attr_dict):
|
||||||
"""Return the dict structure of AttrDict variable."""
|
"""Return the dict structure of AttrDict variable."""
|
||||||
return AttrDict.to_dict(attr_dict) # pragma: no cover
|
return AttrDict.to_dict(attr_dict)
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ history = open("CHANGES.rst").read()
|
|||||||
|
|
||||||
tests_require = [
|
tests_require = [
|
||||||
"pytest-invenio>=1.4.0",
|
"pytest-invenio>=1.4.0",
|
||||||
|
'invenio-app>=1.3.0,<2.0.0',
|
||||||
|
# TODO: remove once a new release is out
|
||||||
|
'docker-services-cli>=0.2.1,<0.3.0'
|
||||||
]
|
]
|
||||||
|
|
||||||
extras_require = {
|
extras_require = {
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# -*- 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.
|
||||||
|
|
||||||
|
"""Pytest configuration.
|
||||||
|
|
||||||
|
See https://pytest-invenio.readthedocs.io/ for documentation on which test
|
||||||
|
fixtures are available.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from invenio_app.factory import create_ui
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='module')
|
||||||
|
def create_app(instance_path):
|
||||||
|
"""Application factory fixture."""
|
||||||
|
return create_ui
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# -*- 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.
|
||||||
|
|
||||||
|
"""Test views."""
|
||||||
|
|
||||||
|
from elasticsearch_dsl.utils import AttrDict
|
||||||
|
|
||||||
|
from invenio_theme_tugraz.views import cast_to_dict, make_dict_like
|
||||||
|
|
||||||
|
|
||||||
|
def test_make_dict_like():
|
||||||
|
"""Test make_dict_like."""
|
||||||
|
access = {
|
||||||
|
"access_right" : "open"
|
||||||
|
}
|
||||||
|
dicts = make_dict_like("open", "access_right")
|
||||||
|
assert access == dicts
|
||||||
|
|
||||||
|
|
||||||
|
def test_cast_to_dict():
|
||||||
|
"""Test cast_to_dict."""
|
||||||
|
resource_type = {
|
||||||
|
"subtype" : "publication-datamanagementplan",
|
||||||
|
"type" : "publication"
|
||||||
|
}
|
||||||
|
expected = {'subtype': 'publication-datamanagementplan', 'type': 'publication'}
|
||||||
|
attr = cast_to_dict(AttrDict(resource_type))
|
||||||
|
assert expected == attr
|
||||||
Reference in New Issue
Block a user