{# # This file is part of Invenio. # Copyright (C) 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. #} {% extends "page.html" %} {% block title %}{% endblock %} {% block global_bundles %} {{ super() }} {% bundles "communities.css" %} {% endblock %} {% block body %}

{{ _("Communities") }} {{ _("created and curated by ") + config.CFG_SITE_NAME + _(" users") }}

{%- set args = request.args.copy().to_dict() -%} {% if communities %} {% if featured_community %}
{{ _("Featured") }}

{{ featured_community.community.title }}

{{ featured_community.community.description }}

{{ _("View") }} {% if featured_community.community.id_user == current_user.id %} {{ _("Curate") }} {% endif %}

{{ _("The most recent upload:") }}

{% if featured_community.community.collection.reclist %} {%- set recid = featured_community.community.collection.reclist[-1] -%}
{{ format_record(recid, 'hb', ln=g.ln)|safe }}
{%- else %}
{{ _("This collection is currently empty.") }}
{%- endif %}
{% endif %}
{{ _('Sort by') }}

{%- for row in communities|batch(2) %}
{%- for obj in row %} {% if obj %}
{{ _('View') }} {% if obj.id_user == current_user.id %} {{ _('Curate') }} {% endif %}

{{ obj.title }}


{{ obj.description|striptags|truncate }}

Curated by: {{ obj.owner.nickname }}
{% endif %} {%- endfor %}
{%- endfor %} {% if pagination.total_count > pagination.per_page %}
    {%- set new_args = args.copy() -%} {%- do new_args.update({'page': 1}) -%} « {%- do args.update({'page': pagination.page-1 }) -%} {%- for page_p in pagination.iter_pages() %} {%- if page_p -%} {%- set new_args = args.copy() -%} {%- do new_args.update({'page': page_p}) -%} {{ page_p }} {%- else -%}
  • ...
  • {%- endif -%} {%- endfor -%} {%- set new_args = args.copy() -%} {%- do new_args.update({'page': pagination.page+1}) -%} {%- set new_args = args.copy() -%} {%- do new_args.update({'page': pagination.pages }) -%} »
{% endif %} {% else %}

{{ _('Your search did not match any communities. Please try again.') }}

{% endif %}
{% include "communities/mycommunities.html" %}
{% endblock %}