{% extends "report/report_content.twig" %}

{% block connexions_downloads_table %}
	<div class='floatleft'>
		<table border='1' >
			<caption>{% trans "report:: Cumul telechargements & connexions" %}</caption>
			<thead>
				<tr>
					<th>{% trans "report:: telechargements" %}</th>
					<th>{% trans "report::Connexion" %}</th>
				</tr>
			</thead>
			<tbody>
				<tr>
    				<td>{{ dashboard_array.dashboard.nb_dl }}</td>
    				<td>{{ dashboard_array.dashboard.nb_conn }}</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
				</tr>
			</tfoot>
		</table>
	</div>
{% endblock %}

{% block top_ten_nb_docs %}
		{% if dashboard_array.dashboard.top_ten_user.nbdoc|length > 0 %}
			<div class='floatleft'>
				<table border='1'>
					<caption>{% trans "report:: Utilisateurs les plus actifs" %}</caption>
					<thead>
						<tr>
							<th>{% trans "report:: utilisateurs" %}</th>
							<th>{% trans "report:: telechargements document" %}</th>
						</tr>
					</thead>
					<tbody>
					{% for key, value in dashboard_array.dashboard.top_ten_user.nbdoc %}
						<tr>
							<td>{{ value.user|e }}</td>
							<td>{{ value.nbdoc }}</td>
						</tr>
					{% endfor %}
					</tbody>
					<tfoot>
						<tr>
							<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
						</tr>
					</tfoot>
				</table>
			</div>
		{% endif %}
{% endblock %}

{% block top_ten_nb_prev %}
	{% if dashboard_array.dashboard.top_ten_user.nbprev|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans "report:: Utilisateurs les plus actifs" %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: utilisateurs" %}</th>
						<th>{% trans "report:: telechargements preview" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.top_ten_user.nbprev %}
					<tr>
						<td>{{ value.user|e }}</td>
						<td>{{ value.nbprev }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block top_ten_dl_doc %}
	{% if dashboard_array.dashboard.top_dl.document|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans "report:: documents les plus telecharges" %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: document" %}</th>
						<th>{% trans "report:: telechargements" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.top_dl.document %}
					<tr>
						<td><a href="#" class="{{ key }}">{{ value.user|e }}</a></td>
						<td>{{ value.nbdoc }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block top_ten_dl_prev %}
	{% if dashboard_array.dashboard.top_dl.preview|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans "report:: preview les plus telecharges" %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: document" %}</th>
						<th>{% trans "report:: telechargements" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.top_dl.preview %}
					<tr>
						<td><a href="#" class="{{ key }}">{{ value.user|e }}</a></td>
						<td>{{ value.nbdoc }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block top_ten_site %}
	{% if dashboard_array.dashboard.top_ten_site|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans "report:: site d\'ou les photo sont les plus consultees" %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: site" %}</th>
						<th>{% trans "report:: nombre de vue" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.top_ten_site %}
					<tr>
						<td>{{ key }}</td>
						<td>{{ value }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block top_ten_weight_doc %}
	{% if dashboard_array.dashboard.top_ten_user.poiddoc|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans "report:: Utilisateurs les plus actifs" %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: utilisateurs" %}</th>
						<th>{% trans "report:: poids document" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.top_ten_user.poiddoc %}
					<tr>
						<td>{{ value.user|e }}</td>
						<td>{{ value.poiddoc|unite }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block top_ten_weight_prev %}
	{% if dashboard_array.dashboard.top_ten_user.poidprev|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans "report:: Utilisateurs les plus actifs" %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: utilisateurs" %}</th>
						<th>{% trans "report:: poids preview" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.top_ten_user.poidprev %}
					<tr>
						<td>{{ value.user|e }}</td>
						<td>{{ value.poidprev|unite }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block top_ten_asked_question %}
	{% if dashboard_array.dashboard.top_ten_question|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans %} report:: Volumetrie des questions posees sur {{home_title}} {% endtrans %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: question" %}</th>
						<th>{% trans "report:: poids preview" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.top_ten_question %}
					<tr>
						<td>{{ value.question|e }}</td>
						<td>{{ value.nb }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block top_ten_user_question %}
	{% if dashboard_array.dashboard.ask|length > 0 %}
		<div class='floatleft'>
			<table border='1'>
				<caption>{% trans "report:: Les questions les plus posees" %}</caption>
				<thead>
					<tr>
						<th>{% trans "report:: utilisateurs" %}</th>
						<th>{% trans "report:: question" %}</th>
					</tr>
				</thead>
				<tbody>
				{% for key, value in dashboard_array.dashboard.ask %}
					<tr>
						<td>{{ value.user|e }}</td>
						<td>{{ value.question|e }}</td>
					</tr>
				{% endfor %}
				</tbody>
				<tfoot>
					<tr>
						<td colspan='2'>{{ dashboard_array.dminv }} - {{ dashboard_array.dmaxv }}</td>
					</tr>
				</tfoot>
			</table>
		</div>
	{% endif %}
{% endblock %}

{% block draw_activity_hour %}
	{% if dashboard_array.dashboard.activity|length > 0 %}
		<table border='1' class="center imgdash" id = "mytablehour">
			<caption>{% trans "report:: activite par heure" %}</caption>
			<thead>
				<tr>
					<th></th>
					{% for key, value in dashboard_array.legendHour %}
						<th>{{ value }}</th>
					{% endfor %}
				</tr>
			</thead>
			<tbody>
				<tr>
					<th>{% trans "report:: Connexion" %} </th>
					{% for key, value in dashboard_array.dashboard.activity.value %}
						<td>{{ value }}</td>
					{% endfor %}
				</tr>
			</tbody>
		</table>
	{% endif %}
{% endblock %}

{% block draw_activity_day_all_base %}
	{% if dashboard_array.total|length > 0 %}
	<div class="aroundTable">
		<table class="center imgdash" id="mytabledaytotal">
			<caption>{% trans "report:: activite par jour" %} </caption>
			<thead>
				<tr>
					<th></th>
					{% for key, value in dashboard_array.legendDay %}
						<th>{{ value }}</th>
					{% endfor %}
				</tr>
			</thead>
			<tbody>
					{% if dashboard_array.total|length > 0 %}
					{% for key, value in dashboard_array.total %}
						
						<tr>
							<th>{% trans "report:: Connexion" %} </th>
							
							{% for k, v in value %}
								<td>{{ v }}</td>
							{% endfor %}
						</tr>
						
					{% endfor %}
				{% endif %}
				
			</tbody>
		</table>
		<div id="chart_detail" style="float:right; color:white; font-size:12px;"><em class="sign">+</em>{% trans "phraseanet:: details" %}</div>
	</div>
	{% endif %}
{% endblock %}

{% block select %}
	{% if dashboard_array.dashboard.activity_day|length > 0 %}
	<select id='query'>
		{% if dashboard_array.dashboard.activity_day|length > 0 %}
			{% for k, v in dashboard_array.dashboard.activity_day %}
				<option value="{{k}}">{{ k|sbas_names}}</option>
			{% endfor %}
		{% endif %}
	</select>
	{%endif %}
{%endblock%}

{% block draw_activity_day %}
		{% include "report/chart.twig" %}
{% endblock %}

{% block draw_activity_added %}
	{% if dashboard_array.dashboard.activity_added|length > 0 %}
		<table class="center imgdash" id="mytableadded">
			<caption>{% trans "report:: activite document ajoute" %}</caption>
			<thead>
				<tr>
					<th></th>
					{% for key, value in dashboard_array.legendDay %}
						<th>{{ value }}</th>
					{% endfor %}
				</tr>
			</thead>
			<tbody>
				<tr>
					<th></th>
					{% for key, value in dashboard_array.dashboard.activity_added.value %}
						<td>{{ value }}</td>
					{% endfor %}
				</tr>
			</tbody>
		</table>
	{% endif %}
{% endblock %}

{% block draw_activity_edited %}
	{% if dashboard_array.dashboard.activity_edited|length > 0 %}
		<table class="center imgdash" id="mytableedited">
			<caption>{% trans "report:: activite document edite" %}</caption>
			<thead>
				<tr>
					<th></th>
					{% for key, value in dashboard_array.legendDay %}
						<th>{{ value }}</th>
					{% endfor %}
				</tr>
			</thead>
			<tbody>
				<tr>
					<th></th>
					{% for key, value in dashboard_array.dashboard.activity_edited.value %}
						<td>{{ value }}</td>
					{% endfor %}
				</tr>
			</tbody>
		</table>
	{% endif %}
{% endblock %}