{# -*- coding: utf-8 -*-

  This file is part of Invenio.
  Copyright (C) 2016-2020 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 "invenio_communities/base.html" %}

{%- set title = _("Communities") -%}

{%- block javascript %}
    {{ super() }}
  {{ webpack['invenio-communities-frontpage.js'] }}
{%- endblock %}

{%- block page_body %}
<div class="ui container fluid community-header-outer">
  <div class="ui container centered grid community-header rel-pt-1">
    <div class="centered one column row">
      <h1 class="ui header">
        {{_('Communities')}}
      </h1>
    </div>
    <div class="centered two column row">
      <div class="one wide column"></div>
      <div class="six wide column">
        <p>
          {{_('Organize, curate and collaborate on records for your institution, project, topic or event.')}}
        </p>
      </div>
      <div class="three wide column center">
        <a href="{{ config.COMMUNITIES_ROUTES['new'] }}" class="ui icon left labeled positive button" role="button">
          <i class="icon plus"></i>
          {{_('New community')}}
        </a>
      </div>
    </div>
    <div class="row">
      <div class="eight wide column no-padding">
        <form action="{{ url_for('invenio_communities.communities_search') }}" class="ui form">
          <div class="ui fluid action input">
            <input type="text" name="q" class="form-control" placeholder="{{ _("Search communities") }}">
            <button type="submit" class="ui icon search button"><i class="search icon"></i></button>
          </div>
        </form>
      </div>
    </div>
    <div class="ui divider hidden"></div>
  </div>
</div>
<div class="ui container communities-frontpage rel-mt-3 rel-mb-2">
  {% if current_user.is_authenticated %}
    <h2 class="ui header">{{_('My communities')}}</h2>
    <div class="ui divider hidden"></div>
    <div id="user-communities" class="rel-mb-2"></div>
  {% endif %}
  <div class="ui divider"></div>
  <h2 class="ui header">{{_('Featured communities')}}</h2>
  <div class="ui divider hidden"></div>
  <div id="featured-communities"></div>
</div>
{%- endblock page_body %}
