{% extends "events/page.html" %}
{% load i18n comments thumbnail %}

{% block title %}{{ event.name }}{% endblock %}
{% block description %}Veranstaltung {{ event.name }} am {{ event.start|date }}{% endblock %}


{% block opengraph %}
  <meta property="og:type" content="activity" />
  <meta property="og:title" content="{{event.name}}" />
  <meta property="og:url" content="http://www.kasu.at{{event.get_absolute_url}}" />
  <meta property="og:image" content="http://www.kasu.at{{ event.get_thumbnail.url }}" />
  {% if event.description %}<meta property="og:description" content="{{event.description|striptags}}" />{% endif %}
{% endblock %}

{% block jumbotron_background %}{{ event.get_image|thumbnail_url:'callout' }}{% endblock %}

{% block teaser %}
  <h1>{{event.name}}</h1>
  {% if event.description %}
  <div id="teaser_text">{{event.description|truncatewords_html:75|safe}}</div>
  {% endif %}
{% endblock %}

{% block redbox %}
 <h2>Info</h2>
 <p>&nbsp;</p>
 <ul class="fa-ul">
  <li><span class="fa-li fa fa-hourglass-start"></span> <strong>{% trans "Start" %}:</strong> {{ event.start }}</li>
  {% if event.end %}<li><span class="fa-li fa fa-hourglass-end"></span> <strong>{% trans "End" %}:</strong> {{ event.end }}</li>{% endif %}
  <li><span class="fa-li fa fa-map-marker"></span> <strong>{% trans "Location" %}:</strong>
   <a href="{% if event.location.url %}{{ event.location.url }}{% else %}http://maps.google.com/maps?q={{event.location.address|urlencode}}&amp;z=16{% endif %}">{{event.location.name}}</a>
  </li>
  {% if event.url %}<li><span class="fa-li fa fa-globe"></span> <strong>{% trans "Homepage" %}:</strong> <a href="{{ event.url }}">{{ event.url }}</a></li>{% endif %}
  <li><span class="fa-li fa fa-table"></span> <strong>{% trans "Hanchans" %}:</strong> <a href="{% url 'event-hanchan-list' event.pk %}" >{{ event.hanchan_set.count }}</a></li>
  <li><span class="fa-li fa fa-camera-retro"></span> <strong>{% trans 'Photos' %}:</strong> <a href="{% url 'event-photo-list' event.pk %}">{{ event.photo_count }}</a></li>
  {% if event.mahjong_tournament %}<li><span class="fa-li fa fa-trophy"></span> <strong>{% trans "tourney" %}:</strong> <a href="{% url 'event-ranking' event.pk %}">{% trans "other rules apply here" %}</a></li>{% endif%}
 </ul>
{% endblock %}

{% block navigation %}
{% if not event.is_future_event %}
<ul id="navigation">
  <li><a href="{{ event.get_absolute_url }}"><span
          class="fa fa-info-circle"></span> {% trans 'Info' %}</a></li>
  <li><a href="{% url 'event-photo-list' event.pk %}"><span
          class="fa fa-camera-retro"></span> {{ event.photo_count }}
    {% trans "Photos" %}</a></li>
  <li><a href="{% url 'event-hanchan-list' event.pk %}"><span
          class="fa fa-table"></span> {{ event.hanchan_set.count }}
    {% trans "Hanchans" %}</a></li>
  <li><a href="{% url 'maistar-game-list' event.pk %}"><span
          class="fa fa-glass"></span> {{ event.maistargame_set.count }}
    {% trans "Mai-Star Games" %}</a></li>
  {% if event.hanchan_set.count > 0 %}
  <li><a href="{% url 'event-ranking' event.id %}"><span
          class="fa fa-trophy"></span> {% trans "Event Ranking" %}</a></li>
  {% endif %}
</ul>
{% endif %}
{% endblock %}

{% block maincontent %}
<div class="grid_12">
  {% if event.description %}
  {{event.description|safe}}
  {% else %}
  {{event.location.description|safe}}
  {% endif %}
</div>
<div class="grid_6">
  <h3>{% trans 'Location' %}</h3>
  <strong>{{ event.location.name }}</strong>
  <address>
    {{event.location.street_address}}<br/>
    {{event.location.postal_code}} {{event.location.locality}} <br/>
    {{event.location.get_country_display}}
  </address>
  {% if event.location.url %}
  <p><strong>{% trans "Homepage" %}:</strong> <a
          href="{{ event.location.url }}">{{ event.location.url }}</a></p>
  {% endif %}
</div>
<div class="grid_6">
  <h3>{% trans "Date" %}</h3>
  <ul>
    <li><strong>{% trans "Start" %}:</strong> {{ event.start }}</li>
    {% if event.end %}
    <li><strong>{% trans "End" %}:</strong> {{ event.end }}</li>
    {% endif %}
    {% if event.url %}
    <li><strong>{% trans "Homepage" %}:</strong> <a href="{{ event.url }}">{{
      event.url }}</a></li>
    {% endif %}
  </ul>
</div>
<p class="grid_12 more_link">
  <a class="button" rel="nofollow" target="_blank"
     href="http://facebook.com/sharer.php?u=http%3A%2F%2Fwww.kasu.at{{event.get_absolute_url|urlencode}}">
    <span class="fa fa-facebook"></span> {% trans 'Share on Facebook'%}
  </a>
  <a class="button" rel="nofollow" target="_blank"
     href="https://plus.google.com/share?url=http%3A%2F%2Fwww.kasu.at{{event.get_absolute_url|urlencode}}">
    <span class="fa fa-google-plus"></span> {% trans 'Share on Google+'%}
  </a>
  <a class="button" rel="nofollow" target="_blank"
     href="https://twitter.com/share?url=http%3A%2F%2Fwww.kasu.at{{event.get_absolute_url|urlencode}}">
    <span class="fa fa-twitter"></span>
    {% trans 'Share on Twitter' %}
  </a>
  <a class="button" rel="nofollow" target="_blank"
     href="http://maps.google.com/maps?q={{event.location.address|urlencode}}&amp;z=16">
    <span class="fa fa-map"></span> {% trans 'Show on Google Maps' %}
  </a>
</p>
<br class="clear"/>
{% endblock %}

{% block comments %}
  {% render_comment_list for event %}
  {% render_comment_form for event %}
{% endblock %}

{% block buttonbar %}
{% if perms.events.change_event %}
<a class="button" href="{{ event.get_edit_url }}"><span
        class="fa fa-pencil"></span> {% trans "Edit Event" %}</a>
{% endif %}
{% if perms.events.add_event %}
<a class="button" href="{{ event.get_eventseries_form_url }}"><span
        class="fa fa-calendar-plus-o"></span> {% trans "Add Dates" %}</a>
{% endif %}
{% endblock %}