{# # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # Invenio is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Invenio; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #} {% macro record_brief_links(record) %}{% block record_brief_links scoped %}

{%- set recID = record['recid'] -%} {%- set i = recID %} {%- set similar = "recid:%s" % recID -%} {%- if config.CFG_WEBSEARCH_USE_ALEPH_SYSNOS -%} {%- set alephsysnos = record['system_number'] -%} {%- if len(alephsysnos) > 0 -%} {%- set recID = alephsysnos[0] -%} {%- set similar = "sysno:%d" % recID -%} {%- endif -%} {%- endif -%} {% block record_brief_links_details scoped %} {{ _("Detailed record") }} - {{ _("Similar records") }} {% endblock record_brief_links_details %} {# Citations link #} {% block record_brief_links_citations scoped %} {%- if config.CFG_BIBRANK_SHOW_CITATION_LINKS -%} {%- set num_citations = record['_cited_by_count'] -%} {%- if num_citations -%} - {{ _("Cited by %(x_num)i records", x_num=num_citations) if num_citations > 1 else _("Cited by 1 record") }} {%- endif -%} {%- endif -%} {% endblock record_brief_links_citations %} {# Comments link #} {% block record_brief_links_comments scoped %} {%- if config.CFG_WEBCOMMENT_ALLOW_COMMENTS and config.CFG_WEBSEARCH_SHOW_COMMENT_COUNT -%} {%- set num_comments = record['_number_of_comments'] -%} {%- if num_comments -%} - {{ _("%(x_num)i comments", x_num=num_comments) if num_comments > 1 else _("1 comment") }} {%- endif -%} {%- endif -%} {% endblock record_brief_links_comments %} {# Reviews link #} {% block record_brief_links_reviews scoped %} {%- if config.CFG_WEBCOMMENT_ALLOW_REVIEWS and config.CFG_WEBSEARCH_SHOW_REVIEW_COUNT -%} {%- set num_reviews = record['_number_of_reviews'] -%} {%- if num_reviews -%} - {{ _("%(x_num)i reviews", x_num=num_reviews) if num_reviews > 1 else _("1 review") }} {%- endif -%} {%- endif -%} {% endblock record_brief_links_reviews %}

{% endblock record_brief_links %}{% endmacro %} {%- macro collection_tree(collections, limit=None) %} {%- set macrokwargs = kwargs %} {%- block collection_tree scoped %} {%- set idxs = [0] -%} {% endblock collection_tree %} {% endmacro %} {% macro portalbox_sidebar(portalboxes, width=2) %}{% set macrokwargs = kwargs %}{% block portalbox_sidebar scoped %} {% if portalboxes %}
{% for cp in portalboxes %}
{{ cp.portalbox.title }}

{{ cp.portalbox.body|safe }}

{% endfor %}
{% endif %} {% endblock portalbox_sidebar %}{% endmacro %} {% macro search_also(externalcollections) %}{% block search_also scoped %} {% if externalcollections %}

{{ _("Search also:") }}

{% endif %} {% endblock search_also %}{% endmacro %} {% macro _search_hidden_options() %} {%- for name in ['rg', 'of', 'so', 'sf', 'rm'] -%} {%- if request.args.get(name) -%} {%- endif -%} {%- endfor -%} {% endmacro %} {% macro _search_simple_box(collection, easy_search_form) %} {% block _search_simple_box scoped %} {% for f in easy_search_form if not f.name=='csrf_token' %}
{{ f(class_='form-control') }}
{% endfor %}
{% endblock _search_simple_box %} {% endmacro %} {% macro _search_advanced_box(collection) %} {% block _search_advanced_box scoped %}
{% for id, soo in collection.search_options|groupby('id_field') %}
{% endfor %}
{% endblock _search_advanced_box %} {% endmacro %} {% macro search_box(collection, easy_search_form) %} {% block search_box scoped %}
{% endblock search_box %} {% endmacro %} {% macro searchsettings_form(collection) %} {% block searchsettings_form scoped %}
{% if collection.rnkMETHODs|length %}
{% endif %}
{%- for (k,v,vv) in [('recent', 'rm', ''), ('cited', 'rm', 'citation'), ('relevant', 'rm', 'wrd')] -%} {%- endfor -%}
{%- for (k,v) in [(_('Simple'), 'simple'), (_('Advanced'), 'advanced')] -%} {%- set active = v=='simple' -%} {%- endfor -%}
{%- if not current_user.is_guest -%} {%- endif -%}
{% endblock searchsettings_form %}{% endmacro %} {% macro search_form_javascript(collection) %}{% block search_form_javascript %} {% endblock search_form_javascript %}{% endmacro %}