Skip to content

Commit

Permalink
Merge pull request #254 from oarepo/stojanovic/fe-282-naming-issues
Browse files Browse the repository at this point in the history
Stojanovic/fe 282 naming issues
  • Loading branch information
mirekys authored Nov 15, 2024
2 parents 718f5a6 + 55ed6c9 commit c44e104
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
26 changes: 2 additions & 24 deletions oarepo_ui/templates/components/IdentifierBadge.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,43 @@
{% set scheme = identifier.scheme %}
{% set value = identifier.identifier %}
{% set lowercaseScheme = identifier.scheme.lower() %}
{% set link = identifier.url%}
{% set badgeTitle = creatibutorName + " " + scheme + ": " + value %}

{% if lowercaseScheme == "orcid" %}
{% set link = "https://orcid.org/" + value %}
{% set badgeTitle = creatibutorName + ": " + _('ORCID profile') %}
{% set icon = "/static/images/identifiers/ORCID-iD_icon-vector.svg" %}
{% set alt = "ORCID logo" %}
{% elif lowercaseScheme == "scopusid" %}
{% set link = "https://www.scopus.com/authid/detail.uri?authorId=" + value %}
{% set badgeTitle = creatibutorName + ": " + _('Scopus ID profile') %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "ScopusID logo" %}
{% elif lowercaseScheme == "ror" %}
{% set link = "https://ror.org/" + value %}
{% set badgeTitle = creatibutorName + ": " + _('ROR profile') %}
{% set icon = "/static/images/identifiers/ror-icon-rgb.svg" %}
{% set alt = "ROR logo" %}
{% elif lowercaseScheme == "researcherid" %}
{% set link = "https://www.webofscience.com/wos/author/record/" + value %}
{% set badgeTitle = creatibutorName + ": " + _('WOS Researcher ID') %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "WOS Researcher ID logo" %}
{% elif lowercaseScheme == "isni" %}
{% set link = "https://isni.org/isni/" + value %}
{% set badgeTitle = creatibutorName + ": " + _('ISNI profile') %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "ISNI logo" %}
{% elif lowercaseScheme == "doi" %}
{% set link = "https://doi.org/" + value %}
{% set badgeTitle = creatibutorName + ": " + _('DOI profile') %}
{% set icon = "/static/images/identifiers/DOI_logo.svg" %}
{% set alt = "DOI logo" %}
{% elif lowercaseScheme == "gnd" %}
{% set link = "https://d-nb.info/gnd/" + value %}
{% set badgeTitle = creatibutorName + ": " + _('GND profile') %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "GND logo" %}
{% elif lowercaseScheme == "czenasautid" %}
{% set link = None %}
{% set badgeTitle = scheme + " " + value %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "CZENAS logo" %}
{% elif lowercaseScheme == "vedidk" %}
{% set link = None %}
{% set badgeTitle = scheme + " " + value %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "VEDIDK logo" %}
{% elif lowercaseScheme == "institutionalid" %}
{% set link = None %}
{% set badgeTitle = scheme + " " + value %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "Institutional ID logo" %}
{% elif lowercaseScheme == "ico" %}
{% set link = None %}
{% set badgeTitle = scheme + " " + value %}
{% set icon = "/static/images/identifiers/id.png" %}
{% set alt = "ICO logo" %}
{% else %}
{% set link = None %}
{% set badgeTitle = None %}
{% set icon = None %}
{% set alt = "" %}
{% endif %}
Expand Down
25 changes: 21 additions & 4 deletions oarepo_ui/templates/components/Multilingual.jinja
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
{# def data #}
{%if data%}
{% if data %}
{# issue in Jinja while setting a variable inside of the loop. namespace solves the issue #}
{% set ns = namespace(language_found=False) %}
{% for item in data %}
{% if item.lang == current_i18n.language %}
{% set ns.language_found = True %}
{% endif %}
{% endfor %}

<div class="ui multilingual-tabs">
<div class="ui compact text menu separated">
{% for item in data %}
<a class="green item {{'active' if loop.first else ''}}" data-tab="{{item|id}}-{{item.lang|e}}">{{item.lang|upper}}</a>
<a class="green item
{{ 'active' if (item.lang == current_i18n.language and ns.language_found) or
(loop.first and not ns.language_found) else '' }}"
data-tab="{{ item|id }}-{{ item.lang|e }}">
{{ item.lang|upper }}
</a>
{% if not loop.last %}
<div class="separator"><div class="vertical-bar"></div></div>
<div class="ui separated"><div class="single separator"></div></div>
{% endif %}
{% endfor %}
</div>

{% for item in data %}
<div class="ui tab {{'active' if loop.first else ''}}" data-tab="{{item|id}}-{{item.lang|e}}">
<div class="ui tab
{{ 'active' if (item.lang == current_i18n.language and ns.language_found) or
(loop.first and not ns.language_found) else '' }}"
data-tab="{{ item|id }}-{{ item.lang|e }}">
{{ item.value|safe }}
</div>
{% endfor %}
Expand Down
3 changes: 2 additions & 1 deletion oarepo_ui/templates/oarepo_ui/header_login.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

{# Desktop Quick-create ("plus") menu #}
{%- set plus_menu_items = current_menu.submenu('plus').children %}
{%- if plus_menu_items %}
{%- set visible_items = plus_menu_items | selectattr("visible") | list %}
{%- if plus_menu_items and current_menu.submenu('plus').has_visible_child() %}
<div
id="quick-create-dropdown"
class="ui dropdown pr-15 computer only create_dropdown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@
.visually-hidden {
visibility: hidden;
}

.invenio-page-body {
padding-bottom: @defaultPadding;
}

0 comments on commit c44e104

Please sign in to comment.