{% extends "admin/layout.html" %}
{% load i18n %}
{% load humanize %}
{% load url from future %}
{% from "admin/macros.html" import page_title %}

{% block title %}{{ page_title(title=_('Admin Home')) }}{% endblock %}

{% block content %}
<div class="page-header">
  <h1>{% trans %}Admin Home{% endtrans %} <small>{% trans %}Misago {{version}}{% endtrans %}</small></h1>
</div>

{% if monitor.users_inactive|int > 0 %}
<div class="alert alert-info alert-form">
  <div class="alert-icon"><span><i class="icon-info-sign icon-white"></i></span></div>
  <p><a href="{% url 'admin_users_inactive' %}">{%- trans count=monitor.users_inactive|int, total=monitor.users_inactive|int|intcomma -%}
  There is one inactive user.
  {%- pluralize -%}
  There are {{ total }} inactive users.
  {%- endtrans -%}</a></p>
</div>
{% endif %}

<div class="row">
  <div class="span8">
  	
  	<h2>{% trans count=admins|length, total=admins|length|intcomma -%}
One Administrator Online
{%- pluralize -%}
{{ total }} Administrators Online
{%- endtrans %}</h2>
    <table class="table table-striped table-users list-tiny">
      <tbody>
        {% for session in admins %}    	
        <tr>
          <td>
              <a href="{% url 'user' username=session.user.username_slug, user=session.user.pk %}"><img src="{{ session.user.get_avatar(22) }}" class="avatar" alt=""> <strong>{{ session.user.username }}</strong></a>
              <div class="muted" style="float: right;">{% trans start=session.start|timesince, ip=session.ip %}started {{ start }} ago from {{ ip }}{% endtrans %} <span class="info-popover tooltip-top" title="{% trans last=session.last|timesince %}Last click was {{ last }} ago{% endtrans %}"><i class="icon-time"></i></span></div>
          </td>
        </tr>{% endfor %}
      </tbody>
    </table>
        
  </div>
  <div class="span4">
  	
  	<h3>{% trans %}Board Statistics{% endtrans %}</h3>
    <table class="table table-striped">
      <tbody>
      	<tr>
      	  <td class="span2 stat-title"><strong>{% trans %}Users{% endtrans %}</strong></td>
      	  <td>{{ users|intcomma }}</td>
      	</tr>
      	<tr>
      	  <td class="span2 stat-title"><strong>{% trans %}Posts{% endtrans %}</strong></td>
      	  <td>{{ posts|intcomma }}</td>
      	</tr>
      	<tr>
      	  <td class="span2 stat-title"><strong>{% trans %}Threads{% endtrans %}</strong></td>
      	  <td>{{ threads|intcomma }}</td>
      	</tr>
      </tbody>
    </table>
    
  </div>
</div>
{% endblock %}