Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contributions: improve display on detailed view #2246

Merged
merged 1 commit into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 42,7 @@ <h4 class="card-title mb-0">
</div>
<div class="col-10">
<dl class="row">
{% with data=record[agency], source_name='agency' %}
{% with data=record[agency], source_name='agency', source=agency %}
{% include('rero_ils/_contribution_by_source_data.html') %}
{% endwith %}
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 34,7 @@
{% if data.country_associated %}
{{ dl(_('Associated country'), data.country_associated|translat('country_')) }}
{% endif %}
{{ dl_permalink_by_source(_('ID'), data) }}
{{ dl_permalink_by_source(_('ID'), data, source) }}
{{ dl(_('Authorized access point'), data.authorized_access_point) }}
{{ dl(_('Variant access point'), data.variant_access_point) }}
{{ dl(_('Parallel access point'), data.parallel_access_point) }}
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 69,10 @@ <h1 class="mb-0">{{ record | contribution_label(current_i18n.language) }}</h1>
<header class="mb-2">
<h3>{{ _('Documents') }}</h3>
</header>
<ul class="list-group">
<ul class="list-unstyled">
{% for document in record.documents %}
<li class="list-group-item border-0">
<a class="font-weight-bold" href="{{ url_for('invenio_records_ui.doc', viewcode=viewcode, pid_value=document.pid) }}">{{ document.title | create_title_text }}</a>
<li>
<a href="{{ url_for('invenio_records_ui.doc', viewcode=viewcode, pid_value=document.pid) }}">{{ document.title | create_title_text }}</a>
</li>
{% endfor %}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 19,10 @@

{% macro dl(name, value, prefix) %}
{% if value %}
<dt class="col-md-3 col-lg-2 rero-ils-term">
<dt class="col-md-3 col-lg-3 rero-ils-term">
{{ name }}:
</dt>
<dd class="col-md-9 col-lg-10">
<dd class="col-md-9 col-lg-9">
{% if value is string %}
{% if prefix %}
{{ _(prefix.format(v=value)) }}
Expand Down Expand Up @@ -51,25 51,29 @@

{% macro dl_bool(name, value) %}
{% if value %}
<dt class="col-md-3 col-lg-2 rero-ils-term">
<dt class="col-md-3 col-lg-3 rero-ils-term">
{{ name }}:
</dt>
<dd class="col-md-9 col-lg-10">
<dd class="col-md-9 col-lg-9">
<i class="fa fa-check fa-lg"></i>
</dd>
{% endif %}
{% endmacro %}

{% macro dl_permalink(name, record) %}
<dt class="col-md-3 col-lg-2 rero-ils-term">
<dt class="col-md-3 col-lg-3 rero-ils-term">
{{ _(name) }}:
</dt>
<dd class="col-md-9 col-lg-10">
<dd class="col-md-9 col-lg-9">
<ul class="list-unstyled rero-ils-contribution">
{% for source in config.RERO_ILS_CONTRIBUTIONS_SOURCES %}
{% if record[source] %}
<li>
<a class="rero-ils-external-link" href="{{ record[source].identifier }}">{{ record[source].pid }}</a>
{% if source != 'rero' %}
<a href="{{ record[source].identifier }}">{{ record[source].pid }}</a>
{% else %}
{{ record[source].pid }}
{% endif %}
<small class="badge badge-secondary text-uppercase">{{ source }}</small>
</li>
{% endif %}
Expand All @@ -78,13 82,17 @@
</dd>
{% endmacro %}

{% macro dl_permalink_by_source(name, data) %}
{% macro dl_permalink_by_source(name, data, source) %}
{% if data.pid %}
<dt class="col-md-3 col-lg-2 rero-ils-term">
<dt class="col-md-3 col-lg-3 rero-ils-term">
{{ _(name) }}:
</dt>
<dd class="col-md-9 col-lg-10">
<a class="rero-ils-external-link" href="{{ data.identifier }}">{{ data.pid }}</a>
<dd class="col-md-9 col-lg-9">
{% if source != 'rero' %}
<a href="{{ data.identifier }}">{{ data.pid }}</a>
{% else %}
{{ data.pid }}
{% endif %}
</dd>
{% endif %}
{% endmacro %}