Page MenuHomec4science

websearch_browse.html
No OneTemporary

File Metadata

Created
Sun, Dec 1, 13:44

websearch_browse.html

{#
## This file is part of Invenio.
## Copyright (C) 2013 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.
#}
{%- if request.args.of == 'id' -%}
{{ records }}
{%- else -%}
{% from "_formhelpers.html" import render_filter_form with context %}
{% from "websearch_helpers.html" import collection_tree, portalbox_sidebar, search_also, search_form, search_form_javascript, record_brief_links with context %}
{% extends "page.html" %}
{# set title = collection.name_ln if collection.id > 1 else None #}
{% set title = None %}
{%- set portalboxes = dict() -%}
{%- for k,l in collection.portalboxes_ln|groupby('position') -%}
{%- do portalboxes.update({k:l}) -%}
{%- endfor -%}
{% block title %}
{{ portalboxes.tp }}
{{ super() }}
{{ portalboxes.te }}
{% endblock %}
{% block header %}
{{ super() }}
{% js "js/websearch_typeahead.js" %}
{% js "js/websearch_facet.js" %}
{% js "js/bootstrap-select.js" %}
{% js "js/jquery.hotkeys.js" %}
{% js "js/websearch_hotkeys.js" %}
{% if records|length > 0 %}
{%- set args = request.args.copy().to_dict() -%}
{%- set jrec = (pagination.page-2)*pagination.per_page+1 if pagination.has_prev else 1 -%}
{%- do args.update({'p': records[0][0], 'f': f}) -%}
{%- if pagination.has_prev -%}
<link rel="prev" href="{{ url_for(request.endpoint, **args) }}"/>
{%- endif -%}
{%- if pagination.has_next -%}
{%- set jrec = (pagination.page)*pagination.per_page+1 if pagination.has_next else (pagination.pages-1)*pagination.per_page+1 -%}
{%- do args.update({'p': f ~ (':' if f) ~ records[-1][0]}) -%}
<link rel="next" href="{{ url_for(request.endpoint, **args) }}"/>
{%- endif -%}
{% endif %}
{% endblock %}
{% block body %}
<style>
.modal-backdrop {
/* Show lighter modal window for search. */
background-color: rgba(255,255,255,0.5);
}
body {
position: relative;
}
</style>
{{ search_form(collection) }}
{% if not records|length %}
<div class="row">
<div class="span12">
<p>
<strong>{{ _('Your search did not match any records. Please try again.') }}</strong>
</p>
{{ create_nearest_terms_box()|safe }}
</div>
</div>
{% else %}
<div class="row">
<div class="span12">
<table class="table table-striped table-hover">
<tr>
<th style="width: 20%">{{ _('Hits') }}</th>
<th>{{ _('Values') }} <small>{{ f if f }}</small></th>
</tr>
{%- set args = request.args.copy().to_dict() -%}
{%- do args.pop('action_browse', None) -%}
{%- do args.pop('f', None) -%}
{% for record in records %}
<tr>
<td>{{ record[1] }}</td>
<td>
{%- do args.update({'p': f ~ (':' if f) ~ record[0]}) -%}
<a href="{{ url_for('search.search', **args) }}">{{ record[0] }}</a>
</td>
</tr>
{% endfor %}
</table>
<ul class="pager">
<li class="previous">
{%- do args.update({'p': f ~ (':' if f) ~ records[0][0], 'action_browse': ''}) -%}
<a href="{{ url_for('search.search', **args) }}">
&larr; {{ _('Previous') }}
</a>
</li>
<li class="next">
{%- do args.update({'p': f ~ (':' if f) ~ records[-1][0], 'action_browse': ''}) -%}
<a href="{{ url_for('search.search', **args) }}">
{{ _('Next') }} &rarr;
</a>
</li>
</ul>
</div>
</div>
{%- endif -%}
{% endblock body %}
{% block javascript %}
{{ search_form_javascript(collection) }}
{% endblock %}
{%- endif -%}

Event Timeline