<?php
/**
 * @file
 * Main view template.
 *
 * Variables available:
 * - $classes_array: An array of classes determined in
 *   template_preprocess_views_view(). Default classes are:
 *     .view
 *     .view-[css_name]
 *     .view-id-[view_name]
 *     .view-display-id-[display_name]
 *     .view-dom-id-[dom_id]
 * - $classes: A string version of $classes_array for use in the class attribute
 * - $css_name: A css-safe version of the view name.
 * - $css_class: The user-specified classes names, if any
 * - $header: The view header
 * - $footer: The view footer
 * - $rows: The results of the view query, if any
 * - $empty: The empty text to display if the view is empty
 * - $pager: The pager next/prev links to display, if any
 * - $exposed: Exposed widget form/info to display
 * - $feed_icon: Feed icon to display, if any
 * - $more: A link to view more, if any
 *
 * @ingroup views_templates
 */
?>
<div class="<?php print $classes; ?>">
  <?php print render($title_prefix); ?>
  <?php if ($title): ?>
    <?php print $title; ?> 
  <?php endif; ?>
  <?php print render($title_suffix); ?>
  <?php global $base_url; ?>
  <div class="view-header">
      <picture>
          <source srcset="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/front/agriculture-small.png" media="(max-width: 200px)">
          <img src="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/front/agriculture.png" alt="Agriculture" />
          </source>
      </picture>
    <?php print $header; ?>
  </div>
  <?php if ($exposed): ?>
    <div class="view-filters">
      <?php print $exposed; ?>
    </div>
  <?php endif; ?>

  <?php if ($attachment_before): ?>
    <div class="attachment attachment-before">
      <?php print $attachment_before; ?>
    </div>
  <?php endif; ?>

  <?php if ($rows): ?>
    <div class="view-content">
      <?php print $rows; ?>
    </div>
  <?php elseif ($empty): ?>
    <div class="view-empty">
      <?php print $empty; ?>
    </div>
  <?php endif; ?>

  <?php if ($pager): ?>
    <?php print $pager; ?>
  <?php endif; ?>

  <?php if ($attachment_after): ?>
    <div class="attachment attachment-after">
      <?php print $attachment_after; ?>
    </div>
  <?php endif; ?>

  <?php if ($more): ?>
    <?php print $more; ?>
  <?php endif; ?>

  <div class="view-footer">
      <br>
      <h2>Success stories</h2>
      <h3>Climate projections for a Spanish wine company (Bodegas Torres)</h3>
      <picture>
          <source srcset="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/sectors/wine.jpg" media="(max-width: 600px)">
          <img class="img-success-story" src="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/sectors/wine.jpg" alt="Agriculture" />
          </source>
      </picture>

      <p class="winemaker">After request of a winemaker interested in identifying potential sites for grape plantation in the South America, we performed an analysis to identify if and where it will be possible to grow grapes in 2050. Six wine indices accounting for climate projections of temperature and precipitation were used in the assessment.</p>

      <h2>Partners and collaborators</h2>
      <picture>
          <source srcset="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/partners.png" media="(max-width: 600px)">
          <img src="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/partners.png" alt="Partners and collaborators" />
          </source>
      </picture>

      <h2>Projects</h2>
      <picture>
          <source srcset="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/projects.png" media="(max-width: 600px)">
          <img src="<?php print $base_url; ?>/sites/all/themes/ess_theme/images/projects.png" alt="Projects" />
          </source>
      </picture>

  </div>

  <?php if ($feed_icon): ?>
    <div class="feed-icon">
      <?php print $feed_icon; ?>
    </div>
  <?php endif; ?>

</div><?php /* class view */ ?>
