{% extends "maposmatic/base.html" %}

{% comment %}
 coding: utf-8

 maposmatic, the web front-end of the MapOSMatic city map generation system
 Copyright (C) 2012  David Decotigny
 Copyright (C) 2012  Frédéric Lehobey
 Copyright (C) 2012  Pierre Mauduit
 Copyright (C) 2012  David Mentré
 Copyright (C) 2012  Maxime Petazzoni
 Copyright (C) 2012  Thomas Petazzoni
 Copyright (C) 2012  Gaël Utard

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as
 published by the Free Software Foundation, either version 3 of the
 License, or any later version.

 This program 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 Affero General Public License for more details.

 You should have received a copy of the GNU Affero General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n %}
{% load extratags %}

{% block body-class %}home{% endblock %}
{% block menu-home %}active{% endblock %}

{% block page %}
<div class="hero-unit">
  <h1>{% trans "Welcome to MapOSMatic!" %}</h1>

  <div class="row-fluid">
    <div class="span8">
      <p>
      {% blocktrans %}MapOSMatic is a free software web service that allows you to generate maps of cities using <a href="http://www.openstreetmap.org">OpenStreetMap</a> data. The generated maps are available in PNG, PDF and SVG formats and are ready to be printed.{% endblocktrans %}
      </p>

      <p>
      {% blocktrans %}As the data used to generate maps is coming from OpenStreetMap, you can freely reuse, sell, or modify the generated maps under the <a href="http://wiki.openstreetmap.org/wiki/License">terms of the OpenStreetMap license</a>.{% endblocktrans %}
      </p>

      <p class="actions">
        <a class="btn btn-large pull-right" href="{% url about %}">{% blocktrans %}Learn more{% endblocktrans %}</a>
        <a class="btn btn-large btn-primary" href="{% url new %}">{% blocktrans %}Create a map &raquo;{% endblocktrans %}</a>
      </p>
    </div>

    <div class="span4">
      <a href="/media/pub/chavagne.pdf" class="thumbnail">
        <img data-src="holder.js/427x300" src="/media/img/chavagne-small.png"
             class="tooltipped" data-original-title="Chavagne, France" />
      </a>
    </div>
  </div>
</div>

<div class="row-fluid">
  <div class="span4 platform-status platform-status-{{ platform_status }}">
    <h2>{% trans "Platform status" %}</h2>

    {% if queued %}
    <p class="queue">
    {% blocktrans with queued|pluralize as qp %}{{ queued }} job{{ qp }} in the rendering queue.{% endblocktrans %}
    </p>
    {% endif %}

    <p>
    {% if daemon_running and gis_lag_ok %}
      {% blocktrans with gis_lastupdate|timesince:utc_now as date %}<i class="icon-white icon-ok"></i> All systems are operational. The rendering daemon is running and the GIS database was <span class="tooltipped" data-original-title="{{ gis_lastupdate }}">updated {{ date }} ago</span>.{% endblocktrans %}
    {% else %}
      {% if daemon_running and gis_lastupdate %}
      {% blocktrans %}Systems are operational but renderings may not reflect the latest available OpenStreetMap data:{% endblocktrans %}
      {% endif %}
      <ul>
        <li>
          {% if daemon_running %}
          {% blocktrans %}<i class="icon-white icon-ok"></i> The rendering daemon is running.{% endblocktrans %}
          {% else %}
          {% blocktrans %}<i class="icon-white icon-off"></i> The rendering daemon is not running: jobs will be queued until the rendering daemon is back up.{% endblocktrans %}
          {% endif %}
        </li>

        <li>
          {% if gis_lag_ok %}
          {% blocktrans with gis_lastupdate|timesince:utc_now as date %}<i class="icon-white icon-ok"></i> The GIS database is online and up to date, <span class="tooltipped" data-original-title="{{ gis_lastupdate }}">updated {{ date }} ago</span>.{% endblocktrans %}
          {% else %}
            {% if gis_lastupdate %}
            {% blocktrans with gis_lastupdate|timesince:utc_now as date %}<i class="icon-white icon-warning-sign"></i> The GIS database is not up to date and was only <span class="tooltipped" data-original-title="{{ gis_lastupdate }}">updated {{ date }} ago</span>.{% endblocktrans %}
            {% else %}
            {% blocktrans %}<i class="icon-white icon-off"></i> The GIS database is not available. Renderings cannot be processed at this time.{% endblocktrans %}
            {% endif %}
          {% endif %}
        </li>
      </ul>
    {% endif %}
    </p>
  </div>

  <div class="span4 latest-news">
    <h2>{% trans "Latest news" %}</h2>

    <ul>
      {% for entry in blogposts %}<li>
        <a href="{{ entry.link }}">{{ entry.title }}</a>
        <p class="newsinfo">
          {% blocktrans with entry.updated_parsed|feedparsed|timesince as date %}published {{ date }} ago{% endblocktrans %}
        </p>
      </li>{% endfor %}
    </ul>
  </div>

  <div class="span4">
    <h2>{% trans "Donate" %}</h2>

    <p>
      {% blocktrans %}You can donate to help us improve the service. See our <a href="/donate">donation</a> page for more information on how donations are processed and how they help us keep MapOSMatic free (and ad-free!).{% endblocktrans %}
    </p>

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <input type="hidden" name="cmd" value="_s-xclick" />
      <input type="hidden" name="hosted_button_id" value="YQPBAUM3JW8T2" />
      <input type="hidden" name="country" value="{{paypal_country_code}}" />
      <button type="submit" class="btn" name="submit" alt="PayPal — The safer, easier way to pay online.">{% trans "Donate via PayPal &raquo;" %}</button>
      <img alt="" border="0" src="https://www.paypalobjects.com/{{paypal_lang_code}}/i/scr/pixel.gif" width="1" height="1"/>
    </form>
  </div>
</div>
{% endblock %}
