{% extends "exodus-template.html" %}

{% block content %}
<a href="{% url exodus.views.viewNodelist %}">Node List</a>

<div style="border:1px solid #000000;">
<h1> {{ node.name }} </h1>
<h3> Location </h3>
Description: {{ node.location.description }} <br>
Longitude: {{ node.location.longitude }} <br>
Latitude: {{ node.location.latitude }} <br>

Master ip: {{ node.masterip }} <br>
<a href="{% url exodus.views.genericNode "edit" node.name %}">EDIT</a>
<a href="{% url exodus.views.genericNode "delete" node.name %}">DELETE</a>
</div>

<h2>Interfaces</h2>
<a href="{% url exodus.views.genericInterface "add" node.name "new" %}">Add new interface</a><p />

{% for nic in node.interface_set.all %}
	<div style="border:1px solid #000000;">
	<div style="border:1px solid #000000;">
	<h3>iface: {{ nic.iface }} </h3>
	Description: {{ nic.shortdesc }} <br>
	IP: {{ nic.ip }}/{{ nic.netmask }}<br />
	Type: {% ifequal nic nic.link %}Master{% else %}Slave {% endifequal %}<br />
	
	{% ifnotequal nic.type "eth" %}
		SSID: {{ nic.ssid }} <br>
		Channel: {{ nic.channel }} <br>
		Antenna: {{ nic.antenna }} <br>
		Polar: {{ nic.polar }} <br>	
		Mode: {{ nic.mode }} <br>
	{% endifnotequal %}
	<a href="{% url exodus.views.genericInterface "edit" node.name nic.iface %}">EDIT</a>
	<a href="{% url exodus.views.genericInterface "delete" node.name nic.iface %}">DELETE</a>
	</div>

	{% for interlink in nic.link.interface_set.all %}
		{% ifnotequal interlink nic %}
		<ul>
		<li>Interlink to Node: <a href="{% url exodus.views.viewNode interlink.node %}">
			{{ interlink.node }}</a> </li>
		<li>Link Name: {{ interlink }}</li>
		<li>IP: {{ interlink.ip }}/{{ interlink.netmask }} </li>
		</ul>
		{% endifnotequal %}
	{% endfor %}
	<ol>
	</ol>
	</div>
	<p />
{% endfor %}

{% endblock %}
