
{% extends "base.html" %}
{% block nav-home %}<li><a href="/">Home</a></li>{% endblock %}
          
{% block nav-subjects %}<li class="active"><a href="/subjects">My Subjects</a></li>{% endblock %}
{% block nav-search-subjects %}<li><a href="/subjects">Available Subjects</a></li>{% endblock %}
{% block nav-pending-subjects %}<li ><a href="/pending_subjects">Pending Requests</a></li>{% endblock %}
{% block body%}
<div class="container" style="margin-top:50px;">
	<div >
		<h2>My Courses</h2>
		
			<table style="width:100%;border: solid grey 1px;box-shadow: 2px 2px;" class="table table-hover">
				<thead>  
				    <tr>  
				        <th style="text-align: center;">Course ID</th>  
				        <th style="text-align: center;">Course Name</th> 
				        <th style="text-align: center;">Professor</th> 
				        <th style="text-align: center;">Action</th>
				        <!-- <th>Professor</th>   -->
				    </tr>  
			    </thead>
			    <tbody>  
			{% for sub_stud in subject_student %}
				{% if sub_stud.is_accepted %}
				    <tr>  
				        <td style="text-align: center;"><a href="/topics/{{ sub_stud.subject.sub_code }}">{{ sub_stud.subject.sub_code }} </a></td>
				        <td style="text-align: center;">{{ sub_stud.subject.sub_name }}</td>
				        <td style="text-align: center;">{{ sub_stud.subject.prof.fname }} {{ sub_stud.subject.prof.lname }}</td>
				        <td style="text-align: center;">
				        	<a href="/withdraw_subject/{{sub_stud.subject.sub_code}}">
				        		<button class="btn btn-success">Withdraw
				        		</button>
				        	</a>
				    	</td>
				    </tr>
			    {% endif %}
			{% endfor %}  
			    </tbody>  
				
			</table>
		
	</div>
	
</div>
{% endblock %}
