mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			70 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% load helpers %}
 | 
						|
<tr class="rearport{% if rearport.cable %} {{ rearport.cable.get_status_class }}{% endif %}">
 | 
						|
 | 
						|
    {# Checkbox #}
 | 
						|
    {% if perms.dcim.change_rearport or perms.dcim.delete_rearport %}
 | 
						|
        <td class="pk">
 | 
						|
            <input name="pk" type="checkbox" value="{{ rearport.pk }}" />
 | 
						|
        </td>
 | 
						|
    {% endif %}
 | 
						|
 | 
						|
    {# Name #}
 | 
						|
    <td>
 | 
						|
        <i class="fa fa-fw fa-square{% if not rearport.cable %}-o{% endif %}"></i>
 | 
						|
        <a href="{{ rearport.get_absolute_url }}">{{ rearport }}</a>
 | 
						|
    </td>
 | 
						|
 | 
						|
    {# Type #}
 | 
						|
    <td>{{ rearport.get_type_display }}</td>
 | 
						|
 | 
						|
    {# Positions #}
 | 
						|
    <td>{{ rearport.positions }}</td>
 | 
						|
 | 
						|
    {# Description #}
 | 
						|
    <td>{{ rearport.description|placeholder }}</td>
 | 
						|
 | 
						|
    {# Cable #}
 | 
						|
    {% if rearport.cable %}
 | 
						|
        <td>
 | 
						|
            <a href="{{ rearport.cable.get_absolute_url }}">{{ rearport.cable }}</a>
 | 
						|
            <a href="{% url 'dcim:rearport_trace' pk=rearport.pk %}" class="btn btn-primary btn-xs" title="Trace">
 | 
						|
                <i class="fa fa-share-alt" aria-hidden="true"></i>
 | 
						|
            </a>
 | 
						|
        </td>
 | 
						|
        {% include 'dcim/inc/cabletermination.html' with termination=rearport.get_cable_peer %}
 | 
						|
    {% else %}
 | 
						|
        <td colspan="3">
 | 
						|
            <span class="text-muted">Not connected</span>
 | 
						|
        </td>
 | 
						|
    {% endif %}
 | 
						|
 | 
						|
    {# Actions #}
 | 
						|
    <td class="text-right noprint">
 | 
						|
        {% if rearport.cable %}
 | 
						|
            {% include 'dcim/inc/cable_toggle_buttons.html' with cable=rearport.cable %}
 | 
						|
        {% elif perms.dcim.add_cable %}
 | 
						|
            <span class="dropdown">
 | 
						|
                <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 | 
						|
                    <span class="glyphicon glyphicon-resize-small" aria-hidden="true"></span>
 | 
						|
                </button>
 | 
						|
                <ul class="dropdown-menu dropdown-menu-right">
 | 
						|
                    <li><a href="{% url 'dcim:rearport_connect' termination_a_id=rearport.pk termination_b_type='interface' %}?return_url={{ device.get_absolute_url }}">Interface</a></li>
 | 
						|
                    <li><a href="{% url 'dcim:rearport_connect' termination_a_id=rearport.pk termination_b_type='front-port' %}?return_url={{ device.get_absolute_url }}">Front Port</a></li>
 | 
						|
                    <li><a href="{% url 'dcim:rearport_connect' termination_a_id=rearport.pk termination_b_type='rear-port' %}?return_url={{ device.get_absolute_url }}">Rear Port</a></li>
 | 
						|
                    <li><a href="{% url 'dcim:rearport_connect' termination_a_id=rearport.pk termination_b_type='circuit-termination' %}?return_url={{ device.get_absolute_url }}">Circuit Termination</a></li>
 | 
						|
                </ul>
 | 
						|
            </span>
 | 
						|
        {% endif %}
 | 
						|
        {% if perms.dcim.change_rearport %}
 | 
						|
            <a href="{% url 'dcim:rearport_edit' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">
 | 
						|
                <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
 | 
						|
            </a>
 | 
						|
        {% endif %}
 | 
						|
        {% if perms.dcim.delete_rearport %}
 | 
						|
            <a href="{% url 'dcim:rearport_delete' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
 | 
						|
                <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
 | 
						|
            </a>
 | 
						|
        {% endif %}
 | 
						|
    </td>
 | 
						|
</tr>
 |