<!--written by: Aakash Patel
# tested by: Aakash Patel
# debugged by: Aakash Patel-->

{% extends "base.html" %}

{% block title %}Virtual Stock Market - Dashboard{% endblock %}
{% block dashboardNav %}class="selectMenu"{% endblock %}

{% block content %}

<br /><h2>League Administration</h2>

<h3>League: {{league.league_name}}</h3>
<h4>Start Date: {{league.start_date|date:"m-d-Y"}} </h4>
<h4>End Date: {{league.end_date|date:"m-d-Y"}} </h4>
<h4>Start Cash: ${{league.starting_balance}} </h4>
<br />



{% if usersInLeague %}
<center>
<table border="1">
        <thead>
                <th>Username</th>
		<th>Cash Balance</th>
		<th>Current Value</th>
		<th style="width: 80px;">Kick</th>
        </thead>  
	{% for LeagueUser in usersInLeague %}
                        <tr>
                        	<td> {{LeagueUser.user_name}} </td>
				<td> {{LeagueUser.cash_balance}} </td>
				<td> {{LeagueUser.current_value}} </td>
				<td><form action="{% url league.views.kick %}" method="post">
{% csrf_token %}

<input type ="hidden" name="leagueId" value="{{league.id}} " />
<input type ="hidden" name="leagueUser" value="{{LeagueUser.id}} " />

<input type="submit"  value="Kick">

</form></td>
                        </tr>
	{% endfor %}
               
</table>
{% else %}
<span>There are no users in this league.</span>
{% endif %}
</center>

<br />

{% endblock %}

