{% extends "page.html" %}

{% block subtitle %}{{ _("Welcome") }}{% endblock %}

{% block maintag %}{% endblock %}

{% block content %}
  <div role="main" class="hero">
    <div id="content" class="container">
      {{ self.flash() }}
      {{ self.primary_content() }}
    </div>
  </div>
  <div class="main homepage">
    <div class="container">
      {{ self.secondary_content() }}
    </div>
  </div>
{% endblock %}

{% block primary_content %}
  <div class="hero-primary module module-popup">
    <div class="module-content box">
      {% block home_primary %}
        <header>
          {% if g.site_intro_text %}
          {{ h.render_markdown(g.site_intro_text) }}
          {% else %}
            {% block home_primary_content %}
              <h1 class="page-heading">{% block home_primary_heading %}{{ _("Welcome to CKAN") }}{% endblock %}</h1>
              <p>
              {% block home_primary_text %}
                {% trans %}This is a nice introductory paragraph about CKAN or the site
                in general. We don't have any copy to go here yet but soon we will
                {% endtrans %}
              {% endblock %}
              </p>
            {% endblock %}
          {% endif %}
        </header>
      {% endblock %}

      {% block home_image %}
        <section class="featured media-overlay">
          <h2 class="media-heading">{% block home_image_caption %}{{ _("This is a featured section") }}{% endblock %}</h2>
          {% block home_image_content %}
            <a class="media-image" href="#">
              <img src="http://placehold.it/420x220" alt="Placeholder" width="420" height="220" />
            </a>
          {% endblock %}
        </section>
      {% endblock %}
    </div>
  </div>
  <div class="hero-secondary">
    <div class="hero-secondary-inner">
      {% block home_secondary_content %}
          <div class="module module-shallow module-narrow module-dark info box">
            {% block home_search %}
              <form class="module-content search-form" method="get" action="{% url_for controller='package', action='search' %}">
                <h3 class="heading">{{ _("Search Your Data") }}</h3>
                <div class="search-input control-group search-giant">
                  <input type="text" class="search" name="q" value="{{ c.q }}" autocomplete="off" placeholder="{{ _('eg. Gold Prices') }}" />
                  <button type="submit">
                    <i class="icon-search"></i>
                    <span>{{ _('Search') }}</span>
                  </button>
                </div>
              </form>
            {% endblock %}
            {% block home_tags %}
              <div class="tags">
                <h3>{{ _('Popular Tags') }}</h3>
                {% set tags = h.get_facet_items_dict('tags', limit=3) %}
                {% for tag in tags %}
                  <a class="tag" href="{% url_for controller='package', action='search', tags=tag.name %}">{{ h.truncate(tag.display_name, 22) }}</a>
                {% endfor %}
              </div>
            {% endblock %}
          </div>
      {% endblock %}
    </div>
  </div>
{% endblock %}

{% block secondary_content %}
  <div class="row group-listing">
    {% for group in c.group_package_stuff %}
      <div class="span6">
        <div class="box">
          {% snippet 'snippets/group_item.html', group=group.group_dict, truncate=50, truncate_title=35 %}
        </div>
      </div>
    {% endfor %}
  </div>
{% endblock %}

{# Remove the toolbar. #}

{% block toolbar %}{% endblock %}
