{% extends "cranefly/profiles/profile.html" %}
{% import "_forms.html" as form_theme with context %}
{% import "cranefly/macros.html" as macros with context %}

{% block title %}{{ macros.page_title(lang_member_details(), profile.username) }}{% endblock %}

{% block tab %}
<div class="user-details">
  <div class="row">
    <div class="span6">
    	
      <table class="table table-striped">
        <thead>
          <tr>
            <th colspan="2">
            	{% trans %}Account Details{% endtrans %}
            </th>
          </tr>
        </thead>
        <tbody>
          {% if acl.users.can_see_users_emails() %}
          <tr>
            <td class="span2">
               <strong>{% trans %}E-mail Address{% endtrans %}</strong>
            </td>
            <td class="span4">
              <a href="mailto:{{ profile.email }}">{{ profile.email }}</a>
            </td>
          </tr>
          {% endif %}
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Member Since{% endtrans %}</strong>
            </td>
            <td class="span4">
            	{{ profile.join_date|date }}
            </td>
          </tr>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Last Seen{% endtrans %}</strong>
            </td>
            <td class="span4">
              {% if not hidden or acl.users.can_see_hidden_users() %}
            	{{ profile.last_date|reltimesince }} <span class="muted">{{ profile.last_date|date("DATETIME_FORMAT") }}</span>
            	{% else %}
            	<em class="muted">{% trans %}Hidden{% endtrans %}</em>
            	{% endif %}
            </td>
          </tr>
        </tbody>
      </table>
    	
      <table class="table table-striped">
        <thead>
          <tr>
            <th colspan="2">
            	{% trans %}Forums Activity{% endtrans %}
            </th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Posts Written{% endtrans %}</strong>
            </td>
            <td class="span4">
            	{{ profile.posts|intcomma }}
            </td>
          </tr>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Threads Started{% endtrans %}</strong>
            </td>
            <td class="span4">
            	{{ profile.threads|intcomma }}
            </td>
          </tr>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Votes Cast{% endtrans %}</strong>
            </td>
            <td class="span4">
            	{{ profile.votes|intcomma }}
            </td>
          </tr>
        </tbody>
      </table>
      
    </div>
    <div class="span6">
    	
      <table class="table table-striped">
        <thead>
          <tr>
            <th colspan="2">
            	{% trans %}Ranking Performance{% endtrans %}
            </th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Rank{% endtrans %}</strong>
            </td>
            <td class="span4">
            	{% if profile.rank %}{{ _(profile.rank.name) }}{% else %}<em>{% trans %}Not Ranked{% endtrans %}</em>{% endif %}
            </td>
          </tr>
          {% if settings.ranking_positions_visible or settings.ranking_scores_visible %}
          <tr>
            <td class="span2">
               <strong>{% if settings.ranking_positions_visible %}{% trans %}Ranking Position{% endtrans %}{% else %}{% trans %}Score{% endtrans %}{% endif %}</strong>
            </td>
            <td class="span4">
              {% if settings.ranking_positions_visible %}
              #{{ profile.get_ranking()|intcomma }}{% if settings.ranking_scores_visible %} <span class="muted">{{ profile.score|intcomma }}</span>{% endif %}
              {% else %}{{ profile.score|intcomma }}
              {% endif %}
            </td>
          </tr>
          {% endif %}
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Karma Received{% endtrans %}</strong>
            </td>
            <td class="span4">
            	<span class="label label-success">+ {{ profile.karma_p }}</span> / <span class="label label-important">- {{ profile.karma_n }}</span></strong>
            </td>
          </tr>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Karma Given{% endtrans %}</strong>
            </td>
            <td class="span4">
            	<span class="label label-success">+ {{ profile.karma_given_p }}</span> / <span class="label label-important">- {{ profile.karma_given_n }}</span></strong>
            </td>
          </tr>
        </tbody>
      </table>
    	
      <table class="table table-striped">
        <thead>
          <tr>
            <th colspan="2">
            	{% trans %}Interactions{% endtrans %}
            </th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Followers{% endtrans %}</strong>
            </td>
            <td class="span4">
            	{{ profile.followers|intcomma }}
            </td>
          </tr>
          <tr>
            <td class="span2">
            	 <strong>{% trans %}Following{% endtrans %}</strong>
            </td>
            <td class="span4">
            	{{ profile.following|intcomma }}
            </td>
          </tr>
        </tbody>
      </table>
      
    </div>
  </div>
      
  {% if acl.users.can_see_users_trails() %}
  <hr>
  <div class="row">
    <div class="span6">

      <table class="table table-striped">
        <thead>
          <tr>
            <th colspan="2">
              {% trans %}Registration Details{% endtrans %}
            </th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="span2">
               <strong>{% trans %}IP Address{% endtrans %}</strong>
            </td>
            <td class="span4">
              {{ profile.join_ip }}
            </td>
          </tr>
          <tr>
            <td class="span2">
               <strong>{% trans %}UserAgent String{% endtrans %}</strong>
            </td>
            <td class="span4">
              {% if profile.join_agent %}{{ profile.join_agent }}{% else %}<em class="muted">{% trans %}Created from console{% endtrans %}</em>{% endif %}
            </td>
          </tr>
        </tbody>
      </table>
      
    </div>
    <div class="span6">
        
      <table class="table table-striped">
        <thead>
          <tr>
            <th colspan="2">
              {% trans %}Last Visit Details{% endtrans %}
            </th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="span2">
               <strong>{% trans %}IP Address{% endtrans %}</strong>
            </td>
            <td class="span4">
              {{ profile.last_ip }}
            </td>
          </tr>
          <tr>
            <td class="span2">
               <strong>{% trans %}UserAgent String{% endtrans %}</strong>
            </td>
            <td class="span4">
              {% if profile.last_agent %}{{ profile.last_agent }}{% else %}<em class="muted">{% trans %}Created from console{% endtrans %}</em>{% endif %}
            </td>
          </tr>
        </tbody>
      </table>
      
    </div>
  </div>
</div>
{% endif %}
{% endblock %}

{# Language strings macros #}
{% macro lang_member_details() -%}{% trans %}Member Details{% endtrans %}{%- endmacro %}