mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-22 20:51:58 +00:00
overview: view publications only if permission
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
"""invenio module for TUGRAZ theme."""
|
"""invenio module for TUGRAZ theme."""
|
||||||
|
|
||||||
|
from invenio_records_marc21.ui.theme import current_identity_can_view
|
||||||
|
|
||||||
from . import config
|
from . import config
|
||||||
from .views import index, locked
|
from .views import index, locked
|
||||||
|
|
||||||
@@ -29,6 +31,10 @@ class InvenioThemeTugraz(object):
|
|||||||
|
|
||||||
app.register_error_handler(423, locked)
|
app.register_error_handler(423, locked)
|
||||||
|
|
||||||
|
@app.context_processor
|
||||||
|
def inject_visibility():
|
||||||
|
return {"can_view_marc21": current_identity_can_view()}
|
||||||
|
|
||||||
app.extensions["invenio-theme-tugraz"] = self
|
app.extensions["invenio-theme-tugraz"] = self
|
||||||
|
|
||||||
def init_config(self, app):
|
def init_config(self, app):
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if can_view_marc21 %}
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="ui segment" style="height: 480px">
|
<div class="ui segment" style="height: 480px">
|
||||||
<h2>{{ _("Publications") }}</h2>
|
<h2>{{ _("Publications") }}</h2>
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<div class="ui segment" style="height: 480px">
|
<div class="ui segment" style="height: 480px">
|
||||||
<h2>{{ _("Educational Resources") }}</h2>
|
<h2>{{ _("Educational Resources") }}</h2>
|
||||||
|
|||||||
@@ -40,10 +40,12 @@ install_requires =
|
|||||||
invenio-i18n>=1.3.1
|
invenio-i18n>=1.3.1
|
||||||
invenio_config_tugraz>=0.11.0
|
invenio_config_tugraz>=0.11.0
|
||||||
invenio_records_global_search>=0.0.1
|
invenio_records_global_search>=0.0.1
|
||||||
|
invenio_records_marc21>=0.21.0
|
||||||
|
|
||||||
[options.extras_require]
|
[options.extras_require]
|
||||||
tests =
|
tests =
|
||||||
invenio-app>=1.3.4,<1.4.0
|
invenio-app>=1.3.4,<1.4.0
|
||||||
|
invenio-previewer>=2.2.0
|
||||||
invenio-search[opensearch2]>=2.1.0,<3.0.0
|
invenio-search[opensearch2]>=2.1.0,<3.0.0
|
||||||
pytest-black-ng>=0.4.0
|
pytest-black-ng>=0.4.0
|
||||||
pytest-invenio>=2.1.0,<3.0.0
|
pytest-invenio>=2.1.0,<3.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user