{# # This file is part of Invenio. # Copyright (C) 2013, 2014, 2015, 2016 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. # # In applying this license, CERN does not # waive the privileges and immunities granted to it by virtue of its status # as an Intergovernmental Organization or submit itself to any jurisdiction. #} {%- extends config.COMMUNITIES_BASE_TEMPLATE -%} {%- block css %} {{ super() }} {% assets "invenio_communities_css" %}{% endassets %} {%- endblock css %} {%- block javascript -%} {{ super() }} {% assets "invenio_communities_js" %}{% endassets %} {%- endblock javascript -%} {% block page_body %}

{{ _("Communities") }} {{ _("created and curated by %(x_name)s users", x_name=config.CFG_SITE_NAME) }}

{%- set args = request.args.copy().to_dict() -%}
{{ form.p(class_="form-control " + form.p.short_name, placeholder='Search communities', type='text') }}

{{ _('Sort by') }}
{% if communities %} {% if featured_community and not request.args.get('p') and pagination.page == 1 %}
{{ _("Featured") }}

{{ featured_community.title }}

{{ featured_community.description|striptags }}
{% endif %}
{%- 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 "invenio_communities/mycommunities.html" %}
{% endblock page_body %}