{% extends "cms/admin_home.html" %}
{% load crispy_forms_tags sekizai_tags i18n danceschool_tags %}

{% block content %}

<h1>{% trans "Update Staff Compensation Rules" %}</h1>

<p>{% blocktrans %}You have selected the following staff members for whom to update compensation information.  Current compensation rules for these individuals are also listed for reference.{% endblocktrans %}</p>

<div class="card">
	<div class="card-body">
		<dl>
			{% for member in staffmembers %}
				<dt>
					<a href="{% url 'admin:core_staffmember_change' member.id %}">{{ member.fullName }}</a>
				</dt>
				{% for rule in member.expenserules.all %}
					<dd>
					{% blocktrans with rate=rule.rentalRate|floatformat:"2" rateRule=rateRuleValues|get_item:rule.applyRateRule category=rule.category|default:"All Other Categories" %}
						{{ currencySymbol }}{{ rate }} {{ rateRule }} for {{ category }}
					{% endblocktrans %}
					</dd>
				{% endfor %}
			{% endfor %}
		</dl>
	</div>
</div>

<p>
{% blocktrans %}
Please select the category and rate information to be applied to all staff members listed.  If you do not specify a category,
then this compensation rule will be a "catch-all" that is applied to all work that is not otherwise covered by another compensation rule.
{% endblocktrans %}
</p>

<form action="" id="" method="post" {% if 'attachment' in form.fields %}enctype="multipart/form-data"{% endif %}>{% csrf_token %}
{{ form|crispy }}
<input type="submit" value="{% trans "Submit" %}" class="btn btn-primary">
</form>

{% addtoblock "js" %}
	{{ form.media }}
{% endaddtoblock %}
{% endblock %}