{% extends "layout.html" %}
{% macro field(name) -%}
<dt>{{ name|capitalize }}</dt>
{%- endmacro %}
{% block page_title -%}
{% trans project_name=project.name -%}
<small>Project:</small> {{ project_name }}
{%- endtrans %}
{%- endblock %}
{% block page_header %}
    {{ super() }}
    <a class="btn btn-success btn-small pull-right" style="margin: 10px 10px 0;" href="{{ url_for('.edit_project', projectid=project_row.id) }}"><i class="icon-edit icon-white"></i> {{ _("Edit") }}</a>
{% endblock %}
{% block body %}
  <div class="row-fluid">
    <div class="pull-right">
{%- if project.logoURL %}
      <a href="{{ project.website }}"><img alt="{{ project.name }}" src="{{ project.logoURL }}" style="max-width: 300px; margin: 30px 30px 0;" /></a>
{%- endif %}
    </div>
    <div class="span6 offset1">
      <dl class="dl-horizontal">
        {{ field(_("name")) }}
          <dd>{{ project.name }}</dd>
        {%- if project.shortname %}
        {{ field(_("short name")) }}
          <dd>{{ project.shortname }}</dd>
        {%- endif %}
        {%- if project.description %}
        {{ field(_("description")) }}
          <dd>{{ project.description }}</dd>
        {%- endif %}
        {%- if project.coveredAreas %}
        {{ field(_("covered areas")) }}
          {% for a in project.coveredAreas -%}
          <dd>{{ a.name }} ({{ a.technologies|join(',') }})</dd>
          {%- endfor -%}
        {%- endif %}
        {%- if project.website %}
        {{ field(_("website")) }}
          <dd><a href="{{ project.website }}">{{ project.website }}</a></dd>
        {%- endif %}
        {%- if project.otherWebsites %}
        {{ field(_("other websites")) }}
          {% for n, w in project.otherWebsites.iteritems() -%}
          <dd>{{ n }}: <a href="{{ w }}">{{ w }}</a></dd>
          {%- endfor -%}
        {%- endif %}
        {%- if project.email %}
        {{ field(_("email")) }}
          <dd>{% if project.email %}<a href="mailto:{{ project.email }}"><i class="icon-envelope"></i> {{ project.email }}</a>{% else %}<em>None given</em>{% endif %}</dd>
        {%- endif %}
        {%- if project.mainMailingList %}
        {{ field(_("main mailing list")) }}
          <dd>{% if project.mainMailingList %}<a href="mailto:{{ project.mainMailingList }}"><i class="icon-envelope"></i> {{ project.mainMailingList }}</a>{% else %}<em>None given</em>{% endif %}</dd>
        {%- endif %}
        {%- if project.progressStatus %}
        {{ field(_("step")) }}
          <dd>{{ project.progressStatus|step_to_label|safe }}</dd>
        {%- endif %}
        {%- if project_row.is_ffdn_member %}
        <dt>{{ _("FFDN Member") }}</dt>
          <dd>
          {%- if project.ffdnMemberSince -%}
            {% trans date=project_row.str2date(project.ffdnMemberSince)|dateformat('medium') %}Yes, since {{ date }}{% endtrans %}
          {%- else -%}
            {{ _("Yes") }}
          {%- endif -%}
          </dd>
        {%- endif %}
        {%- if project.memberCount %}
        {{ field(_("members")) }}
          <dd>{{ project.memberCount }}</dd>
        {%- endif %}
        {%- if project.subscriberCount %}
        {{ field(_("subscribers")) }}
          <dd>{{ project.subscriberCount }}</dd>
        {%- endif %}
        {%- if project.chatrooms %}
        {{ field(_("chatrooms")) }}
          {% for c in project.chatrooms -%}
          <dd><code>{{ c }}</code></dd>
          {%- endfor -%}
        {%- endif %}
        {%- if project.coordinates %}
        {{ field(_("coordinates")) }}
          <dd><code style="color: #666;">{{ project.coordinates.latitude }},{{ project.coordinates.longitude }}</code></dd>
        {%- endif %}
      </dl>
    </div>
  </div>
{%- endblock %}
