
{% extends "base.html" %}
{% load static %}
{% block style-prof-subject %}<link rel="stylesheet" href="{% static 'css/prof_subjects.css' %}">{% endblock %}

{% block nav-brand %}<a class="navbar-brand" href="/prof">Coursebook</a>{% endblock %}
{% block nav-home %}<li ><a href="/prof">Home</a></li>{% endblock %}
          
{% block nav-subjects %}<li class="active"><a href="/prof/subjects">My Subjects</a></li>{% endblock %}
{% block nav-available-subjects %}{% endblock %}
{% block nav-profile %}<li><a href="/prof"><span class="glyphicon glyphicon-user"></span> {{context}}</a></li>{%endblock%}
{% block body%}
<div class="container" style="margin-top:50px;">
	<div >
		<h2>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;">Links</th>				         				          

				    </tr>  
			    </thead>
			    <tbody>  
			{% for subject in subjects %}  
			    <tr>  
			        <td style="text-align: center;"><a href="/topics/{{ subject.sub_code }}">{{ subject.sub_code }}</a></td>
			        <td style="text-align: center;">{{ subject.sub_name }}</td>
			        <td style="text-align: center;"><a href="/prof/student_list/{{ subject.sub_code }}">View Students</a></td>
			        
			    </tr>  
			{% endfor %}  
			    </tbody>  
				
			</table>

			<form action="/prof/subjects/" method="post" class="add-subject-form-container">
	  
				{% csrf_token %}
			  <div class="add-subject-form-container">
			    <div>
			    	<label for="sub_code"><b>Subject Code</b></label>
			    	{{form.sub_code}}
			    </div>	

			    <div>
			    	<label for="sub_name"><b>Subject Title</b></label>
			    	{{form.sub_name}}
			    </div>

			    <!-- <label for="sub_detail"><b>Details</b></label>
			    {{form.sub_detail}} -->
			        
			    <button type="submit" class="signup-button btn btn-success">Add Subject</button>
			    
			  </div>

	  
			</form>
		
	</div>
	
</div>
{% endblock %}
