forked from netbox-community/netbox
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes netbox-community#951: Provide a side-by-side view of rack elev…
…ations
- Loading branch information
1 parent
72ffedc
commit ecebfa9
Showing
11 changed files
with
156 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% extends '_base.html' %} | ||
{% load helpers %} | ||
|
||
{% block content %} | ||
<div class="btn-group pull-right" role="group"> | ||
<a href="{% url 'dcim:rack_elevation_list' %}{% querystring request face=0 %}" class="btn btn-default{% if request.GET.face != '1' %} active{% endif %}">Front</a> | ||
<a href="{% url 'dcim:rack_elevation_list' %}{% querystring request face=1 %}" class="btn btn-default{% if request.GET.face == '1' %} active{% endif %}">Rear</a> | ||
</div> | ||
<h1>{% block title %}Rack Elevations{% endblock %}</h1> | ||
<div class="row"> | ||
{% if page %} | ||
<div class="col-md-9"> | ||
<div style="white-space: nowrap; overflow-x: scroll;"> | ||
{% for rack in page %} | ||
<div style="display: inline-block; width: 266px"> | ||
<div class="rack_header"> | ||
<h4>{{ rack.name }}</h4> | ||
</div> | ||
{% if face_id %} | ||
{% include 'dcim/inc/rack_elevation.html' with primary_face=rack.get_rear_elevation secondary_face=rack.get_front_elevation face_id=1 %} | ||
{% else %} | ||
{% include 'dcim/inc/rack_elevation.html' with primary_face=rack.get_front_elevation secondary_face=rack.get_rear_elevation face_id=0 %} | ||
{% endif %} | ||
<div class="clearfix"></div> | ||
<div class="rack_header"> | ||
<h4>{{ rack.name }}</h4> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% include 'paginator.html' %} | ||
</div> | ||
{% else %} | ||
<div class="col-md-9"> | ||
<p>No racks found</p> | ||
</div> | ||
{% endif %} | ||
<div class="col-md-3"> | ||
{% include 'inc/search_panel.html' %} | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block javascript %} | ||
<script type="text/javascript"> | ||
$(function() { | ||
$('[data-toggle="popover"]').popover() | ||
}) | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
{% load django_tables2 %} | ||
{% load helpers %} | ||
|
||
{# Custom pagination controls to render nicely with Bootstrap CSS. smart_pages requires EnhancedPaginator. #} | ||
|
||
<div class="paginator pull-right"> | ||
{% if table.paginator.num_pages > 1 %} | ||
<div class="paginator pull-right" style="margin-top: 20px"> | ||
{% if paginator.num_pages > 1 %} | ||
<nav> | ||
<ul class="pagination pull-right"> | ||
{% if table.page.has_previous %} | ||
<li><a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}">«</a></li> | ||
{% if page.has_previous %} | ||
<li><a href="{% querystring request page=page.previous_page_number %}">«</a></li> | ||
{% endif %} | ||
{% for p in table.page.smart_pages %} | ||
{% for p in page.smart_pages %} | ||
{% if p %} | ||
<li{% ifequal table.page.number p %} class="active"{% endifequal %}><a href="{% querystring table.prefixed_page_field=p %}">{{ p }}</a></li> | ||
<li{% ifequal page.number p %} class="active"{% endifequal %}><a href="{% querystring request page=p %}">{{ p }}</a></li> | ||
{% else %} | ||
<li class="disabled"><span>…</span></li> | ||
{% endif %} | ||
{% endfor %} | ||
{% if table.page.has_next %} | ||
<li><a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}">»</a></li> | ||
{% if page.has_next %} | ||
<li><a href="{% querystring request page=page.next_page_number %}">»</a></li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% endif %} | ||
<div class="clearfix"></div> | ||
<div class="text-right text-muted"> | ||
Showing {{ table.page.start_index }}-{{ table.page.end_index }} of {{ total }} | ||
{% if total == 1 %} | ||
{{ table.data.verbose_name }} | ||
{% else %} | ||
{{ table.data.verbose_name_plural }} | ||
{% endif %} | ||
Showing {{ page.start_index }}-{{ page.end_index }} of {{ total_count }} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{% load django_tables2 %} | ||
|
||
{# Custom pagination controls to render nicely with Bootstrap CSS. smart_pages requires EnhancedPaginator. #} | ||
|
||
<div class="paginator pull-right"> | ||
{% if table.paginator.num_pages > 1 %} | ||
<nav> | ||
<ul class="pagination pull-right"> | ||
{% if table.page.has_previous %} | ||
<li><a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}">«</a></li> | ||
{% endif %} | ||
{% for p in table.page.smart_pages %} | ||
{% if p %} | ||
<li{% ifequal table.page.number p %} class="active"{% endifequal %}><a href="{% querystring table.prefixed_page_field=p %}">{{ p }}</a></li> | ||
{% else %} | ||
<li class="disabled"><span>…</span></li> | ||
{% endif %} | ||
{% endfor %} | ||
{% if table.page.has_next %} | ||
<li><a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}">»</a></li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% endif %} | ||
<div class="clearfix"></div> | ||
<div class="text-right text-muted"> | ||
Showing {{ table.page.start_index }}-{{ table.page.end_index }} of {{ total }} | ||
{% if total == 1 %} | ||
{{ table.data.verbose_name }} | ||
{% else %} | ||
{{ table.data.verbose_name_plural }} | ||
{% endif %} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters