{# -*- coding: utf-8 -*- This file is part of Invenio. Copyright (C) 2015-2019 CERN. Invenio is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. #} {%- 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.THEME_SITENAME) }}

{%- 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.profile.username }}
{% 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 %}