{% extends "cms/admin_home.html" %}

{% load danceschool_tags thumbnail i18n %}

{% block content %}
<h1 class="text-center my-4">
	{% blocktrans with name=instructor.fullName %}
	Instructor Teaching Stats for {{ name }}
	{% endblocktrans %}
</h1>

<div class="card">
<h5 class="card-header">{% trans "Basic Info" %}</h5>
<div class="card-body">

	<img class="float-left mr-4 mb-4 mt-2" src="{% if instructor.image %}{% thumbnail instructor.image 118x118 crop %}{% endif %}" width="118" />

	<dl>
		<dt>{% trans "Teaching Since" %}:</dt><dd>{{ teaching_since }}</dd>
		<dt>{% trans "Classes Taught" %}:</dt><dd>{{ series_count }}</dd>
		<dt>{% trans "Total Students Taught" %}:</dt><dd>{{ student_count }}</dd>
		{% if instructor.feedKey %}
		<dt>{% trans "Link To Your Calendar Feeds" %}:</dt>
			<dd class="my-2">
				<a class="btn btn-outline-secondary btn-sm" href="{% url 'calendarFeed' instructor.feedKey %}">{% trans "Your Classes" %}</a>
				{% url 'privateCalendarFeed' instructor.feedKey as private_feed %}{% if private_feed %}<a class="btn btn-outline-secondary btn-sm" href="{{ private_feed }}">{% trans "Private Events &amp; Reminders" %}</a>{% endif %} ({% trans "copy and paste these URLs to add them to Google Calendar, etc." %})</dd>
		{% endif %}

	</dl>
</div>
</div>

<h3 class="mt-5 mb-3">{% trans "Upcoming Series" %}</h3>

<table class="table table-responsive">
<thead>
	<tr>
		<th>{% trans "Month" %}</th><th>{% trans "Series Name" %}</th><th>{% trans "Teaching Partner" %}</th><th>{% trans "Location" %}</th><th>{% trans "Class Time" %}</th><th>{% trans "Students Registered" %}</th>
	</tr>
</thead>
<tbody>
{% for series in upcoming_series %}
	<tr>
		<td>{{ series.month|readable_month }} {{ series.year }}</td>
		<td>{{ series.classDescription.title }}</td>
		<td>
		{% for this_instructor in series.teachers %}
			{% if this_instructor.fullName != instructor.fullName %}
				{{ this_instructor.fullName }}&nbsp;
			{% endif %}
		{% endfor %}
		</td>
		<td>{{ series.location.name }}</td>
		<td>{{ series.startTime|date:'l, h:i A' }}</td>
		<td>{{ series.numRegistered }}</td>
</tr>
{% endfor %}
</tbody>
</table>

<h3 class="mt-5 mb-3">{% trans "Prior Series" %}</h3>

<table class="table table-responsive">
<thead>
	<tr>
		<th>{% trans "Month" %}</th><th>{% trans "Series Name" %}</th><th>{% trans "Teaching Partner" %}</th><th>{% trans "Location" %}</th><th>{% trans "Class Time" %}</th><th>{% trans "Students Registered" %}</th>
	</tr>
</thead>
<tbody>
{% for series in prior_series %}
	<tr>
		<td>{{ series.month|readable_month }} {{ series.year }}</td>
		<td>{{ series.classDescription.title }}</td>
		<td>
		{% for this_instructor in series.teachers %}
			{% if this_instructor.fullName != instructor.fullName %}
				{{ this_instructor.fullName }}&nbsp;
			{% endif %}
		{% endfor %}
		</td>
		<td>{{ series.location.name }}</td>
		<td>{{ series.startTime|date:'l, h:i A' }}</td>
		<td>{{ series.numRegistered }}</td>
</tr>
{% endfor %}
</tbody>
</table>

{% endblock %}