{% extends 'staff_charges/staff_charges_base.html' %}
{% load custom_tags_and_filters %}
{% block staff_charges_content %}
	<div class="col-sm-12">
		<form action="{% url 'begin_staff_charge' %}" class="form-horizontal" method="post">
			{% csrf_token %}
			<div class="form-group">
				Customer: {{ customer }}<br>
				<input type="hidden" name="customer" value="{{ customer.id }}">
			</div>
			<div class="form-group">
				{% if customer.active_project_count == 1 %}
					Staff time will be billed to the customer's only project, &quot;{{ customer.active_projects.0 }}&quot;
					<input type="hidden" name="project" value="{{ customer.active_projects.0.id }}">
				{% else %}
					Which of the customer's projects would you like to bill?
					<div class="radio">
						{% for p in customer.active_projects %}
							<label class="control-label"><input type="radio" name="project" value="{{ p.id }}" required> {% project_selection_display p %}</label><br>
						{% endfor %}
					</div>
				{% endif %}
			</div>
			<div class="form-group">
				<input type="submit" class="btn btn-success" value="Begin billing staff time">
			</div>
		</form>
	</div>
{% endblock %}