mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-23 05:01:58 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
924dde4fa7 | ||
|
|
204f7b81c3 | ||
|
|
10881c5627 | ||
|
|
804bd108c5 | ||
|
|
bbea43d227 | ||
|
|
84f963b407 | ||
|
|
e45832be2b | ||
|
|
75bb5377c8 | ||
|
|
e4fc2ff14d | ||
|
|
b33274a3ea | ||
|
|
11abd513e9 | ||
|
|
4e35220e5b | ||
|
|
9126efbe42 | ||
|
|
2227e8d204 |
@@ -32,8 +32,8 @@ indent_size = 4
|
|||||||
[*.{css,html,js,json,yml}]
|
[*.{css,html,js,json,yml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
# Matches the exact files either package.json or .travis.yml
|
# Matches the exact files either package.json or .github/workflows/*.yml
|
||||||
[{package.json,.travis.yml}]
|
[{package.json, .github/workflows/*.yml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
# Dockerfile
|
# Dockerfile
|
||||||
|
|||||||
54
.github/workflows/tests.yml
vendored
Normal file
54
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
pull_request:
|
||||||
|
branches: master
|
||||||
|
schedule:
|
||||||
|
# * is a special character in YAML so you have to quote this string
|
||||||
|
- cron: '0 3 * * 6'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
reason:
|
||||||
|
description: 'Reason'
|
||||||
|
required: false
|
||||||
|
default: 'Manual trigger'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Tests:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.6, 3.7, 3.8]
|
||||||
|
requirements-level: [min, pypi]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Generate dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip setuptools py wheel requirements-builder
|
||||||
|
requirements-builder -e all --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
|
||||||
|
|
||||||
|
- name: Cache pip
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt
|
||||||
|
pip install .[all]
|
||||||
|
pip freeze
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
./run-tests.sh
|
||||||
55
.travis.yml
55
.travis.yml
@@ -1,55 +0,0 @@
|
|||||||
# -*- 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.
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- /^v\d+\.\d+(\.\d+)?(\S*)?$/
|
|
||||||
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
language: python
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
fast_finish: true
|
|
||||||
allow_failures:
|
|
||||||
# To allow failures, you need to specify the full environment
|
|
||||||
- env: REQUIREMENTS=devel
|
|
||||||
|
|
||||||
cache:
|
|
||||||
- pip
|
|
||||||
|
|
||||||
env:
|
|
||||||
- REQUIREMENTS=lowest
|
|
||||||
- REQUIREMENTS=release
|
|
||||||
- REQUIREMENTS=devel
|
|
||||||
|
|
||||||
python:
|
|
||||||
- "3.6"
|
|
||||||
- "3.7"
|
|
||||||
- "3.8"
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- "nvm install 6; nvm use 6"
|
|
||||||
- "travis_retry pip install --upgrade pip setuptools py"
|
|
||||||
- "travis_retry pip install twine wheel coveralls requirements-builder"
|
|
||||||
- "requirements-builder -e all --level=min setup.py > .travis-lowest-requirements.txt"
|
|
||||||
- "requirements-builder -e all --level=pypi setup.py > .travis-release-requirements.txt"
|
|
||||||
- "requirements-builder -e all --level=dev --req requirements-devel.txt setup.py > .travis-devel-requirements.txt"
|
|
||||||
|
|
||||||
install:
|
|
||||||
- "travis_retry pip install -r .travis-${REQUIREMENTS}-requirements.txt"
|
|
||||||
- "travis_retry pip install -e .[all]"
|
|
||||||
|
|
||||||
script:
|
|
||||||
- "./run-tests.sh"
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- coveralls
|
|
||||||
@@ -10,7 +10,7 @@ Types of Contributions
|
|||||||
Report Bugs
|
Report Bugs
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
||||||
Report bugs at https://github.com/mb-wali/invenio-theme-tugraz/issues.
|
Report bugs at https://github.com/tu-graz-library/invenio-theme-tugraz/issues.
|
||||||
|
|
||||||
If you are reporting a bug, please include:
|
If you are reporting a bug, please include:
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ Submit Feedback
|
|||||||
~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The best way to send feedback is to file an issue at
|
The best way to send feedback is to file an issue at
|
||||||
https://github.com/mb-wali/invenio-theme-tugraz/issues.
|
https://github.com/tu-graz-library/invenio-theme-tugraz/issues.
|
||||||
|
|
||||||
If you are proposing a feature:
|
If you are proposing a feature:
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ Get Started!
|
|||||||
|
|
||||||
Ready to contribute? Here's how to set up `invenio-theme-tugraz` for local development.
|
Ready to contribute? Here's how to set up `invenio-theme-tugraz` for local development.
|
||||||
|
|
||||||
1. Fork the `https://github.com/mb-wali/invenio-theme-tugraz.git` repo on GitHub.
|
1. Fork the `https://github.com/tu-graz-library/invenio-theme-tugraz.git` repo on GitHub.
|
||||||
2. Clone your fork locally:
|
2. Clone your fork locally:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -114,5 +114,5 @@ Before you submit a pull request, check that it meets these guidelines:
|
|||||||
2. If the pull request adds functionality, the docs should be updated. Put
|
2. If the pull request adds functionality, the docs should be updated. Put
|
||||||
your new functionality into a function with a docstring.
|
your new functionality into a function with a docstring.
|
||||||
3. The pull request should work for Python 2.7, 3.5 and 3.6. Check
|
3. The pull request should work for Python 2.7, 3.5 and 3.6. Check
|
||||||
https://travis-ci.com/github/mb-wali/invenio-theme-tugraz/pull_requests
|
https://github.com/tu-graz-library/invenio-theme-tugraz/actions?query=event%3Apull_request
|
||||||
and make sure that the tests pass for all supported Python versions.
|
and make sure that the tests pass for all supported Python versions.
|
||||||
|
|||||||
@@ -35,4 +35,5 @@ recursive-include invenio_theme_tugraz *.less
|
|||||||
recursive-include invenio_theme_tugraz *.ico
|
recursive-include invenio_theme_tugraz *.ico
|
||||||
recursive-include tests *.py
|
recursive-include tests *.py
|
||||||
recursive-include invenio_theme_tugraz *.jpg
|
recursive-include invenio_theme_tugraz *.jpg
|
||||||
recursive-include invenio_theme_tugraz *.gitkeep
|
recursive-include invenio_theme_tugraz *.gitkeep
|
||||||
|
recursive-include .github/workflows *.yml
|
||||||
14
README.rst
14
README.rst
@@ -9,17 +9,17 @@
|
|||||||
invenio-theme-tugraz
|
invenio-theme-tugraz
|
||||||
======================
|
======================
|
||||||
|
|
||||||
.. image:: https://travis-ci.com/mb-wali/invenio-theme-tugraz.svg
|
.. image:: https://github.com/tu-graz-library/invenio-theme-tugraz/workflows/CI/badge.svg
|
||||||
:target: https://travis-ci.com/github/mb-wali/invenio-theme-tugraz
|
:target: https://github.com/tu-graz-library/invenio-theme-tugraz/actions
|
||||||
|
|
||||||
.. image:: https://img.shields.io/pypi/dm/invenio-theme-tugraz.svg
|
.. image:: https://img.shields.io/pypi/dm/invenio-theme-tugraz.svg
|
||||||
:target: https://pypi.python.org/pypi/invenio-theme-tugraz
|
:target: https://pypi.python.org/pypi/invenio-theme-tugraz
|
||||||
|
|
||||||
.. image:: https://img.shields.io/github/tag/mb-wali/invenio-theme-tugraz.svg
|
.. image:: https://img.shields.io/github/tag/tu-graz-library/invenio-theme-tugraz.svg
|
||||||
:target: https://github.com/mb-wali/invenio-theme-tugraz/releases
|
:target: https://github.com/tu-graz-library/invenio-theme-tugraz/releases
|
||||||
|
|
||||||
.. image:: https://img.shields.io/github/license/mb-wali/invenio-theme-tugraz.svg
|
.. image:: https://img.shields.io/github/license/tu-graz-library/invenio-theme-tugraz.svg
|
||||||
:target: https://github.com/mb-wali/invenio-theme-tugraz/blob/master/LICENSE
|
:target: https://github.com/tu-graz-library/invenio-theme-tugraz/blob/master/LICENSE
|
||||||
|
|
||||||
.. image:: https://readthedocs.org/projects/invenio-theme-tugraz/badge/?version=latest
|
.. image:: https://readthedocs.org/projects/invenio-theme-tugraz/badge/?version=latest
|
||||||
:target: https://invenio-theme-tugraz.readthedocs.io/en/latest/?badge=latest
|
:target: https://invenio-theme-tugraz.readthedocs.io/en/latest/?badge=latest
|
||||||
@@ -27,6 +27,8 @@
|
|||||||
.. image:: https://img.shields.io/coveralls/mb-wali/invenio-theme-tugraz.svg
|
.. image:: https://img.shields.io/coveralls/mb-wali/invenio-theme-tugraz.svg
|
||||||
:target: https://coveralls.io/r/mb-wali/invenio-theme-tugraz
|
:target: https://coveralls.io/r/mb-wali/invenio-theme-tugraz
|
||||||
|
|
||||||
|
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
||||||
|
:target: https://github.com/psf/black
|
||||||
|
|
||||||
TU Graz standard theme.
|
TU Graz standard theme.
|
||||||
|
|
||||||
|
|||||||
@@ -116,13 +116,13 @@ html_theme = "alabaster"
|
|||||||
|
|
||||||
html_theme_options = {
|
html_theme_options = {
|
||||||
"description": "invenio module for TUGRAZ theme.",
|
"description": "invenio module for TUGRAZ theme.",
|
||||||
"github_user": "inveniosoftware",
|
"github_user": "TU Graz",
|
||||||
"github_repo": "invenio-theme-tugraz",
|
"github_repo": "invenio-theme-tugraz",
|
||||||
"github_button": False,
|
"github_button": False,
|
||||||
"github_banner": True,
|
"github_banner": True,
|
||||||
"show_powered_by": False,
|
"show_powered_by": False,
|
||||||
"extra_nav_links": {
|
"extra_nav_links": {
|
||||||
"invenio-theme-tugraz@GitHub": "https://github.com/mb-wali/invenio-theme-tugraz",
|
"invenio-theme-tugraz@GitHub": "https://github.com/tu-graz-library/invenio-theme-tugraz",
|
||||||
"invenio-theme-tugraz@PyPI": "https://pypi.python.org/pypi/invenio-theme-tugraz/",
|
"invenio-theme-tugraz@PyPI": "https://pypi.python.org/pypi/invenio-theme-tugraz/",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,4 +48,4 @@
|
|||||||
}
|
}
|
||||||
.spacer-long{
|
.spacer-long{
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,9 @@
|
|||||||
|
|
||||||
.affiliation-text {
|
.affiliation-text {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
font-size: 17px;
|
font-size: 12px;
|
||||||
vertical-align: middle;
|
line-height: 17px;
|
||||||
|
letter-spacing: 2px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,3 +249,7 @@ svg:not(:root) {
|
|||||||
.inline-elements{
|
.inline-elements{
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.home-inline{
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|||||||
BIN
invenio_theme_tugraz/static/images/library_logo.png
Normal file
BIN
invenio_theme_tugraz/static/images/library_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -5,14 +5,14 @@
|
|||||||
{%- if config.SECURITY_REGISTERABLE %}
|
{%- if config.SECURITY_REGISTERABLE %}
|
||||||
<div class="short-menu-right-button">
|
<div class="short-menu-right-button">
|
||||||
<a href="{{ url_for('security.register') }}">
|
<a href="{{ url_for('security.register') }}">
|
||||||
<i class="user plus icon circular"></i> {{_ ("Sign Up")}}
|
{{_ ("Sign up")}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<div class="short-menu-right-button">
|
<div class="short-menu-right-button">
|
||||||
<a href="{{url_for_security('login', next=request.path)}}" style="text-decoration:none">
|
<a href="{{url_for_security('login', next=request.path)}}" style="text-decoration:none">
|
||||||
<i class="sign in icon circular"></i> {{_ ("Log in")}}
|
{{_ ("Log in")}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="short-menu-right-button">
|
<div class="short-menu-right-button">
|
||||||
<a class="dropdown-item" href="{{url_for_security('logout')}}">
|
<a class="dropdown-item" href="{{url_for_security('logout')}}">
|
||||||
<i class="sign out icon circular"></i>{{_('Logout')}}
|
{{_('Sign out')}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,12 @@
|
|||||||
<h3 class="ui login header">{{ _('Log in to Repository') }}</h3>
|
<h3 class="ui login header">{{ _('Log in to Repository') }}</h3>
|
||||||
{%- endblock form_header %}
|
{%- endblock form_header %}
|
||||||
|
|
||||||
<!--Login 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' %} Login 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" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,7 +57,7 @@
|
|||||||
{%- if security.registerable %}
|
{%- if security.registerable %}
|
||||||
<div class="ui primary segment padded text-muted">
|
<div class="ui primary segment padded text-muted">
|
||||||
{% trans sitename=config.ACCOUNTS_SITENAME %}New to {{ sitename }}?{% endtrans %}
|
{% trans sitename=config.ACCOUNTS_SITENAME %}New to {{ sitename }}?{% endtrans %}
|
||||||
<a href="{{ url_for_security('register', next=request.args.get('next')) }}">{{ _('Sign Up') }}</a>
|
<a href="{{ url_for_security('register', next=request.args.get('next')) }}">{{ _('Sign up') }}</a>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endblock registerable %}
|
{%- endblock registerable %}
|
||||||
|
|||||||
@@ -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" />
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
|
|
||||||
<div class="centered row">
|
<div class="centered row">
|
||||||
<button type="submit" class="ui fluid large submit button">
|
<button type="submit" class="ui fluid large submit button">
|
||||||
<i class="ui edit outline icon"></i>{{ _('Sign Up') }}
|
<i class="ui edit outline icon"></i>{{ _('Sign up') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -19,8 +19,9 @@
|
|||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
<div class="ui grid stackable container">
|
<div class="ui grid stackable container">
|
||||||
<div class="three column row centered" style="padding-bottom: 0;">
|
<div class="three column row centered" style="padding-bottom: 0;">
|
||||||
<div class="two wide column main-menu-entry main-menu-entry-svg">
|
<div class="two wide column main-menu-entry">
|
||||||
<a href="{{url_for('invenio_theme_tugraz.index')}}" title="Home">
|
<a href="{{url_for('invenio_theme_tugraz.index')}}" title="Home">
|
||||||
|
<span class="home-inline">
|
||||||
<svg shape-rendering="geometricPrecision" id="int-menu-q-home-icon"
|
<svg shape-rendering="geometricPrecision" id="int-menu-q-home-icon"
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg"
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg"
|
||||||
version="1.1" xml:space="preserve" height="36.997" width="35.969"
|
version="1.1" xml:space="preserve" height="36.997" width="35.969"
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
</polyline>
|
</polyline>
|
||||||
</svg>
|
</svg>
|
||||||
{{_ ("Home")}}
|
{{_ ("Home")}}
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{%- for item in current_menu.submenu('main').children|sort(attribute='order') if item.visible recursive %}
|
{%- for item in current_menu.submenu('main').children|sort(attribute='order') if item.visible recursive %}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
<h4>
|
<h4>
|
||||||
<a href="{{ record_url }}">
|
<a href="{{ record_url }}">
|
||||||
{{r.metadata.titles[0].title}}
|
{{r.metadata.title}}
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
<p class="hidden-xs">
|
<p class="hidden-xs">
|
||||||
<a href="{{record_url}}">
|
<a href="{{record_url}}">
|
||||||
{{ r.metadata.descriptions[0].description | striptags | truncate(300) }}
|
{{ r.metadata.description | striptags | truncate(300) }}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
{%- for creators in authors_list %}
|
{%- for creators in authors_list %}
|
||||||
|
|
||||||
{%- if creators.identifiers.Orcid %}
|
{%- if creators.identifiers.orcid %}
|
||||||
<a href="{{creators.identifiers.Orcid|pid_url('orcid')}}" target="_blank" ><img class="inline-orcid" src="{{ url_for('static', filename='extra/orcid.png')}}" /></a>
|
<a href="{{creators.identifiers.orcid|pid_url('orcid')}}" target="_blank" ><img class="inline-orcid" src="{{ url_for('static', filename='extra/orcid.png')}}" /></a>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<span class="text-muted" {% if creators.affiliations %} {% for affiliation in creators.affiliations %} data-toggle="tooltip" title="{{affiliation.name}}" {%- endfor %} {% endif %}>{{creators.name}}</span>
|
<span class="text-muted" {% if creators.affiliations %} {% for affiliation in creators.affiliations %} data-toggle="tooltip" title="{{affiliation.name}}" {%- endfor %} {% endif %}>{{creators.name}}</span>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<!--TODO: contributers-->
|
<!--TODO: contributers-->
|
||||||
{%- macro contributors(contributors_list) %}
|
{%- macro contributors(contributors_list) %}
|
||||||
{%- for group in contributors_list|groupby('type')%}
|
{%- for group in contributors_list|groupby('type')%}
|
||||||
<h5>{{group.grouper|contributortype_title}}(s)</h5>
|
<h5>{{group.grouper}}(s)</h5>
|
||||||
{{authors(group.list)}}
|
{{authors(group.list)}}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
@@ -58,13 +58,15 @@
|
|||||||
<div class="left floated left aligned six wide column" id="repo-logo">
|
<div class="left floated left aligned six wide column" id="repo-logo">
|
||||||
<div class="inline-elements">
|
<div class="inline-elements">
|
||||||
<div class="repo-img">
|
<div class="repo-img">
|
||||||
<img height="51.862" src="{{ url_for('static', filename='images/Icon_1_v2.svg')}}">
|
<img height="51.862" src="{{ url_for('static', filename='images/library_logo.png')}}">
|
||||||
</div>
|
</div>
|
||||||
<div class="affiliation-text">
|
<div class="affiliation-text">
|
||||||
<a title="RDM" href="{{url_for('invenio_theme_tugraz.index')}}">
|
<a title="RDM" href="{{url_for('invenio_theme_tugraz.index')}}">
|
||||||
TU Graz
|
TU GRAZ
|
||||||
<br>
|
<br>
|
||||||
{{_ ("Repository")}}
|
{{_ ("REPOSITORY")}}
|
||||||
|
<br>
|
||||||
|
{{_ ("LIBRARY & ARCHIVES")}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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.0.5"
|
__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)
|
||||||
|
|||||||
@@ -7,6 +7,6 @@
|
|||||||
# details.
|
# details.
|
||||||
|
|
||||||
[pytest]
|
[pytest]
|
||||||
addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_theme_tugraz --cov-report=term-missing
|
addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_theme_tugraz --cov-report=term-missing tests invenio_theme_tugraz
|
||||||
testpaths = tests invenio_theme_tugraz
|
testpaths = tests invenio_theme_tugraz
|
||||||
live_server_scope = module
|
live_server_scope = module
|
||||||
|
|||||||
@@ -7,10 +7,9 @@
|
|||||||
# modify it under the terms of the MIT License; see LICENSE file for more
|
# modify it under the terms of the MIT License; see LICENSE file for more
|
||||||
# details.
|
# details.
|
||||||
|
|
||||||
docker-services-cli up postgresql es redis
|
python -m check_manifest --ignore ".*-requirements.txt"
|
||||||
python -m check_manifest --ignore ".travis-*" && \
|
python -m sphinx.cmd.build -qnNW docs docs/_build/html
|
||||||
python -m sphinx.cmd.build -qnNW docs docs/_build/html && \
|
docker-services-cli --verbose up es postgresql redis
|
||||||
docker-services-cli up es postgresql redis
|
|
||||||
python -m pytest
|
python -m pytest
|
||||||
tests_exit_code=$?
|
tests_exit_code=$?
|
||||||
docker-services-cli down
|
docker-services-cli down
|
||||||
|
|||||||
5
setup.py
5
setup.py
@@ -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 = {
|
||||||
@@ -71,7 +74,7 @@ setup(
|
|||||||
license="MIT",
|
license="MIT",
|
||||||
author="mojib wali",
|
author="mojib wali",
|
||||||
author_email="mojib.wali@tugraz.at",
|
author_email="mojib.wali@tugraz.at",
|
||||||
url="https://github.com/mb-wali/invenio-theme-tugraz",
|
url="https://github.com/tu-graz-library/invenio-theme-tugraz",
|
||||||
packages=packages,
|
packages=packages,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
|||||||
22
tests/ui/conftest.py
Normal file
22
tests/ui/conftest.py
Normal file
@@ -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
|
||||||
33
tests/ui/test_views.py
Normal file
33
tests/ui/test_views.py
Normal file
@@ -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