2016-03-01 11:23:03 -05:00
{% extends '_base.html' %}
{% load helpers %}
2018-06-14 16:15:14 -04:00
{% block header %}
< div class = "row" >
< div class = "col-sm-8 col-md-9" >
< ol class = "breadcrumb" >
< li > < a href = "{% url 'dcim:rack_list' %}" > Racks< / a > < / li >
< li > < a href = "{% url 'dcim:rack_list' %}?site={{ rack.site.slug }}" > {{ rack.site }}< / a > < / li >
< li > {{ rack }}< / li >
< / ol >
< / div >
< div class = "col-sm-4 col-md-3" >
< form action = "{% url 'dcim:rack_list' %}" method = "get" >
< div class = "input-group" >
< input type = "text" name = "q" class = "form-control" placeholder = "Search racks" / >
< span class = "input-group-btn" >
< button type = "submit" class = "btn btn-primary" >
< span class = "fa fa-search" aria-hidden = "true" > < / span >
< / button >
< / span >
< / div >
< / form >
< / div >
2016-03-01 11:23:03 -05:00
< / div >
2018-06-14 16:15:14 -04:00
< div class = "pull-right" >
< a { % if prev_rack % } href = "{% url 'dcim:rack' pk=prev_rack.pk %}" { % else % } disabled = "disabled" { % endif % } class = "btn btn-primary" >
< span class = "fa fa-chevron-left" aria-hidden = "true" > < / span > Previous Rack
< / a >
< a { % if next_rack % } href = "{% url 'dcim:rack' pk=next_rack.pk %}" { % else % } disabled = "disabled" { % endif % } class = "btn btn-primary" >
< span class = "fa fa-chevron-right" aria-hidden = "true" > < / span > Next Rack
< / a >
{% if perms.dcim.change_rack %}
< a href = "{% url 'dcim:rack_edit' pk=rack.pk %}" class = "btn btn-warning" >
< span class = "fa fa-pencil" aria-hidden = "true" > < / span > Edit this rack
< / a >
{% endif %}
{% if perms.dcim.delete_rack %}
< a href = "{% url 'dcim:rack_delete' pk=rack.pk %}" class = "btn btn-danger" >
< span class = "fa fa-trash" aria-hidden = "true" > < / span > Delete this rack
< / a >
{% endif %}
2016-03-10 11:10:21 -05:00
< / div >
2018-06-14 16:15:14 -04:00
< h1 > {% block title %}Rack {{ rack }}{% endblock %}< / h1 >
{% include 'inc/created_updated.html' with obj=rack %}
< ul class = "nav nav-tabs" >
< li role = "presentation" { % if not active_tab % } class = "active" { % endif % } >
< a href = "{{ rack.get_absolute_url }}" > Rack< / a >
< / li >
< li role = "presentation" { % if active_tab = = ' changelog ' % } class = "active" { % endif % } >
< a href = "{% url 'dcim:rack_changelog' pk=rack.pk %}" > Changelog< / a >
< / li >
< / ul >
{% endblock %}
{% block content %}
2016-03-01 11:23:03 -05:00
< div class = "row" >
< div class = "col-md-6" >
< div class = "panel panel-default" >
< div class = "panel-heading" >
2016-06-22 10:57:32 -04:00
< strong > Rack< / strong >
2016-03-01 11:23:03 -05:00
< / div >
2016-12-14 17:09:33 -05:00
< table class = "table table-hover panel-body attr-table" >
2016-03-01 11:23:03 -05:00
< tr >
< td > Site< / td >
< td >
2017-02-28 16:10:53 -05:00
{% if rack.site.region %}
< a href = "{{ rack.site.region.get_absolute_url }}" > {{ rack.site.region }}< / a >
< i class = "fa fa-angle-right" > < / i >
{% endif %}
2016-03-01 11:23:03 -05:00
< a href = "{% url 'dcim:site' slug=rack.site.slug %}" > {{ rack.site }}< / a >
< / td >
< / tr >
< tr >
< td > Group< / td >
< td >
2016-03-01 15:13:45 -05:00
{% if rack.group %}
2017-11-02 08:51:27 -07:00
< a href = "{% url 'dcim:rack_list' %}?site={{ rack.site.slug }}&group={{ rack.group.slug }}" > {{ rack.group }}< / a >
2016-03-01 15:13:45 -05:00
{% else %}
< span class = "text-muted" > None< / span >
{% endif %}
2016-03-01 11:23:03 -05:00
< / td >
< / tr >
< tr >
< td > Facility ID< / td >
2018-11-05 13:00:46 -05:00
< td > {{ rack.facility_id|placeholder }}< / td >
2016-03-01 11:23:03 -05:00
< / tr >
2016-07-26 16:46:22 -04:00
< tr >
< td > Tenant< / td >
< td >
{% if rack.tenant %}
2017-02-28 16:10:53 -05:00
{% if rack.tenant.group %}
2017-11-02 08:51:27 -07:00
< a href = "{{ rack.tenant.group.get_absolute_url }}" > {{ rack.tenant.group }}< / a >
2017-02-28 16:10:53 -05:00
< i class = "fa fa-angle-right" > < / i >
{% endif %}
2016-07-26 16:46:22 -04:00
< a href = "{{ rack.tenant.get_absolute_url }}" > {{ rack.tenant }}< / a >
{% else %}
< span class = "text-muted" > None< / span >
{% endif %}
2016-08-10 22:20:09 -04:00
< / td >
< / tr >
2018-11-01 16:03:42 -04:00
< tr >
< td > Status< / td >
< td >
{{ rack.get_status_display }}
< / td >
< / tr >
2016-08-10 22:20:09 -04:00
< tr >
< td > Role< / td >
< td >
{% if rack.role %}
< a href = "{{ rack.role.get_absolute_url }}" > {{ rack.role }}< / a >
{% else %}
< span class = "text-muted" > None< / span >
{% endif %}
2016-07-26 16:46:22 -04:00
< / td >
< / tr >
2017-10-09 15:01:57 -04:00
< tr >
< td > Serial Number< / td >
2018-11-05 13:00:46 -05:00
< td > {{ rack.serial|placeholder }}< / td >
2017-10-09 15:01:57 -04:00
< / tr >
2018-11-02 09:17:51 -04:00
< tr >
< td > Asset Tag< / td >
2018-11-05 13:00:46 -05:00
< td > {{ rack.asset_tag|placeholder }}< / td >
2018-11-02 09:17:51 -04:00
< / tr >
2017-10-09 15:01:57 -04:00
< tr >
< td > Devices< / td >
< td >
< a href = "{% url 'dcim:device_list' %}?rack_id={{ rack.id }}" > {{ rack.devices.count }}< / a >
< / td >
< / tr >
< / table >
< / div >
< div class = "panel panel-default" >
< div class = "panel-heading" >
< strong > Dimensions< / strong >
< / div >
< table class = "table table-hover panel-body attr-table" >
2016-08-08 18:01:15 -04:00
< tr >
< td > Type< / td >
< td >
{% if rack.type %}
{{ rack.get_type_display }}
{% else %}
< span class = "text-muted" > None< / span >
{% endif %}
< / td >
< / tr >
< tr >
< td > Width< / td >
< td > {{ rack.get_width_display }}< / td >
< / tr >
2016-03-01 11:23:03 -05:00
< tr >
< td > Height< / td >
2016-10-28 11:30:40 -04:00
< td > {{ rack.u_height }}U ({% if rack.desc_units %}descending{% else %}ascending{% endif %})< / td >
2016-03-01 11:23:03 -05:00
< / tr >
2018-11-02 09:51:17 -04:00
< tr >
< td > Outer Width< / td >
< td >
{% if rack.outer_width %}
2018-12-03 11:13:37 -05:00
< span > {{ rack.outer_width }} {{ rack.get_outer_unit_display }}< / span >
2018-11-02 09:51:17 -04:00
{% else %}
< span class = "text-muted" > — < / span >
{% endif %}
< / td >
< / tr >
< tr >
< td > Outer Depth< / td >
< td >
{% if rack.outer_depth %}
2018-12-03 11:13:37 -05:00
< span > {{ rack.outer_depth }} {{ rack.get_outer_unit_display }}< / span >
2018-11-02 09:51:17 -04:00
{% else %}
< span class = "text-muted" > — < / span >
{% endif %}
< / td >
< / tr >
2016-03-01 11:23:03 -05:00
< / table >
< / div >
2018-07-20 19:56:04 -04:00
{% include 'inc/custom_fields_panel.html' with obj=rack %}
2018-07-10 10:48:33 -04:00
{% include 'extras/inc/tags_panel.html' with tags=rack.tags.all url='dcim:rack_list' %}
< div class = "panel panel-default" >
< div class = "panel-heading" >
< strong > Comments< / strong >
< / div >
2018-11-13 11:02:48 -05:00
< div class = "panel-body rendered-markdown" >
2018-07-10 10:48:33 -04:00
{% if rack.comments %}
{{ rack.comments|gfm }}
{% else %}
< span class = "text-muted" > None< / span >
{% endif %}
< / div >
< / div >
2016-03-01 11:23:03 -05:00
< div class = "panel panel-default" >
< div class = "panel-heading" >
< strong > Non-Racked Devices< / strong >
< / div >
{% if nonracked_devices %}
< table class = "table table-hover panel-body" >
2016-07-01 17:12:43 -04:00
< tr >
< th > Name< / th >
< th > Role< / th >
< th > Type< / th >
< th > Parent< / th >
< / tr >
2016-03-01 11:23:03 -05:00
{% for device in nonracked_devices %}
< tr { % if device . device_type . u_height % } class = "warning" { % endif % } >
< td >
2017-11-02 08:51:27 -07:00
< a href = "{% url 'dcim:device' pk=device.pk %}" > {{ device }}< / a >
2016-03-01 11:23:03 -05:00
< / td >
< td > {{ device.device_role }}< / td >
2019-02-06 10:23:30 -05:00
< td > {{ device.device_type.display_name }}< / td >
2016-12-08 09:59:21 -05:00
< td >
{% if device.parent_bay %}
< a href = "{{ device.parent_bay.device.get_absolute_url }}" > {{ device.parent_bay }}< / a >
{% else %}
2018-11-05 13:00:46 -05:00
< span class = "text-muted" > — < / span >
2016-12-08 09:59:21 -05:00
{% endif %}
< / td >
2016-03-01 11:23:03 -05:00
< / tr >
{% endfor %}
< / table >
{% else %}
< div class = "panel-body text-muted" > None< / div >
{% endif %}
{% if perms.dcim.add_device %}
< div class = "panel-footer text-right" >
< a href = "{% url 'dcim:device_add' %}?site={{ rack.site.pk }}&rack={{ rack.pk }}" class = "btn btn-primary btn-xs" >
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
Add a non-racked device
< / a >
< / div >
{% endif %}
< / div >
2017-03-30 21:55:57 -04:00
< div class = "panel panel-default" >
< div class = "panel-heading" >
< strong > Images< / strong >
< / div >
2017-03-31 15:19:44 -04:00
{% include 'inc/image_attachments.html' with images=rack.images.all %}
2017-03-30 21:55:57 -04:00
{% if perms.extras.add_imageattachment %}
< div class = "panel-footer text-right" >
< a href = "{% url 'dcim:rack_add_image' object_id=rack.pk %}" class = "btn btn-primary btn-xs" >
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
Attach an image
< / a >
< / div >
{% endif %}
< / div >
2017-02-16 13:46:58 -05:00
< div class = "panel panel-default" >
< div class = "panel-heading" >
< strong > Reservations< / strong >
< / div >
{% if reservations %}
< table class = "table table-hover panel-body" >
< tr >
< th > Units< / th >
2017-11-15 12:54:49 -06:00
< th > Tenant< / th >
2017-02-16 13:46:58 -05:00
< th > Description< / th >
< th > < / th >
< / tr >
{% for resv in reservations %}
< tr >
2017-04-06 16:26:48 -04:00
< td > {{ resv.unit_list }}< / td >
2017-11-15 14:06:58 -05:00
< td >
{% if resv.tenant %}
< a href = "{{ resv.tenant.get_absolute_url }}" > {{ resv.tenant }}< / a >
{% else %}
< span class = "text-muted" > None< / span >
{% endif %}
< / td >
2017-02-16 13:46:58 -05:00
< td >
{{ resv.description }}< br / >
< small > {{ resv.user }} · {{ resv.created }}< / small >
< / td >
< td class = "text-right" >
2017-03-29 12:15:14 -04:00
{% if perms.dcim.change_rackreservation %}
2017-02-16 13:46:58 -05:00
< a href = "{% url 'dcim:rackreservation_edit' pk=resv.pk %}" class = "btn btn-warning btn-xs" title = "Edit reservation" >
< i class = "glyphicon glyphicon-pencil" aria-hidden = "true" > < / i >
< / a >
{% endif %}
2017-03-29 12:15:14 -04:00
{% if perms.dcim.delete_rackreservation %}
2017-02-16 13:46:58 -05:00
< a href = "{% url 'dcim:rackreservation_delete' pk=resv.pk %}" class = "btn btn-danger btn-xs" title = "Delete reservation" >
< i class = "glyphicon glyphicon-trash" aria-hidden = "true" > < / i >
< / a >
{% endif %}
< / td >
< / tr >
{% endfor %}
< / table >
{% else %}
< div class = "panel-body text-muted" > None< / div >
{% endif %}
{% if perms.dcim.add_rackreservation %}
< div class = "panel-footer text-right" >
< a href = "{% url 'dcim:rack_add_reservation' rack=rack.pk %}" class = "btn btn-primary btn-xs" >
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
Add a reservation
< / a >
< / div >
{% endif %}
< / div >
2016-03-01 11:23:03 -05:00
< / div >
2016-07-08 06:17:08 -07:00
< div class = "row col-md-6" >
< div class = "col-md-6 col-sm-6 col-xs-12" >
< div class = "rack_header" >
2016-03-01 11:23:03 -05:00
< h4 > Front< / h4 >
2016-07-08 06:17:08 -07:00
< / div >
2017-08-02 13:33:44 -04:00
{% include 'dcim/inc/rack_elevation.html' with primary_face=front_elevation secondary_face=rear_elevation face_id=0 reserved_units=rack.get_reserved_units %}
2016-07-08 06:17:08 -07:00
< / div >
< div class = "col-md-6 col-sm-6 col-xs-12" >
2016-03-01 11:23:03 -05:00
< div class = "rack_header" >
< h4 > Rear< / h4 >
< / div >
2017-08-02 13:33:44 -04:00
{% include 'dcim/inc/rack_elevation.html' with primary_face=rear_elevation secondary_face=front_elevation face_id=1 reserved_units=rack.get_reserved_units %}
2016-07-08 06:17:08 -07:00
< / div >
2016-03-01 11:23:03 -05:00
< / div >
< / div >
{% endblock %}
{% block javascript %}
< script type = "text/javascript" >
$(function() {
$('[data-toggle="popover"]').popover()
})
< / script >
{% endblock %}