1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #13102: Establish initial translation support in templates

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Arthur Hanson
2023-07-29 03:30:25 +07:00
committed by GitHub
parent cf1b1a83eb
commit 7c17d2e932
257 changed files with 2056 additions and 1762 deletions

View File

@@ -1,9 +1,10 @@
{% extends 'base/40x.html' %}
{% load i18n %}
{% block title %}Access Denied{% endblock %}
{% block title %}{% trans "Access Denied" %}{% endblock %}
{% block icon %}<i class="mdi mdi-lock"></i>{% endblock %}
{% block message %}
You do not have permission to access this page.
{% trans "You do not have permission to access this page" %}.
{% endblock %}

View File

@@ -1,9 +1,10 @@
{% extends 'base/40x.html' %}
{% load i18n %}
{% block title %}Page Not Found{% endblock %}
{% block title %}{% trans "Page Not Found" %}{% endblock %}
{% block icon %}<i class="mdi mdi-alert"></i>{% endblock %}
{% block message %}
The requested page does not exist.
{% trans "The requested page does not exist" %}.
{% endblock %}

View File

@@ -1,9 +1,10 @@
{% load i18n %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Server Error</title>
<title>{% trans "Server Error" %}</title>
<link rel="stylesheet" href="{% static 'netbox-light.css'%}" />
<meta charset="UTF-8">
</head>
@@ -14,28 +15,28 @@
<div class="col col-md-6 offset-md-3">
<div class="card border-danger mt-5">
<h5 class="card-header">
<i class="mdi mdi-alert"></i> Server Error
<i class="mdi mdi-alert"></i> {% trans "Server Error" %}
</h5>
<div class="card-body">
{% block message %}
<p>
There was a problem with your request. Please contact an administrator.
{% trans "There was a problem with your request. Please contact an administrator" %}.
</p>
{% endblock %}
<hr />
<p>
The complete exception is provided below:
{% trans "The complete exception is provided below" %}:
</p>
<pre class="block"><strong>{{ exception }}</strong><br />
{{ error }}
Python version: {{ python_version }}
NetBox version: {{ netbox_version }}</pre>
{% trans "Python version" %}: {{ python_version }}
{% trans "NetBox version" %}: {{ netbox_version }}</pre>
<p>
If further assistance is required, please post to the <a href="https://github.com/netbox-community/netbox/discussions">NetBox discussion forum</a> on GitHub.
{% trans "If further assistance is required, please post to the" %} <a href="https://github.com/netbox-community/netbox/discussions">{% trans "NetBox discussion forum" %}</a> {% trans "on GitHub" %}.
</p>
<div class="text-end">
<a href="{% url 'home' %}" class="btn btn-primary">Home Page</a>
<a href="{% url 'home' %}" class="btn btn-primary">{% trans "Home Page" %}</a>
</div>
</div>
</div>

View File

@@ -1,4 +1,5 @@
{% extends "admin/index.html" %}
{% load i18n %}
{% block content_title %}{% endblock %}
@@ -6,16 +7,16 @@
{{ block.super }}
<div class="module">
<table style="width: 100%">
<caption>System</caption>
<caption>{% trans "System" %}</caption>
<tbody>
<tr>
<th>
<a href="{% url 'rq_home' %}">Background Tasks</a>
<a href="{% url 'rq_home' %}">{% trans "Background Tasks" %}</a>
</th>
</tr>
<tr>
<th>
<a href="{% url 'plugins_list' %}">Installed plugins</a>
<a href="{% url 'plugins_list' %}">{% trans "Installed plugins" %}</a>
</th>
</tr>
</tbody>

View File

@@ -1,4 +1,5 @@
{% extends 'base/layout.html' %}
{% load i18n %}
{% block title %}{% endblock %}
@@ -13,7 +14,7 @@
{% block message %}{% endblock %}
</div>
<div class="card-footer text-end">
<a href="{% url 'home' %}" class="btn btn-sm btn-primary">Home Page</a>
<a href="{% url 'home' %}" class="btn btn-sm btn-primary">{% trans "Home Page" %}</a>
</div>
</div>
</div>

View File

@@ -1,6 +1,7 @@
{# Base template for (almost) all NetBox pages #}
{% load static %}
{% load helpers %}
{% load i18n %}
<!DOCTYPE html>
<html
lang="en"
@@ -24,7 +25,7 @@
/>
{# Page title #}
<title>{% block title %}Home{% endblock %} | NetBox</title>
<title>{% block title %}{% trans "Home" %}{% endblock %} | NetBox</title>
<script
type="text/javascript"

View File

@@ -2,6 +2,7 @@
{% extends 'base/base.html' %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% comment %}
Blocks:
@@ -23,7 +24,7 @@ Blocks:
{# NetBox Logo, only visible when printing #}
<div class="p-2 printonly">
<img src="{% static 'netbox_logo.svg' %}" alt="NetBox logo" width="200px" />
<img src="{% static 'netbox_logo.svg' %}" alt="{% trans "NetBox logo" %}" width="200px" />
</div>
{# Top bar #}
@@ -33,7 +34,7 @@ Blocks:
<div class="nav-mobile">
<div class="nav-mobile-top">
<a class="sidebar-logo p-2 d-block" href="{% url 'home' %}">
<img src="{% static 'netbox_logo.svg' %}" alt="NetBox logo" height="40" />
<img src="{% static 'netbox_logo.svg' %}" alt="{% trans "NetBox logo" %}" height="40" />
</a>
<button type="button" aria-label="Toggle Navigation" class="navbar-toggler sidenav-toggle-mobile">
<span class="navbar-toggler-icon"></span>
@@ -72,14 +73,14 @@ Blocks:
{% if settings.DEBUG and not settings.DEVELOPER %}
<div class="alert alert-warning text-center mx-3" role="alert">
<strong><i class="mdi mdi-alert"></i> Debug mode is enabled.</strong>
Performance may be limited. Debugging should never be enabled on a production system.
<strong><i class="mdi mdi-alert"></i> {% trans "Debug mode is enabled" %}.</strong>
{% trans "Performance may be limited. Debugging should never be enabled on a production system" %}.
</div>
{% endif %}
{% if config.MAINTENANCE_MODE and config.BANNER_MAINTENANCE %}
<div class="alert alert-warning text-center mx-3" role="alert">
<h5><i class="mdi mdi-alert"></i> Maintenance Mode</h5>
<h5><i class="mdi mdi-alert"></i> {% trans "Maintenance Mode" %}</h5>
{{ config.BANNER_MAINTENANCE|escape }}
</div>
{% endif %}
@@ -130,34 +131,34 @@ Blocks:
{% block footer_links %}
{# Documentation #}
<a type="button" class="nav-link" href="{% static 'docs/' %}" target="_blank">
<i title="Docs" class="mdi mdi-book-open-variant text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
<i title="{% trans "Docs" %}" class="mdi mdi-book-open-variant text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# REST API #}
<a type="button" class="nav-link" href="{% url 'api-root' %}" target="_blank">
<i title="REST API" class="mdi mdi-cloud-braces text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
<i title="{% trans "REST API" %}" class="mdi mdi-cloud-braces text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# API docs #}
<a type="button" class="nav-link" href="{% url 'api_docs' %}" target="_blank">
<i title="REST API documentation" class="mdi mdi-book text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
<i title="{% trans "REST API documentation" %}" class="mdi mdi-book text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# GraphQL API #}
{% if config.GRAPHQL_ENABLED %}
<a type="button" class="nav-link" href="{% url 'graphql' %}" target="_blank">
<i title="GraphQL API" class="mdi mdi-graphql text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
<i title="{% trans "GraphQL API" %}" class="mdi mdi-graphql text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{% endif %}
{# GitHub #}
<a type="button" class="nav-link" href="https://github.com/netbox-community/netbox" target="_blank">
<i title="Source Code" class="mdi mdi-github text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
<i title="{% trans "Source Code" %}" class="mdi mdi-github text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{# NetDev Slack #}
<a type="button" class="nav-link" href="https://netdev.chat/" target="_blank">
<i title="Community" class="mdi mdi-slack text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
<i title="{% trans "Community" %}" class="mdi mdi-slack text-primary" data-bs-placement="top" data-bs-toggle="tooltip"></i>
</a>
{% endblock footer_links %}
</nav>
@@ -165,7 +166,7 @@ Blocks:
<div class="col-sm-12 col-md-auto text-center text-lg-end text-muted">
<span class="d-block d-md-inline">{% annotated_now %} {% now 'T' %}</span>
<span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} (v{{ settings.VERSION }})</span>
<span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} ("v"{{ settings.VERSION }})</span>
</div>
</div>

View File

@@ -1,5 +1,6 @@
{% load navigation %}
{% load static %}
{% load i18n %}
<nav class="sidenav noprint" id="sidenav" data-simplebar>
<div class="sidenav-header">
@@ -8,12 +9,12 @@
{# Full Logo #}
<a class="sidenav-brand" href="{% url 'home' %}">
<img src="{% static 'netbox_logo.svg' %}" height="48" class="sidenav-brand-img" alt="NetBox Logo">
<img src="{% static 'netbox_logo.svg' %}" height="48" class="sidenav-brand-img" alt="{% trans "NetBox Logo" %}">
</a>
{# Icon Logo #}
<a class="sidenav-brand-icon" href="{% url 'home' %}">
<img src="{% static 'netbox_icon.svg' %}" height="32" class="sidenav-brand-img" alt="NetBox Logo">
<img src="{% static 'netbox_icon.svg' %}" height="32" class="sidenav-brand-img" alt="{% trans "NetBox Logo" %}">
</a>
{# Pin/Unpin Toggle #}

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -11,31 +12,31 @@
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Circuit</h5>
<h5 class="card-header">{% trans "Circuit" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Provider</th>
<th scope="row">{% trans "Provider" %}</th>
<td>{{ object.provider|linkify }}</td>
</tr>
<tr>
<th scope="row">Account</th>
<th scope="row">{% trans "Account" %}</th>
<td>{{ object.provider_account|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Circuit ID</th>
<th scope="row">{% trans "Circuit ID" %}</th>
<td>{{ object.cid }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.type|linkify }}</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -44,19 +45,19 @@
</td>
</tr>
<tr>
<th scope="row">Install Date</th>
<th scope="row">{% trans "Install Date" %}</th>
<td>{{ object.install_date|annotated_date|placeholder }}</td>
</tr>
<tr>
<th scope="row">Termination Date</th>
<th scope="row">{% trans "Termination Date" %}</th>
<td>{{ object.termination_date|annotated_date|placeholder }}</td>
</tr>
<tr>
<th scope="row">Commit Rate</th>
<th scope="row">{% trans "Commit Rate" %}</th>
<td>{{ object.commit_rate|humanize_speed|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>

View File

@@ -1,12 +1,13 @@
{% extends 'generic/confirmation_form.html' %}
{% load i18n %}
{% block title %}Swap Circuit Terminations{% endblock %}
{% block title %}{% trans "Swap Circuit Terminations" %}{% endblock %}
{% block message %}
<p>Swap these terminations for circuit {{ circuit }}?</p>
<p>{% blocktrans %}Swap these terminations for circuit {{ circuit }}?{% endblocktrans %}</p>
<ul>
<li>
<strong>A side:</strong>
<strong>{% trans "A side" %}:</strong>
{% if termination_a %}
{{ termination_a.site }} {% if termination_a.interface %}- {{ termination_a.interface.device }} {{ termination_a.interface }}{% endif %}
{% else %}
@@ -14,7 +15,7 @@
{% endif %}
</li>
<li>
<strong>Z side:</strong>
<strong>{% trans "Z side" %}:</strong>
{% if termination_z %}
{{ termination_z.site }} {% if termination_z.interface %}- {{ termination_z.interface.device }} {{ termination_z.interface }}{% endif %}
{% else %}

View File

@@ -1,11 +1,12 @@
{% extends 'generic/object_edit.html' %}
{% load static %}
{% load form_helpers %}
{% load i18n %}
{% block form %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Circuit Termination</h5>
<h5 class="offset-sm-3">{% trans "Circuit Termination" %}</h5>
</div>
{% render_field form.circuit %}
{% render_field form.term_side %}
@@ -16,10 +17,10 @@
<div class="offset-sm-3">
<ul class="nav nav-pills" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link{% if not providernetwork_tab_active %} active{% endif %}" role="tab" type="button" data-bs-target="#site" data-bs-toggle="tab">Site</button>
<button class="nav-link{% if not providernetwork_tab_active %} active{% endif %}" role="tab" type="button" data-bs-target="#site" data-bs-toggle="tab">{% trans "Site" %}</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link{% if providernetwork_tab_active %} active{% endif %}" role="tab" type="button" data-bs-toggle="tab" data-bs-target="#providernetwork">Provider Network</button>
<button class="nav-link{% if providernetwork_tab_active %} active{% endif %}" role="tab" type="button" data-bs-toggle="tab" data-bs-target="#providernetwork">{% trans "Provider Network" %}</button>
</li>
</ul>
</div>
@@ -37,7 +38,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Termination Details</h5>
<h5 class="offset-sm-3">{% trans "Termination Details" %}</h5>
</div>
{% render_field form.port_speed %}
{% render_field form.upstream_speed %}
@@ -49,7 +50,7 @@
{% if form.custom_fields %}
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
<h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5>
</div>
{% render_custom_fields form %}
</div>

View File

@@ -2,11 +2,12 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block extra_controls %}
{% if perms.circuits.add_circuit %}
<a href="{% url 'circuits:circuit_add' %}?type={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Circuit
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Circuit" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -16,16 +17,16 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Circuit Type
{% trans "Circuit Type" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>

View File

@@ -1,35 +1,36 @@
{% load helpers %}
{% load i18n %}
<div class="card">
<div class="card-header">
<div class="float-md-end">
{% if not termination and perms.circuits.add_circuittermination %}
<a href="{% url 'circuits:circuittermination_add' %}?circuit={{ object.pk }}&term_side={{ side }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-success lh-1">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add" %}
</a>
{% endif %}
{% if termination and perms.circuits.change_circuittermination %}
<a href="{% url 'circuits:circuittermination_edit' pk=termination.pk %}?return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-warning lh-1">
<span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
<span class="mdi mdi-pencil" aria-hidden="true"></span> {% trans "Edit" %}
</a>
<a href="{% url 'circuits:circuit_terminations_swap' pk=object.pk %}?return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-primary lh-1">
<span class="mdi mdi-swap-vertical" aria-hidden="true"></span> Swap
<span class="mdi mdi-swap-vertical" aria-hidden="true"></span> {% trans "Swap" %}
</a>
{% endif %}
{% if termination and perms.circuits.delete_circuittermination %}
<a href="{% url 'circuits:circuittermination_delete' pk=termination.pk %}?return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-danger lh-1">
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> {% trans "Delete" %}
</a>
{% endif %}
</div>
<h5>Termination {{ side }}</h5>
<h5>{% blocktrans %}Termination {{ side }}{% endblocktrans %}</h5>
</div>
<div class="card-body">
{% if termination %}
<table class="table table-hover attr-table">
{% if termination.site %}
<tr>
<td>Site</td>
<td>{% trans "Site" %}</td>
<td>
{% if termination.site.region %}
{{ termination.site.region|linkify }} /
@@ -38,13 +39,13 @@
</td>
</tr>
<tr>
<td>Termination</td>
<td>{% trans "Termination" %}</td>
<td>
{% if termination.mark_connected %}
<span class="text-success"><i class="mdi mdi-check-bold"></i></span>
<span class="text-muted">Marked as connected</span>
<span class="text-muted">{% trans "Marked as connected" %}</span>
{% elif termination.cable %}
<a class="d-block d-md-inline" href="{{ termination.cable.get_absolute_url }}">{{ termination.cable }}</a> to
<a class="d-block d-md-inline" href="{{ termination.cable.get_absolute_url }}">{{ termination.cable }}</a> {% trans "to" %}
{% for peer in termination.link_peers %}
{% if peer.device %}
{{ peer.device|linkify }}<br/>
@@ -54,30 +55,30 @@
{{ peer|linkify }}{% if not forloop.last %},{% endif %}
{% endfor %}
<div class="mt-1">
<a href="{% url 'circuits:circuittermination_trace' pk=termination.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i> Trace
<a href="{% url 'circuits:circuittermination_trace' pk=termination.pk %}" class="btn btn-primary btn-sm lh-1" title="{% trans "Trace" %}">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i> {% trans "Trace" %}
</a>
{% if perms.dcim.change_cable %}
<a href="{% url 'dcim:cable_edit' pk=termination.cable.pk %}?return_url={{ termination.circuit.get_absolute_url }}" title="Edit cable" class="btn btn-warning btn-sm">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Edit
<a href="{% url 'dcim:cable_edit' pk=termination.cable.pk %}?return_url={{ termination.circuit.get_absolute_url }}" title="{% trans "Edit cable" %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> {% trans "Edit" %}
</a>
{% endif %}
{% if perms.dcim.delete_cable %}
<a href="{% url 'dcim:cable_delete' pk=termination.cable.pk %}?return_url={{ termination.circuit.get_absolute_url }}" title="Remove cable" class="btn btn-danger btn-sm lh-1">
<i class="mdi mdi-ethernet-cable-off" aria-hidden="true"></i> Disconnect
<a href="{% url 'dcim:cable_delete' pk=termination.cable.pk %}?return_url={{ termination.circuit.get_absolute_url }}" title="{% trans "Remove cable" %}" class="btn btn-danger btn-sm lh-1">
<i class="mdi mdi-ethernet-cable-off" aria-hidden="true"></i> {% trans "Disconnect" %}
</a>
{% endif %}
</div>
{% elif perms.dcim.add_cable %}
<div class="dropdown">
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> {% trans "Connect" %}
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}">Interface</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}">Front Port</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}">Rear Port</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}">Circuit Termination</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}">{% trans "Interface" %}</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}">{% trans "Front Port" %}</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}">{% trans "Rear Port" %}</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=circuits.circuittermination&a_terminations={{ termination.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}">{% trans "Circuit Termination" %}</a></li>
</ul>
</div>
{% endif %}
@@ -85,16 +86,16 @@
</tr>
{% else %}
<tr>
<td>Provider Network</td>
<td>{% trans "Provider Network" %}</td>
<td>{{ termination.provider_network.provider|linkify }} / {{ termination.provider_network|linkify }}</td>
</tr>
{% endif %}
<tr>
<td>Speed</td>
<td>{% trans "Speed" %}</td>
<td>
{% if termination.port_speed and termination.upstream_speed %}
<i class="mdi mdi-arrow-down-bold" title="Downstream"></i> {{ termination.port_speed|humanize_speed }} &nbsp;
<i class="mdi mdi-arrow-up-bold" title="Upstream"></i> {{ termination.upstream_speed|humanize_speed }}
<i class="mdi mdi-arrow-down-bold" title="{% trans "Downstream" %}"></i> {{ termination.port_speed|humanize_speed }} &nbsp;
<i class="mdi mdi-arrow-up-bold" title="{% trans "Upstream" %}"></i> {{ termination.upstream_speed|humanize_speed }}
{% elif termination.port_speed %}
{{ termination.port_speed|humanize_speed }}
{% else %}
@@ -103,19 +104,19 @@
</td>
</tr>
<tr>
<td>Cross-Connect</td>
<td>{% trans "Cross-Connect" %}</td>
<td>{{ termination.xconnect_id|placeholder }}</td>
</tr>
<tr>
<td>Patch Panel/Port</td>
<td>{% trans "Patch Panel/Port" %}</td>
<td>{{ termination.pp_info|placeholder }}</td>
</tr>
<tr>
<td>Description</td>
<td>{% trans "Description" %}</td>
<td>{{ termination.description|placeholder }}</td>
</tr>
<tr>
<td>Tags</td>
<td>{% trans "Tags" %}</td>
<td>
{% for tag in termination.tags.all %}
{% tag tag %}
@@ -150,7 +151,7 @@
{% endfor %}
</table>
{% else %}
<span class="text-muted">None</span>
<span class="text-muted">{% trans "None" %}</span>
{% endif %}
</div>
</div>

View File

@@ -3,11 +3,12 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block extra_controls %}
{% if perms.circuits.add_circuit %}
<a href="{% url 'circuits:circuit_add' %}?provider={{ object.pk }}" class="btn btn-sm btn-primary">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add circuit
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add circuit" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -16,11 +17,11 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Provider</h5>
<h5 class="card-header">{% trans "Provider" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">ASNs</th>
<th scope="row">{% trans "ASNs" %}</th>
<td>
{% for asn in object.asns.all %}
{{ asn|linkify }}{% if not forloop.last %}, {% endif %}
@@ -30,7 +31,7 @@
</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -49,7 +50,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Provider Accounts</h5>
<h5 class="card-header">{% trans "Provider Accounts" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'circuits:provideraccount_list' %}?provider_id={{ object.pk }}"
hx-trigger="load"
@@ -57,7 +58,7 @@
</div>
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Circuits</h5>
<h5 class="card-header">{% trans "Circuits" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'circuits:circuit_list' %}?provider_id={{ object.pk }}"
hx-trigger="load"

View File

@@ -3,6 +3,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,19 +14,19 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Provider Account</h5>
<h5 class="card-header">{% trans "Provider Account" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Provider</th>
<th scope="row">{% trans "Provider" %}</th>
<td>{{ object.provider|linkify }}</td>
</tr>
<tr>
<th scope="row">Account</th>
<th scope="row">{% trans "Account" %}</th>
<td>{{ object.account }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name|placeholder }}</td>
</tr>
</table>
@@ -42,7 +43,7 @@
</div>
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Circuits</h5>
<h5 class="card-header">{% trans "Circuits" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'circuits:circuit_list' %}?provider_account_id={{ object.pk }}"
hx-trigger="load"

View File

@@ -3,6 +3,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,24 +15,24 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Provider Network
{% trans "Provider Network" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Provider</th>
<th scope="row">{% trans "Provider" %}</th>
<td>{{ object.provider|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Service ID</th>
<th scope="row">{% trans "Service ID" %}</th>
<td>{{ object.service_id|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -50,7 +51,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Circuits</h5>
<h5 class="card-header">{% trans "Circuits" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'circuits:circuit_list' %}?provider_network_id={{ object.pk }}"
hx-trigger="load"

View File

@@ -4,6 +4,7 @@
{% load helpers %}
{% load perms %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -28,30 +29,30 @@
<div class="row mb-3">
<div class="col">
<div class="card">
<h5 class="card-header">Data File</h5>
<h5 class="card-header">{% trans "Data File" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Source</th>
<th scope="row">{% trans "Source" %}</th>
<td>{{ object.source|linkify }}</td>
</tr>
<tr>
<th scope="row">Path</th>
<th scope="row">{% trans "Path" %}</th>
<td>
<span class="font-monospace" id="datafile_path">{{ object.path }}</span>
{% copy_content "datafile_path" %}
</td>
</tr>
<tr>
<th scope="row">Last Updated</th>
<th scope="row">{% trans "Last Updated" %}</th>
<td>{{ object.last_updated }}</td>
</tr>
<tr>
<th scope="row">Size</th>
<td>{{ object.size }} byte{{ object.size|pluralize }}</td>
<th scope="row">{% trans "Size" %}</th>
<td>{{ object.size }} {% trans "bytes" %}</td>
</tr>
<tr>
<th scope="row">SHA256 Hash</th>
<th scope="row">{% trans "SHA256 Hash" %}</th>
<td>
<span class="font-monospace" id="datafile_hash">{{ object.hash }}</span>
{% copy_content "datafile_hash" %}
@@ -61,7 +62,7 @@
</div>
</div>
<div class="card">
<h5 class="card-header">Content</h5>
<h5 class="card-header">{% trans "Content" %}</h5>
<div class="card-body">
<pre>{{ object.data_as_string }}</pre>
</div>

View File

@@ -3,6 +3,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block extra_controls %}
{% if perms.core.sync_datasource %}
@@ -10,13 +11,13 @@
<form action="{% url 'core:datasource_sync' pk=object.pk %}" method="post">
{% csrf_token %}
<button type="submit" class="btn btn-sm btn-primary">
<i class="mdi mdi-sync" aria-hidden="true"></i> Sync
<i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}
</button>
</form>
{% else %}
<span class="inline-block" tabindex="0" data-bs-toggle="tooltip" data-bs-delay="100" data-bs-placement="bottom">
<button class="btn btn-sm btn-primary" disabled>
<i class="mdi mdi-sync" aria-hidden="true"></i> Sync
<i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}
</button>
</span>
{% endif %}
@@ -27,35 +28,35 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Data Source</h5>
<h5 class="card-header">{% trans "Data Source" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">Enabled</th>
<th scope="row">{% trans "Enabled" %}</th>
<td>{% checkmark object.enabled %}</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Last synced</th>
<th scope="row">{% trans "Last synced" %}</th>
<td>{{ object.last_synced|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">URL</th>
<th scope="row">{% trans "URL" %}</th>
<td>
{% if not object.is_local %}
<a href="{{ object.source_url }}">{{ object.source_url }}</a>
@@ -65,7 +66,7 @@
</td>
</tr>
<tr>
<th scope="row">Ignore rules</th>
<th scope="row">{% trans "Ignore rules" %}</th>
<td>
{% if object.ignore_rules %}
<pre>{{ object.ignore_rules }}</pre>
@@ -82,7 +83,7 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Backend</h5>
<h5 class="card-header">{% trans "Backend" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
{% for name, field in object.get_backend.parameters.items %}
@@ -97,7 +98,7 @@
{% empty %}
<tr>
<td colspan="2" class="text-muted">
No parameters defined
{% trans "No parameters defined" %}
</td>
</tr>
{% endfor %}
@@ -112,7 +113,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Files</h5>
<h5 class="card-header">{% trans "Files" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'core:datafile_list' %}?source_id={{ object.pk }}"
hx-trigger="load"

View File

@@ -2,6 +2,7 @@
{% load buttons %}
{% load helpers %}
{% load perms %}
{% load i18n %}
{% block controls %}
<div class="controls">
@@ -17,25 +18,25 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Job</h5>
<h5 class="card-header">{% trans "Job" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Object Type</th>
<th scope="row">{% trans "Object Type" %}</th>
<td>
<a href="{% url 'core:job_list' %}?object_type={{ object.object_type_id }}">{{ object.object_type }}</a>
</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name|placeholder }}</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Created By</th>
<th scope="row">{% trans "Created By" %}</th>
<td>{{ object.user|placeholder }}</td>
</tr>
</table>
@@ -44,23 +45,23 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Scheduling</h5>
<h5 class="card-header">{% trans "Scheduling" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Created</th>
<th scope="row">{% trans "Created" %}</th>
<td>{{ object.created|annotated_date }}</td>
</tr>
<tr>
<th scope="row">Scheduled</th>
<td>{{ object.scheduled|annotated_date|placeholder }}{% if object.interval %} (every {{ object.interval }} seconds){% endif %}</td>
<th scope="row">{% trans "Scheduled" %}</th>
<td>{{ object.scheduled|annotated_date|placeholder }}{% if object.interval %} ({% blocktrans %}every {{ object.interval }} seconds{% endblocktrans %}){% endif %}</td>
</tr>
<tr>
<th scope="row">Started</th>
<th scope="row">{% trans "Started" %}</th>
<td>{{ object.started|annotated_date|placeholder }}</td>
</tr>
<tr>
<th scope="row">Completed</th>
<th scope="row">{% trans "Completed" %}</th>
<td>{{ object.completed|annotated_date|placeholder }}</td>
</tr>
</table>
@@ -71,7 +72,7 @@
<div class="row">
<div class="col col-12">
<div class="card">
<h5 class="card-header">Data</h5>
<h5 class="card-header">{% trans "Data" %}</h5>
<div class="card-body">
<pre>{{ object.data|json }}</pre>
</div>

View File

@@ -1,10 +1,11 @@
{% extends 'generic/confirmation_form.html' %}
{% load helpers %}
{% load i18n %}
{% block title %}Disconnect {{ obj_type_plural|bettertitle }}{% endblock %}
{% block title %}{% trans "Disconnect" %} {{ obj_type_plural|bettertitle }}{% endblock %}
{% block message %}
<p>Are you sure you want to disconnect these {{ selected_objects|length }} {{ obj_type_plural }}?</p>
<p>{% blocktrans %}Are you sure you want to disconnect these {{ selected_objects|length }} {{ obj_type_plural }}?{% endblocktrans %}</p>
<ul>
{% for obj in selected_objects %}
<li>{{ obj }}</li>

View File

@@ -3,24 +3,25 @@
{% load helpers %}
{% load perms %}
{% load plugins %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Cable</h5>
<h5 class="card-header">{% trans "Cable" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -29,15 +30,15 @@
</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Color</th>
<th scope="row">{% trans "Color" %}</th>
<td>
{% if object.color %}
<span class="color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
@@ -47,7 +48,7 @@
</td>
</tr>
<tr>
<th scope="row">Length</th>
<th scope="row">{% trans "Length" %}</th>
<td>
{% if object.length %}
{{ object.length|floatformat }} {{ object.get_length_unit_display }}
@@ -66,13 +67,13 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Termination A</h5>
<h5 class="card-header">{% trans "Termination" %} A</h5>
<div class="card-body">
{% include 'dcim/inc/cable_termination.html' with terminations=object.a_terminations %}
</div>
</div>
<div class="card">
<h5 class="card-header">Termination B</h5>
<h5 class="card-header">{% trans "Termination" %} B</h5>
<div class="card-body">
{% include 'dcim/inc/cable_termination.html' with terminations=object.b_terminations %}
</div>

View File

@@ -2,13 +2,14 @@
{% load static %}
{% load helpers %}
{% load form_helpers %}
{% load i18n %}
{% block form %}
{# A side termination #}
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">A Side</h5>
<h5 class="offset-sm-3">{% trans "A Side" %}</h5>
</div>
{% if 'termination_a_device' in form.fields %}
{% render_field form.termination_a_device %}
@@ -25,7 +26,7 @@
{# B side termination #}
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">B Side</h5>
<h5 class="offset-sm-3">{% trans "B Side" %}</h5>
</div>
{% if 'termination_b_device' in form.fields %}
{% render_field form.termination_b_device %}
@@ -42,7 +43,7 @@
{# Cable attributes #}
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Cable</h5>
<h5 class="offset-sm-3">{% trans "Cable" %}</h5>
</div>
{% render_field form.status %}
{% render_field form.type %}
@@ -64,7 +65,7 @@
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
<h5 class="offset-sm-3">{% trans "Tenancy" %}</h5>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
@@ -73,7 +74,7 @@
{% if form.custom_fields %}
<div class="field-group mb-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
<h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5>
</div>
{% render_custom_fields form %}
</div>
@@ -81,7 +82,7 @@
{% if form.comments %}
<div class="field-group mb-5">
<h5 class="text-center">Comments</h5>
<h5 class="text-center">{% trans "Comments" %}</h5>
{% render_field form.comments %}
</div>
{% endif %}

View File

@@ -1,7 +1,8 @@
{% extends 'base/layout.html' %}
{% load helpers %}
{% load i18n %}
{% block title %}Cable Trace for {{ object|meta:"verbose_name"|bettertitle }} {{ object }}{% endblock %}
{% block title %}{% blocktrans %}Cable Trace for {{ object|meta:"verbose_name"|bettertitle }} {{ object }}{% endblocktrans %}{% endblock %}
{% block content %}
<div class="row">
@@ -13,21 +14,21 @@
<object data="{{ svg_url }}" class="rack_elevation"></object>
<div>
<a class="btn btn-outline-primary btn-sm my-3" href="{{ svg_url }}">
<i class="mdi mdi-file-download"></i> Download SVG
<i class="mdi mdi-file-download"></i> {% trans "Download SVG" %}
</a>
</div>
</div>
<div class="trace-end">
{% if path.is_split %}
<h3 class="text-danger">Path split!</h3>
<p>Select a node below to continue:</p>
<h3 class="text-danger">{% trans "Path split" %}!</h3>
<p>{% trans "Select a node below to continue" %}:</p>
<ul class="text-start">
{% for next_node in path.get_split_nodes %}
{% if next_node.cable %}
{% with viewname=next_node|viewname:"trace" %}
<li>
<a href="{% url viewname pk=next_node.pk %}">{{ next_node|meta:"verbose_name"|bettertitle }} {{ next_node }}</a>
(Cable {{ next_node.cable|linkify }})
({% trans "Cable" %} {{ next_node.cable|linkify }})
</li>
{% endwith %}
{% else %}
@@ -36,20 +37,20 @@
{% endfor %}
</ul>
{% else %}
<h3 class="text-center text-success">Trace Completed</h3>
<h3 class="text-center text-success">{% trans "Trace Completed" %}</h3>
<table class="table">
<tr>
<th scope="row">Total segments</th>
<th scope="row">{% trans "Total segments" %}</th>
<td>{{ path.segment_count }}</td>
</tr>
<tr>
<th scope="row">Total length</th>
<th scope="row">{% trans "Total length" %}</th>
<td>
{% if total_length %}
{{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} Meters /
{{ total_length|meters_to_feet|floatformat:"-2" }} Feet
{{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} {% trans "Meters" %} /
{{ total_length|meters_to_feet|floatformat:"-2" }} {% trans "Feet" %}
{% else %}
<span class="text-muted">N/A</span>
<span class="text-muted">{% trans "N/A" %}</span>
{% endif %}
</td>
</tr>
@@ -58,7 +59,7 @@
</div>
{% else %}
<h3 class="text-center text-muted my-3">
No paths found
{% trans "No paths found" %}
</h3>
{% endif %}
</div>
@@ -67,15 +68,15 @@
<div class="col col-md-7">
<div class="card">
<h5 class="card-header">
Related Paths
{% trans "Related Paths" %}
</h5>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th>Origin</th>
<th>Destination</th>
<th>Segments</th>
<th>{% trans "Origin" %}</th>
<th>{% trans "Destination" %}</th>
<th>{% trans "Segments" %}</th>
</tr>
</thead>
<tbody>
@@ -88,7 +89,7 @@
{% if cablepath.destinations %}
{{ cablepath.destinations|join:", " }}
{% else %}
<span class="text-muted">Incomplete</span>
<span class="text-muted">{% trans "Incomplete" %}</span>
{% endif %}
</td>
<td>
@@ -97,7 +98,7 @@
</tr>
{% empty %}
<td colspan="3" class="text-muted">
None found
{% trans "None found" %}
</td>
{% endfor %}
</tbody>

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,36 +15,36 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Console Port
{% trans "Console Port" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ object.module|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">Speed</th>
<th scope="row">{% trans "Speed" %}</th>
<td>{{ object.get_speed_display }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -55,29 +56,29 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Connection</h5>
<h5 class="card-header">{% trans "Connection" %}</h5>
<div class="card-body">
{% if object.mark_connected %}
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as connected" %}
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' with trace_url='dcim:consoleport_trace' %}
{% else %}
<div class="text-muted">
Not Connected
{% trans "Not Connected" %}
{% if perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> {% trans "Connect" %}
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleserverport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Console Server Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleserverport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Console Server Port" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Front Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Front Port" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Rear Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Rear Port" %}</a>
</li>
</ul>
</div>

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Delete console port {{ consoleport }}?{% endblock %}
{% block title %}{% blocktrans %}Delete console port {{ consoleport }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to delete this console port from <strong>{{ consoleport.device }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to delete this console port from <strong>{{ consoleport.device }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,36 +15,36 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Console Server Port
{% trans "Console Server Port" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ object.module|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Speed</th>
<th scope="row">{% trans "Speed" %}</th>
<td>{{ object.get_speed_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -55,29 +56,29 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Connection</h5>
<h5 class="card-header">{% trans "Connection" %}</h5>
<div class="card-body">
{% if object.mark_connected %}
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as connected" %}
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' with trace_url='dcim:consoleserverport_trace' %}
{% else %}
<div class="text-muted">
Not Connected
{% trans "Not Connected" %}
{% if perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> {% trans "Connect" %}
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Console Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Console Port" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Front Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Front Port" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Rear Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.consoleserverport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Rear Port" %}</a>
</li>
</ul>
</div>

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Delete console server port {{ consoleserverport }}?{% endblock %}
{% block title %}{% blocktrans %}Delete console server port {{ consoleserverport }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to delete this console server port from <strong>{{ consoleserverport.device }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to delete this console server port from <strong>{{ consoleserverport.device }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -4,16 +4,17 @@
{% load static %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col col-12 col-xl-6">
<div class="card">
<h5 class="card-header">Device</h5>
<h5 class="card-header">{% trans "Device" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Region</th>
<th scope="row">{% trans "Region" %}</th>
<td>
{% if object.site.region %}
{% for region in object.site.region.get_ancestors %}
@@ -26,11 +27,11 @@
</td>
</tr>
<tr>
<th scope="row">Site</th>
<th scope="row">{% trans "Site" %}</th>
<td>{{ object.site|linkify }}</td>
</tr>
<tr>
<th scope="row">Location</th>
<th scope="row">{% trans "Location" %}</th>
<td>
{% if object.location %}
{% for location in object.location.get_ancestors %}
@@ -43,12 +44,12 @@
</td>
</tr>
<tr>
<th scope="row">Rack</th>
<th scope="row">{% trans "Rack" %}</th>
<td class="position-relative">
{% if object.rack %}
{{ object.rack|linkify }}
<div class="position-absolute top-50 end-0 translate-middle-y noprint">
<a href="{{ object.rack.get_absolute_url }}?device={{ object.pk }}" class="btn btn-primary btn-sm" title="Highlight device">
<a href="{{ object.rack.get_absolute_url }}?device={{ object.pk }}" class="btn btn-primary btn-sm" title="{% trans "Highlight device" %}">
<i class="mdi mdi-view-day-outline"></i>
</a>
</div>
@@ -58,7 +59,7 @@
</td>
</tr>
<tr>
<th scope="row">Position</th>
<th scope="row">{% trans "Position" %}</th>
<td>
{% if object.parent_bay %}
{% with object.parent_bay.device as parent %}
@@ -70,20 +71,20 @@
{% elif object.rack and object.position %}
<span>U{{ object.position|floatformat }} / {{ object.get_face_display }}</span>
{% elif object.rack and object.device_type.u_height %}
<span class="badge bg-warning">Not racked</span>
<span class="badge bg-warning">{% trans "Not racked" %}</span>
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">GPS Coordinates</th>
<th scope="row">{% trans "GPS Coordinates" %}</th>
<td class="position-relative">
{% if object.latitude and object.longitude %}
{% if config.MAPS_URL %}
<div class="position-absolute top-50 end-0 translate-middle-y noprint">
<a href="{{ config.MAPS_URL }}{{ object.latitude }},{{ object.longitude }}" target="_blank" class="btn btn-primary btn-sm">
<i class="mdi mdi-map-marker"></i> Map It
<i class="mdi mdi-map-marker"></i> {% trans "Map It" %}
</a>
</div>
{% endif %}
@@ -94,7 +95,7 @@
</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -103,31 +104,31 @@
</td>
</tr>
<tr>
<th scope="row">Device Type</th>
<th scope="row">{% trans "Device Type" %}</th>
<td>
{{ object.device_type|linkify:"get_full_name" }} ({{ object.device_type.u_height|floatformat }}U)
</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Airflow</th>
<th scope="row">{% trans "Airflow" %}</th>
<td>
{{ object.get_airflow_display|placeholder }}
</td>
</tr>
<tr>
<th scope="row">Serial Number</th>
<th scope="row">{% trans "Serial Number" %}</th>
<td class="font-monospace">{{ object.serial|placeholder }}</td>
</tr>
<tr>
<th scope="row">Asset Tag</th>
<th scope="row">{% trans "Asset Tag" %}</th>
<td class="font-monospace">{{ object.asset_tag|placeholder }}</td>
</tr>
<tr>
<th scope="row">Config Template</th>
<th scope="row">{% trans "Config Template" %}</th>
<td>{{ object.config_template|linkify|placeholder }}</td>
</tr>
</table>
@@ -136,15 +137,15 @@
{% if vc_members %}
<div class="card">
<h5 class="card-header">
Virtual Chassis
{% trans "Virtual Chassis" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th>Device</th>
<th>Position</th>
<th>Master</th>
<th>Priority</th>
<th>{% trans "Device" %}</th>
<th>{% trans "Position" %}</th>
<th>{% trans "Master" %}</th>
<th>{% trans "Priority" %}</th>
</tr>
{% for vc_member in vc_members %}
<tr{% if vc_member == object %} class="info"{% endif %}>
@@ -166,7 +167,7 @@
</div>
<div class="card-footer text-end noprint">
<a href="{{ object.virtual_chassis.get_absolute_url }}" class="btn btn-primary btn-sm">
<span class="mdi mdi-arrow-right-bold" aria-hidden="true"></span> View Virtual Chassis
<span class="mdi mdi-arrow-right-bold" aria-hidden="true"></span> {% trans "View Virtual Chassis" %}
</a>
</div>
</div>
@@ -175,7 +176,7 @@
{% include 'inc/panels/tags.html' %}
{% include 'inc/panels/comments.html' %}
<div class="card">
<h5 class="card-header">Virtual Device Contexts</h5>
<h5 class="card-header">{% trans "Virtual Device Contexts" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'dcim:virtualdevicecontext_list' %}?device_id={{ object.pk }}"
hx-trigger="load"
@@ -183,7 +184,7 @@
{% if perms.dcim.add_virtualdevicecontext %}
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:virtualdevicecontext_add' %}?device={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Create VDC
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Create VDC" %}
</a>
</div>
{% endif %}
@@ -192,30 +193,30 @@
</div>
<div class="col col-12 col-xl-6">
<div class="card">
<h5 class="card-header">Management</h5>
<h5 class="card-header">{% trans "Management" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Role</th>
<th scope="row">{% trans "Role" %}</th>
<td>{{ object.device_role|linkify }}</td>
</tr>
<tr>
<th scope="row">Platform</th>
<th scope="row">{% trans "Platform" %}</th>
<td>{{ object.platform|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Primary IPv4</th>
<th scope="row">{% trans "Primary IPv4" %}</th>
<td>
{% if object.primary_ip4 %}
<a href="{{ object.primary_ip4.get_absolute_url }}" id="primary_ip4">{{ object.primary_ip4.address.ip }}</a>
{% if object.primary_ip4.nat_inside %}
(NAT for <a href="{{ object.primary_ip4.nat_inside.get_absolute_url }}">{{ object.primary_ip4.nat_inside.address.ip }}</a>)
({% trans "NAT for" %} <a href="{{ object.primary_ip4.nat_inside.get_absolute_url }}">{{ object.primary_ip4.nat_inside.address.ip }}</a>)
{% elif object.primary_ip4.nat_outside.exists %}
(NAT: {% for nat in object.primary_ip4.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
({% trans "NAT" %}: {% for nat in object.primary_ip4.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% copy_content "primary_ip4" %}
{% else %}
@@ -224,14 +225,14 @@
</td>
</tr>
<tr>
<th scope="row">Primary IPv6</th>
<th scope="row">{% trans "Primary IPv6" %}</th>
<td>
{% if object.primary_ip6 %}
<a href="{{ object.primary_ip6.get_absolute_url }}" id="primary_ip6">{{ object.primary_ip6.address.ip }}</a>
{% if object.primary_ip6.nat_inside %}
(NAT for <a href="{{ object.primary_ip6.nat_inside.get_absolute_url }}">{{ object.primary_ip6.nat_inside.address.ip }}</a>)
({% trans "NAT for" %} <a href="{{ object.primary_ip6.nat_inside.get_absolute_url }}">{{ object.primary_ip6.nat_inside.address.ip }}</a>)
{% elif object.primary_ip6.nat_outside.exists %}
(NAT: {% for nat in object.primary_ip6.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
({% trans "NAT" %}: {% for nat in object.primary_ip6.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% copy_content "primary_ip6" %}
{% else %}
@@ -252,7 +253,7 @@
</tr>
{% if object.cluster %}
<tr>
<th>Cluster</th>
<th>{% trans "Cluster" %}</th>
<td>
{% if object.cluster.group %}
{{ object.cluster.group|linkify }} /
@@ -267,25 +268,25 @@
{% if object.powerports.exists and object.poweroutlets.exists %}
<div class="card">
<h5 class="card-header">
Power Utilization
{% trans "Power Utilization" %}
</h5>
<div class="card-body">
<table class="table table-hover">
<tr>
<th>Input</th>
<th>Outlets</th>
<th>Allocated</th>
<th>Available</th>
<th>Utilization</th>
<th>{% trans "Input" %}</th>
<th>{% trans "Outlets" %}</th>
<th>{% trans "Allocated" %}</th>
<th>{% trans "Available" %}</th>
<th>{% trans "Utilization" %}</th>
</tr>
{% for powerport in object.powerports.all %}
{% with utilization=powerport.get_power_draw powerfeed=powerport.connected_endpoints.0 %}
<tr>
<td>{{ powerport }}</td>
<td>{{ utilization.outlet_count }}</td>
<td>{{ utilization.allocated }}VA</td>
<td>{{ utilization.allocated }}{% trans "VA" %}</td>
{% if powerfeed.available_power %}
<td>{{ powerfeed.available_power }}VA</td>
<td>{{ powerfeed.available_power }}{% trans "VA" %}</td>
<td>{% utilization_graph utilization.allocated|percentage:powerfeed.available_power %}</td>
{% else %}
<td class="text-muted">&mdash;</td>
@@ -294,12 +295,12 @@
</tr>
{% for leg in utilization.legs %}
<tr>
<td style="padding-left: 20px">Leg {{ leg.name }}</td>
<td style="padding-left: 20px">{% blocktrans %}Leg {{ leg.name }}{% endblocktrans %}</td>
<td>{{ leg.outlet_count }}</td>
<td>{{ leg.allocated }}</td>
{% if powerfeed.available_power %}
{% with phase_available=powerfeed.available_power|divide:3 %}
<td>{{ phase_available }}VA</td>
<td>{{ phase_available }}{% trans "VA" %}</td>
<td>{% utilization_graph leg.allocated|percentage:phase_available %}</td>
{% endwith %}
{% else %}
@@ -315,7 +316,7 @@
</div>
{% endif %}
<div class="card">
<h5 class="card-header">Services</h5>
<h5 class="card-header">{% trans "Services" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'ipam:service_list' %}?device_id={{ object.pk }}"
hx-trigger="load"
@@ -323,27 +324,27 @@
{% if perms.ipam.add_service %}
<div class="card-footer text-end noprint">
<a href="{% url 'ipam:service_add' %}?device={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add a service
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add a service" %}
</a>
</div>
{% endif %}
</div>
{% include 'inc/panels/image_attachments.html' %}
<div class="card">
<h5 class="card-header">Dimensions</h5>
<h5 class="card-header">{% trans "Dimensions" %}</h5>
<div class="card-body table-responsive">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Height</th>
<th scope="row">{% trans "Height" %}</th>
<td>
{{ object.device_type.u_height }}U
</td>
</tr>
<tr>
<th scope="row">Weight</th>
<th scope="row">{% trans "Weight" %}</th>
<td>
{% if object.total_weight %}
{{ object.total_weight|floatformat }} Kilograms
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
@@ -356,13 +357,13 @@
<div class="row" style="margin-bottom: 20px">
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
<h4>Front</h4>
<h4>{% trans "Front" %}</h4>
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='front' extra_params=svg_extra %}
</div>
</div>
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
<h4>Rear</h4>
<h4>{% trans "Rear" %}</h4>
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='rear' extra_params=svg_extra %}
</div>
</div>

View File

@@ -3,6 +3,7 @@
{% load static %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -17,38 +18,38 @@
{% if perms.dcim.change_device %}
<div class="dropdown">
<button id="add-components" type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Components
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
</button>
<ul class="dropdown-menu" aria-labeled-by="add-components">
{% if perms.dcim.add_consoleport %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleports' pk=object.pk %}">Console Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleports' pk=object.pk %}">{% trans "Console Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_consoleserverport %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}">Console Server Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}">{% trans "Console Server Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_powerport %}
<li><a class="dropdown-item" href="{% url 'dcim:powerport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_powerports' pk=object.pk %}">Power Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:powerport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_powerports' pk=object.pk %}">{% trans "Power Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_poweroutlet %}
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlet_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}">Power Outlets</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlet_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}">{% trans "Power Outlets" %}</a></li>
{% endif %}
{% if perms.dcim.add_interface %}
<li><a class="dropdown-item" href="{% url 'dcim:interface_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_interfaces' pk=object.pk %}">Interfaces</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:interface_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_interfaces' pk=object.pk %}">{% trans "Interfaces" %}</a></li>
{% endif %}
{% if perms.dcim.add_frontport %}
<li><a class="dropdown-item" href="{% url 'dcim:frontport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_frontports' pk=object.pk %}">Front Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:frontport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_frontports' pk=object.pk %}">{% trans "Front Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_rearport %}
<li><a class="dropdown-item" href="{% url 'dcim:rearport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_rearports' pk=object.pk %}">Rear Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:rearport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_rearports' pk=object.pk %}">{% trans "Rear Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_devicebay %}
<li><a class="dropdown-item" href="{% url 'dcim:modulebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_modulebays' pk=object.pk %}">Module Bays</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:modulebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_modulebays' pk=object.pk %}">{% trans "Module Bays" %}</a></li>
{% endif %}
{% if perms.dcim.add_devicebay %}
<li><a class="dropdown-item" href="{% url 'dcim:devicebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}">Device Bays</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:devicebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}">{% trans "Device Bays" %}</a></li>
{% endif %}
{% if perms.dcim.add_inventoryitem %}
<li><a class="dropdown-item" href="{% url 'dcim:inventoryitem_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_inventory' pk=object.pk %}">Inventory Items</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:inventoryitem_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_inventory' pk=object.pk %}">{% trans "Inventory Items" %}</a></li>
{% endif %}
</ul>
</div>

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsolePortTable_config" %}
@@ -20,22 +21,22 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:consoleport_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleports' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:consoleport_bulk_rename' %}?return_url={% url 'dcim:device_consoleports' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
<div class="btn-group" role="group">
{% if 'bulk_delete' in actions %}
<button type="submit" name="_delete" formaction="{% url 'dcim:consoleport_bulk_delete' %}?return_url={% url 'dcim:device_consoleports' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
{% if 'bulk_edit' in actions %}
<button type="submit" name="_disconnect" formaction="{% url 'dcim:consoleport_bulk_disconnect' %}?return_url={% url 'dcim:device_consoleports' pk=object.pk %}" class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
</div>
@@ -43,7 +44,7 @@
{% if perms.dcim.add_consoleport %}
<div class="bulk-button-group">
<a href="{% url 'dcim:consoleport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleports' pk=object.pk %}" class="btn btn-sm btn-primary">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Console Port
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Console Port" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsoleServerPortTable_config" %}
@@ -20,22 +21,22 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:consoleserverport_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:consoleserverport_bulk_rename' %}?return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
<div class="btn-group" role="group">
{% if 'bulk_delete' in actions %}
<button type="submit" formaction="{% url 'dcim:consoleserverport_bulk_delete' %}?return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
{% if 'bulk_edit' in actions %}
<button type="submit" name="_disconnect" formaction="{% url 'dcim:consoleserverport_bulk_disconnect' %}?return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}" class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
</div>
@@ -43,7 +44,7 @@
{% if perms.dcim.add_consoleserverport %}
<div class="bulk-button-group">
<a href="{% url 'dcim:consoleserverport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Console Server Ports
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Console Server Ports" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DeviceDeviceBayTable_config" %}
@@ -20,23 +21,23 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:devicebay_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:devicebay_bulk_rename' %}?return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
{% if 'bulk_delete' in actions %}
<button type="submit" name="_delete" formaction="{% url 'dcim:devicebay_bulk_delete' %}?return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
</div>
{% if perms.dcim.add_devicebay %}
<div class="bulk-button-group">
<a href="{% url 'dcim:devicebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Device Bays
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Device Bays" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DeviceFrontPortTable_config" %}
@@ -20,22 +21,22 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:frontport_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_frontports' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:frontport_bulk_rename' %}?return_url={% url 'dcim:device_frontports' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
<div class="btn-group" role="group">
{% if 'bulk_delete' in actions %}
<button type="submit" formaction="{% url 'dcim:frontport_bulk_delete' %}?return_url={% url 'dcim:device_frontports' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
{% if 'bulk_edit' in actions %}
<button type="submit" name="_disconnect" formaction="{% url 'dcim:frontport_bulk_disconnect' %}?return_url={% url 'dcim:device_frontports' pk=object.pk %}" class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
</div>
@@ -43,7 +44,7 @@
{% if perms.dcim.add_frontport %}
<div class="bulk-button-group">
<a href="{% url 'dcim:frontport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_frontports' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add front ports
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add front ports" %}
</a>
</div>
{% endif %}

View File

@@ -1,12 +1,13 @@
{% extends 'inc/table_controls_htmx.html' %}
{% load i18n %}
{% block extra_table_controls %}
<button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-eye"></i>
</button>
<ul class="dropdown-menu">
<button type="button" class="dropdown-item toggle-enabled" data-state="show">Hide Enabled</button>
<button type="button" class="dropdown-item toggle-disabled" data-state="show">Hide Disabled</button>
<button type="button" class="dropdown-item toggle-virtual" data-state="show">Hide Virtual</button>
<button type="button" class="dropdown-item toggle-enabled" data-state="show">{% trans "Hide Enabled" %}</button>
<button type="button" class="dropdown-item toggle-disabled" data-state="show">{% trans "Hide Disabled" %}</button>
<button type="button" class="dropdown-item toggle-virtual" data-state="show">{% trans "Hide Virtual" %}</button>
</ul>
{% endblock extra_table_controls %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'dcim/device/inc/interface_table_controls.html' with table_modal="DeviceInterfaceTable_config" %}
@@ -22,12 +23,12 @@
<button type="submit" name="_edit"
formaction="{% url 'dcim:interface_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_interfaces' pk=object.pk %}"
class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename"
formaction="{% url 'dcim:interface_bulk_rename' %}?return_url={% url 'dcim:device_interfaces' pk=object.pk %}"
class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
@@ -36,14 +37,14 @@
<button type="submit" name="_delete"
formaction="{% url 'dcim:interface_bulk_delete' %}?return_url={% url 'dcim:device_interfaces' pk=object.pk %}"
class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
{% if 'bulk_edit' in actions %}
<button type="submit" name="_disconnect"
formaction="{% url 'dcim:interface_bulk_disconnect' %}?return_url={% url 'dcim:device_interfaces' pk=object.pk %}"
class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
</div>
@@ -52,7 +53,7 @@
<div class="bulk-button-group">
<a href="{% url 'dcim:interface_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_interfaces' pk=object.pk %}"
class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Interfaces
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Interfaces" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DeviceInventoryItemTable_config" %}
@@ -20,23 +21,23 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:inventoryitem_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_inventory' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:inventoryitem_bulk_rename' %}?return_url={% url 'dcim:device_inventory' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
{% if 'bulk_delete' in actions %}
<button type="submit" name="_delete" formaction="{% url 'dcim:inventoryitem_bulk_delete' %}?return_url={% url 'dcim:device_inventory' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
</div>
{% if perms.dcim.add_inventoryitem %}
<div class="bulk-button-group">
<a href="{% url 'dcim:inventoryitem_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_inventory' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Inventory Item
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Inventory Item" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DeviceModuleBayTable_config" %}
@@ -20,23 +21,23 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:modulebay_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_modulebays' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:modulebay_bulk_rename' %}?return_url={% url 'dcim:device_modulebays' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
{% if 'bulk_delete' in actions %}
<button type="submit" formaction="{% url 'dcim:modulebay_bulk_delete' %}?return_url={% url 'dcim:device_modulebays' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
</div>
{% if perms.dcim.add_modulebay %}
<div class="bulk-button-group">
<a href="{% url 'dcim:modulebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_modulebays' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Module Bays
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Module Bays" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerOutletTable_config" %}
@@ -20,22 +21,22 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:poweroutlet_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:poweroutlet_bulk_rename' %}?return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
<div class="btn-group" role="group">
{% if 'bulk_delete' in actions %}
<button type="submit" formaction="{% url 'dcim:poweroutlet_bulk_delete' %}?return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
{% if 'bulk_edit' in actions %}
<button type="submit" name="_disconnect" formaction="{% url 'dcim:poweroutlet_bulk_disconnect' %}?return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}" class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
</div>
@@ -43,7 +44,7 @@
{% if perms.dcim.add_poweroutlet %}
<div class="bulk-button-group">
<a href="{% url 'dcim:poweroutlet_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Power Outlets
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Power Outlets" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerPortTable_config" %}
@@ -20,22 +21,22 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:powerport_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_powerports' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:powerport_bulk_rename' %}?return_url={% url 'dcim:device_powerports' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
<div class="btn-group" role="group">
{% if 'bulk_delete' in actions %}
<button type="submit" name="_delete" formaction="{% url 'dcim:powerport_bulk_delete' %}?return_url={% url 'dcim:device_powerports' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
{% if 'bulk_edit' in actions %}
<button type="submit" name="_disconnect" formaction="{% url 'dcim:powerport_bulk_disconnect' %}?return_url={% url 'dcim:device_powerports' pk=object.pk %}" class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
</div>
@@ -43,7 +44,7 @@
{% if perms.dcim.add_powerport %}
<div class="bulk-button-group">
<a href="{% url 'dcim:powerport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_powerports' pk=object.pk %}" class="btn btn-sm btn-primary">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Power Port
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Power Port" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load render_table from django_tables2 %}
{% load static %}
{% load helpers %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="DeviceRearPortTable_config" %}
@@ -20,22 +21,22 @@
{% if 'bulk_edit' in actions %}
<div class="btn-group" role="group">
<button type="submit" name="_edit" formaction="{% url 'dcim:rearport_bulk_edit' %}?device={{ object.pk }}&return_url={% url 'dcim:device_rearports' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
<button type="submit" name="_rename" formaction="{% url 'dcim:rearport_bulk_rename' %}?return_url={% url 'dcim:device_rearports' pk=object.pk %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}
<div class="btn-group" role="group">
{% if 'bulk_delete' in actions %}
<button type="submit" formaction="{% url 'dcim:rearport_bulk_delete' %}?return_url={% url 'dcim:device_rearports' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
{% if 'bulk_edit' in actions %}
<button type="submit" name="_disconnect" formaction="{% url 'dcim:rearport_bulk_disconnect' %}?return_url={% url 'dcim:device_rearports' pk=object.pk %}" class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
</div>
@@ -43,7 +44,7 @@
{% if perms.dcim.add_rearport %}
<div class="bulk-button-group">
<a href="{% url 'dcim:rearport_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_rearports' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add rear ports
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add rear ports" %}
</a>
</div>
{% endif %}

View File

@@ -1,25 +1,26 @@
{% extends 'dcim/device/base.html' %}
{% load static %}
{% load i18n %}
{% block title %}{{ object }} - Config{% endblock %}
{% block title %}{{ object }} - {% trans "Config" %}{% endblock %}
{% block content %}
<div class="row mb-3">
<div class="col-5">
<div class="card">
<h5 class="card-header">Config Template</h5>
<h5 class="card-header">{% trans "Config Template" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Config Template</th>
<th scope="row">{% trans "Config Template" %}</th>
<td>{{ config_template|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Data Source</th>
<th scope="row">{% trans "Data Source" %}</th>
<td>{{ config_template.data_file.source|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Data File</th>
<th scope="row">{% trans "Data File" %}</th>
<td>{{ config_template.data_file|linkify|placeholder }}</td>
</tr>
</table>
@@ -33,7 +34,7 @@
<div class="accordion-item">
<h2 class="accordion-header" id="renderConfigHeading">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapsedRenderConfig" aria-expanded="false" aria-controls="collapsedRenderConfig">
Context Data
{% trans "Context Data" %}
</button>
</h2>
<div id="collapsedRenderConfig" class="accordion-collapse collapse" aria-labelledby="renderConfigHeading" data-bs-parent="#renderConfig">
@@ -53,15 +54,15 @@
<div class="card-header">
<div class="float-end">
<a href="?export=True" class="btn btn-sm btn-primary" role="button">
<i class="mdi mdi-download" aria-hidden="true"></i> Download
<i class="mdi mdi-download" aria-hidden="true"></i> {% trans "Download" %}
</a>
</div>
<h5>Rendered Config</h5>
<h5>{% trans "Rendered Config" %}</h5>
</div>
{% if config_template %}
<pre class="card-body">{{ rendered_config }}</pre>
{% else %}
<div class="card-body text-muted">No configuration template found</div>
<div class="card-body text-muted">{% trans "No configuration template found" %}</div>
{% endif %}
</div>
</div>

View File

@@ -1,12 +1,13 @@
{% extends 'generic/object_edit.html' %}
{% load form_helpers %}
{% load i18n %}
{% block form %}
{% render_errors form %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Device</h5>
<h5 class="offset-sm-3">{% trans "Device" %}</h5>
</div>
{% render_field form.name %}
{% render_field form.device_role %}
@@ -16,7 +17,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Hardware</h5>
<h5 class="offset-sm-3">{% trans "Hardware" %}</h5>
</div>
{% render_field form.device_type %}
{% render_field form.airflow %}
@@ -26,7 +27,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Location</h5>
<h5 class="offset-sm-3">{% trans "Location" %}</h5>
</div>
{% render_field form.site %}
{% render_field form.location %}
@@ -34,18 +35,18 @@
{% if object.device_type.is_child_device and object.parent_bay %}
<div class="row mb-3">
<label class="col-sm-3 col-form-label">Parent Device</label>
<label class="col-sm-3 col-form-label">{% trans "Parent Device" %}</label>
<div class="col">
<input class="form-control" value="{{ object.parent_bay.device }}" disabled />
</div>
</div>
<div class="row mb-3">
<label class="col-sm-3 col-form-label">Parent Bay</label>
<label class="col-sm-3 col-form-label">{% trans "Parent Bay" %}</label>
<div class="col">
<div class="input-group">
<input class="form-control" value="{{ object.parent_bay.name }}" disabled />
<a href="{% url 'dcim:devicebay_depopulate' pk=object.parent_bay.pk %}" title="Regenerate Slug" class="btn btn-danger d-inline-flex align-items-center">
<i class="mdi mdi-close-thick"></i>&nbsp;Remove
<a href="{% url 'dcim:devicebay_depopulate' pk=object.parent_bay.pk %}" title="{% trans "Regenerate Slug" %}" class="btn btn-danger d-inline-flex align-items-center">
<i class="mdi mdi-close-thick"></i>&nbsp;{% trans "Remove" %}
</a>
</div>
</div>
@@ -60,7 +61,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Management</h5>
<h5 class="offset-sm-3">{% trans "Management" %}</h5>
</div>
{% render_field form.status %}
{% render_field form.platform %}
@@ -74,14 +75,14 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Virtualization</h5>
<h5 class="offset-sm-3">{% trans "Virtualization" %}</h5>
</div>
{% render_field form.cluster %}
</div>
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
<h5 class="offset-sm-3">{% trans "Tenancy" %}</h5>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
@@ -89,7 +90,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Virtual Chassis</h5>
<h5 class="offset-sm-3">{% trans "Virtual Chassis" %}</h5>
</div>
{% render_field form.virtual_chassis %}
{% render_field form.vc_position %}
@@ -99,14 +100,14 @@
{% if form.custom_fields %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
<h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5>
</div>
{% render_custom_fields form %}
</div>
{% endif %}
<div class="field-group my-5">
<h5 class="text-center">Local Config Context Data</h5>
<h5 class="text-center">{% trans "Local Config Context Data" %}</h5>
{% render_field form.local_context_data %}
</div>

View File

@@ -1,73 +1,74 @@
{% extends 'generic/object_list.html' %}
{% load buttons %}
{% load i18n %}
{% block bulk_buttons %}
{% if perms.dcim.change_device %}
<div class="dropdown">
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Components
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
</button>
<ul class="dropdown-menu">
{% if perms.dcim.add_consoleport %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_consoleport' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item">
Console Ports
{% trans "Console Ports" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_consoleserverport %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_consoleserverport' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item ">
Console Server Ports
{% trans "Console Server Ports" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_powerport %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_powerport' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item">
Power Ports
{% trans "Power Ports" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_poweroutlet %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_poweroutlet' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item">
Power Outlets
{% trans "Power Outlets" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_interface %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_interface' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}"
class="dropdown-item">Interfaces
class="dropdown-item">{% trans "Interfaces" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_rearport %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_rearport' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item">
Rear Ports
{% trans "Rear Ports" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_devicebay %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_devicebay' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item">
Device Bays
{% trans "Device Bays" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_modulebay %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_modulebay' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item">
Module Bays
{% trans "Module Bays" %}
</button>
</li>
{% endif %}
{% if perms.dcim.add_inventoryitem %}
<li>
<button type="submit" formaction="{% url 'dcim:device_bulk_add_inventoryitem' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="dropdown-item">
Inventory Items
{% trans "Inventory Items" %}
</button>
</li>
{% endif %}
@@ -78,7 +79,7 @@
<div class="btn-group" role="group">
{% bulk_edit_button model query_params=request.GET %}
<button type="submit" name="_rename" formaction="{% url 'dcim:device_bulk_rename' %}?return_url={% url 'dcim:device_list' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-outline-warning btn-sm">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> {% trans "Rename" %}
</button>
</div>
{% endif %}

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,24 +15,24 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Device Bay
{% trans "Device Bay" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -44,25 +45,25 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Installed Device
{% trans "Installed Device" %}
</h5>
<div class="card-body">
{% if object.installed_device %}
{% with device=object.installed_device %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ device|linkify }}</td>
</tr>
<tr>
<th scope="row">Device Type</th>
<th scope="row">{% trans "Device Type" %}</th>
<td>{{ device.device_type }}</td>
</tr>
</table>
{% endwith %}
{% else %}
<div class="text-muted">
None
{% trans "None" %}
</div>
{% endif %}
</div>

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Delete device bay {{ devicebay }}?{% endblock %}
{% block title %}{% blocktrans %}Delete device bay {{ devicebay }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to delete this device bay from <strong>{{ devicebay.device }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to delete this device bay from <strong>{{ devicebay.device }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Remove {{ device_bay.installed_device }} from {{ device_bay }}?{% endblock %}
{% block title %}{% blocktrans %}Remove {{ device_bay.installed_device }} from {{ device_bay }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to remove <strong>{{ device_bay.installed_device }}</strong> from <strong>{{ device_bay }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to remove <strong>{{ device_bay.installed_device }}</strong> from <strong>{{ device_bay }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -1,5 +1,6 @@
{% extends 'base/layout.html' %}
{% load form_helpers %}
{% load i18n %}
{% render_errors form %}
@@ -9,16 +10,16 @@
<div class="row mb-3">
<div class="col col-md-6 offset-md-3">
<div class="card">
<h5 class="card-header">{% block title %}Populate {{ device_bay }}{% endblock %}</h5>
<h5 class="card-header">{% block title %}{% trans "Populate" %} {{ device_bay }}{% endblock %}</h5>
<div class="card-body">
<div class="row mb-3">
<label class="col-sm-3 col-form-label text-lg-end">Parent Device</label>
<label class="col-sm-3 col-form-label text-lg-end">{% trans "Parent Device" %}</label>
<div class="col">
<input class="form-control" value="{{ device_bay.device }}" disabled />
</div>
</div>
<div class="row mb-3">
<label class="col-sm-3 col-form-label text-lg-end">Bay</label>
<label class="col-sm-3 col-form-label text-lg-end">{% trans "Bay" %}</label>
<div class="col">
<input class="form-control" value="{{ device_bay }}" disabled />
</div>
@@ -30,8 +31,8 @@
</div>
<div class="row">
<div class="col col-md-6 offset-md-3 text-end">
<a href="{{ return_url }}" class="btn btn-outline-danger">Cancel</a>
<button type="submit" name="_update" class="btn btn-primary">Save</button>
<a href="{{ return_url }}" class="btn btn-outline-danger">{% trans "Cancel" %}</a>
<button type="submit" name="_update" class="btn btn-primary">{% trans "Save" %}</button>
</div>
</div>
</form>

View File

@@ -2,15 +2,16 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'dcim:devicerole_list' %}">Device Roles</a></li>
<li class="breadcrumb-item"><a href="{% url 'dcim:devicerole_list' %}">{% trans "Device Roles" %}</a></li>
{% endblock %}
{% block extra_controls %}
{% if perms.dcim.add_device %}
<a href="{% url 'dcim:device_add' %}?device_role={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Device
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Device" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -20,30 +21,30 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Device Role
{% trans "Device Role" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Color</th>
<th scope="row">{% trans "Color" %}</th>
<td>
<span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
</td>
</tr>
<tr>
<th scope="row">VM Role</th>
<th scope="row">{% trans "VM Role" %}</th>
<td>{% checkmark object.vm_role %}</td>
</tr>
<tr>
<th scope="row">Config Template</th>
<th scope="row">{% trans "Config Template" %}</th>
<td>{{ object.config_template|linkify|placeholder }}</td>
</tr>
</table>

View File

@@ -2,49 +2,50 @@
{% load buttons %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Chassis
{% trans "Chassis" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<td>Manufacturer</td>
<td>{% trans "Manufacturer" %}</td>
<td>{{ object.manufacturer|linkify }}</td>
</tr>
<tr>
<td>Model Name</td>
<td>{% trans "Model Name" %}</td>
<td>
{{ object.model }}<br/>
<small class="text-muted">{{ object.slug }}</small>
</td>
</tr>
<tr>
<td>Part Number</td>
<td>{% trans "Part Number" %}</td>
<td>{{ object.part_number|placeholder }}</td>
</tr>
<tr>
<td>Default Platform</td>
<td>{% trans "Default Platform" %}</td>
<td>{{ object.default_platform|linkify }}</td>
</tr>
<tr>
<td>Description</td>
<td>{% trans "Description" %}</td>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<td>Height (U)</td>
<td>{% trans "Height (U" %})</td>
<td>{{ object.u_height|floatformat }}</td>
</tr>
<tr>
<td>Full Depth</td>
<td>{% trans "Full Depth" %}</td>
<td>{% checkmark object.is_full_depth %}</td>
</tr>
<tr>
<td>Weight</td>
<td>{% trans "Weight" %}</td>
<td>
{% if object.weight %}
{{ object.weight|floatformat }} {{ object.get_weight_unit_display }}
@@ -54,19 +55,19 @@
</td>
</tr>
<tr>
<td>Parent/Child</td>
<td>{% trans "Parent/Child" %}</td>
<td>
{{ object.get_subdevice_role_display|placeholder }}
</td>
</tr>
<tr>
<td>Airflow</td>
<td>{% trans "Airflow" %}</td>
<td>
{{ object.get_airflow_display|placeholder }}
</td>
</tr>
<tr>
<td>Front Image</td>
<td>{% trans "Front Image" %}</td>
<td>
{% if object.front_image %}
<a href="{{ object.front_image.url }}">
@@ -78,7 +79,7 @@
</td>
</tr>
<tr>
<td>Rear Image</td>
<td>{% trans "Rear Image" %}</td>
<td>
{% if object.rear_image %}
<a href="{{ object.rear_image.url }}">

View File

@@ -2,6 +2,7 @@
{% load buttons %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block title %}{{ object.manufacturer }} {{ object.model }}{% endblock %}
@@ -14,38 +15,38 @@
{% if perms.dcim.change_devicetype %}
<div class="dropdown">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle"data-bs-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Components
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
</button>
<ul class="dropdown-menu">
{% if perms.dcim.add_consoleporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_consoleports' pk=object.pk %}">Console Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_consoleports' pk=object.pk %}">{% trans "Console Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_consoleserverporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_consoleserverports' pk=object.pk %}">Console Server Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_consoleserverports' pk=object.pk %}">{% trans "Console Server Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_powerporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:powerporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_powerports' pk=object.pk %}">Power Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:powerporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_powerports' pk=object.pk %}">{% trans "Power Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_poweroutlettemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlettemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_poweroutlets' pk=object.pk %}">Power Outlets</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlettemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_poweroutlets' pk=object.pk %}">{% trans "Power Outlets" %}</a></li>
{% endif %}
{% if perms.dcim.add_interfacetemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:interfacetemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_interfaces' pk=object.pk %}">Interfaces</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:interfacetemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_interfaces' pk=object.pk %}">{% trans "Interfaces" %}</a></li>
{% endif %}
{% if perms.dcim.add_frontporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:frontporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_frontports' pk=object.pk %}">Front Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:frontporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_frontports' pk=object.pk %}">{% trans "Front Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_rearporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:rearporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_rearports' pk=object.pk %}">Rear Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:rearporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_rearports' pk=object.pk %}">{% trans "Rear Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_modulebaytemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:modulebaytemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_modulebays' pk=object.pk %}">Module Bays</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:modulebaytemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_modulebays' pk=object.pk %}">{% trans "Module Bays" %}</a></li>
{% endif %}
{% if perms.dcim.add_devicebaytemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:devicebaytemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_devicebays' pk=object.pk %}">Device Bays</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:devicebaytemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_devicebays' pk=object.pk %}">{% trans "Device Bays" %}</a></li>
{% endif %}
{% if perms.dcim.add_inventoryitemtemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:inventoryitemtemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_inventoryitems' pk=object.pk %}">Inventory Items</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:inventoryitemtemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_inventoryitems' pk=object.pk %}">{% trans "Inventory Items" %}</a></li>
{% endif %}
</ul>
</div>

View File

@@ -1,6 +1,7 @@
{% extends 'dcim/devicetype/base.html' %}
{% load render_table from django_tables2 %}
{% load helpers %}
{% load i18n %}
{% block content %}
{% if perms.dcim.change_devicetype %}
@@ -14,19 +15,19 @@
<div class="card-footer noprint">
{% if table.rows %}
<button type="submit" name="_edit" formaction="{% url table.Meta.model|viewname:"bulk_rename" %}?return_url={{ return_url }}" class="btn btn-sm btn-warning">
<span class="mdi mdi-pencil-outline" aria-hidden="true"></span> Rename
<span class="mdi mdi-pencil-outline" aria-hidden="true"></span> {% trans "Rename" %}
</button>
<button type="submit" name="_edit" formaction="{% url table.Meta.model|viewname:"bulk_edit" %}?return_url={{ return_url }}" class="btn btn-sm btn-warning">
<span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
<span class="mdi mdi-pencil" aria-hidden="true"></span> {% trans "Edit" %}
</button>
<button type="submit" name="_delete" formaction="{% url table.Meta.model|viewname:"bulk_delete" %}?return_url={{ return_url }}" class="btn btn-sm btn-danger">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
<div class="float-end">
<a href="{% url table.Meta.model|viewname:"add" %}?device_type={{ object.pk }}&return_url={{ return_url }}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
Add {{ title }}
{% blocktrans %}Add {{ title }}{% endblocktrans %}
</a>
</div>
<div class="clearfix"></div>

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,32 +15,32 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Front Port
{% trans "Front Port" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ object.module|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">Color</th>
<th scope="row">{% trans "Color" %}</th>
<td>
{% if object.color %}
<span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
@@ -49,15 +50,15 @@
</td>
</tr>
<tr>
<th scope="row">Rear Port</th>
<th scope="row">{% trans "Rear Port" %}</th>
<td>{{ object.rear_port|linkify }}</td>
</tr>
<tr>
<th scope="row">Rear Port Position</th>
<th scope="row">{% trans "Rear Port Position" %}</th>
<td>{{ object.rear_port_position }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -70,26 +71,26 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Connection
{% trans "Connection" %}
</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as Connected" %}
</div>
{% elif object.cable %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Cable</th>
<th scope="row">{% trans "Cable" %}</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:frontport_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<a href="{% url 'dcim:frontport_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="{% trans "Trace" %}">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<th scope="row">Connection Status</th>
<th scope="row">{% trans "Connection Status" %}</th>
<td>
{% if object.cable.status %}
<span class="badge bg-success">{{ object.cable.get_status_display }}</span>
@@ -101,30 +102,30 @@
</table>
{% else %}
<div class="text-muted">
Not Connected
{% trans "Not Connected" %}
{% if perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> {% trans "Connect" %}
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}">Interface</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}">{% trans "Interface" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleserverport&return_url={{ object.get_absolute_url }}">Console Server Port</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleserverport&return_url={{ object.get_absolute_url }}">{% trans "Console Server Port" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleport&return_url={{ object.get_absolute_url }}">Console Port</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.consoleport&return_url={{ object.get_absolute_url }}">{% trans "Console Port" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}">Front Port</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}">{% trans "Front Port" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}">Rear Port</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}">{% trans "Rear Port" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}">Circuit Termination</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.frontport&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}">{% trans "Circuit Termination" %}</a>
</li>
</ul>
</div>

View File

@@ -1,18 +1,19 @@
{% load helpers %}
{% load i18n %}
{% if terminations.0 %}
<table class="table table-hover panel-body attr-table">
{% if terminations.0.device %}
{# Device component #}
<tr>
<td>Site</td>
<td>{% trans "Site" %}</td>
<td>{{ terminations.0.device.site|linkify }}</td>
</tr>
<tr>
<td>Location</td>
<td>{% trans "Location" %}</td>
<td>{{ terminations.0.device.location|linkify|placeholder }}</td>
</tr>
<tr>
<td>Rack</td>
<td>{% trans "Rack" %}</td>
<td>{{ terminations.0.device.rack|linkify|placeholder }}</td>
</tr>
<tr>
@@ -29,11 +30,11 @@
{% elif terminations.0.power_panel %}
{# Power feed #}
<tr>
<td>Site</td>
<td>{% trans "Site" %}</td>
<td>{{ terminations.0.power_panel.site|linkify }}</td>
</tr>
<tr>
<td>Power Panel</td>
<td>{% trans "Power Panel" %}</td>
<td>{{ terminations.0.power_panel|linkify }}</td>
</tr>
<tr>
@@ -47,11 +48,11 @@
{% elif terminations.0.circuit %}
{# Circuit termination #}
<tr>
<td>Provider</td>
<td>{% trans "Provider" %}</td>
<td>{{ terminations.0.circuit.provider|linkify }}</td>
</tr>
<tr>
<td>Circuit</td>
<td>{% trans "Circuit" %}</td>
<td>
{% for term in terminations %}
{{ term.circuit|linkify }} ({{ term }}){% if not forloop.last %},{% endif %}
@@ -61,5 +62,5 @@
{% endif %}
</table>
{% else %}
<span class="text-muted">No termination</span>
<span class="text-muted">{% trans "No termination" %}</span>
{% endif %}

View File

@@ -1,10 +1,11 @@
{% load i18n %}
{% if perms.dcim.change_cable %}
{% if cable.status == 'connected' %}
<button type="button" class="btn btn-warning btn-sm cable-toggle connected" title="Mark Planned" data-url="{% url 'dcim-api:cable-detail' pk=cable.pk %}">
<button type="button" class="btn btn-warning btn-sm cable-toggle connected" title="{% trans "Mark Planned" %}" data-url="{% url 'dcim-api:cable-detail' pk=cable.pk %}">
<i class="mdi mdi-lan-disconnect" aria-hidden="true"></i>
</button>
{% else %}
<button type="button" class="btn btn-info btn-sm cable-toggle" title="Mark Installed" data-url="{% url 'dcim-api:cable-detail' pk=cable.pk %}">
<button type="button" class="btn btn-info btn-sm cable-toggle" title="{% trans "Mark Installed" %}" data-url="{% url 'dcim-api:cable-detail' pk=cable.pk %}">
<i class="mdi mdi-lan-connect" aria-hidden="true"></i>
</button>
{% endif %}

View File

@@ -1,25 +1,26 @@
{% load i18n %}
<table class="table table-hover">
<tr>
<th scope="row">Cable</th>
<th scope="row">{% trans "Cable" %}</th>
<td>
{{ object.cable|linkify }}
<a href="{% url trace_url pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<a href="{% url trace_url pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="{% trans "Trace" %}">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<th scope="row">Path Status</th>
<th scope="row">{% trans "Path Status" %}</th>
<td>
{% if object.path.is_complete and object.path.is_active %}
<span class="badge bg-success">Reachable</span>
<span class="badge bg-success">{% trans "Reachable" %}</span>
{% else %}
<span class="badge bg-danger">Not Reachable</span>
<span class="badge bg-danger">{% trans "Not Reachable" %}</span>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Path Endpoints</th>
<th scope="row">{% trans "Path Endpoints" %}</th>
<td>
{% for endpoint in object.connected_endpoints %}
{% if endpoint.parent_object %}

View File

@@ -1,8 +1,9 @@
{% load i18n %}
{% if path.destination_id %}
{% with endpoint=path.destination %}
<td>{{ endpoint.parent_object|linkify }}</td>
<td>{{ endpoint|linkify }}</td>
{% endwith %}
{% else %}
<td colspan="2" class="text-muted">Not connected</td>
<td colspan="2" class="text-muted">{% trans "Not connected" %}</td>
{% endif %}

View File

@@ -1,9 +1,10 @@
{% load i18n %}
<table class="table panel-body">
<tr>
<th>VID</th>
<th>Name</th>
<th>Untagged</th>
<th>Tagged</th>
<th>{% trans "VID" %}</th>
<th>{% trans "Name" %}</th>
<th>{% trans "Untagged" %}</th>
<th>{% trans "Tagged" %}</th>
</tr>
{% with tagged_vlans=obj.tagged_vlans.all %}
{% if obj.untagged_vlan and obj.untagged_vlan not in tagged_vlans %}
@@ -33,17 +34,17 @@
{% if not obj.untagged_vlan and not tagged_vlans %}
<tr>
<td colspan="4" class="text-muted text-center">
No VLANs Assigned
{% trans "No VLANs Assigned" %}
</td>
</tr>
{% else %}
<tr>
<td colspan="2"></td>
<td>
<a href="#" id="clear_untagged_vlan" class="btn btn-outline-warning btn-sm">Clear</a>
<a href="#" id="clear_untagged_vlan" class="btn btn-outline-warning btn-sm">{% trans "Clear" %}</a>
</td>
<td>
<a href="#" id="clear_tagged_vlans" class="btn btn-warning btn-sm">Clear All</a>
<a href="#" id="clear_tagged_vlans" class="btn btn-warning btn-sm">{% trans "Clear All" %}</a>
</td>
</tr>
{% endif %}

View File

@@ -1,17 +1,18 @@
{% load helpers %}
{% load i18n %}
<div class="card">
<h5 class="card-header">
Non-Racked Devices
{% trans "Non-Racked Devices" %}
</h5>
<div class="card-body">
{% if nonracked_devices %}
<table class="table table-hover">
<tr>
<th>Name</th>
<th>Role</th>
<th>Type</th>
<th colspan="2">Parent Device</th>
<th>{% trans "Name" %}</th>
<th>{% trans "Role" %}</th>
<th>{% trans "Type" %}</th>
<th colspan="2">{% trans "Parent Device" %}</th>
</tr>
{% for device in nonracked_devices %}
<tr{% if device.device_type.u_height %} class="warning"{% endif %}>
@@ -33,18 +34,18 @@
{% if total_nonracked_devices_count > nonracked_devices.count %}
{% if object|meta:'verbose_name' == 'site' %}
<div class="text-muted">
Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices (<a href="{% url 'dcim:device_list' %}?site_id={{ object.pk }}&rack_id=null">View full list</a>)
{% blocktrans %}Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices{% endblocktrans %} (<a href="{% url 'dcim:device_list' %}?site_id={{ object.pk }}&rack_id=null">{% trans "View full list" %}</a>)
</div>
{% elif object|meta:'verbose_name' == 'location' %}
<div class="text-muted">
Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices (<a href="{% url 'dcim:device_list' %}?location_id={{ object.pk }}&rack_id=null">View full list</a>)
{% blocktrans %}Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices{% endblocktrans %} (<a href="{% url 'dcim:device_list' %}?location_id={{ object.pk }}&rack_id=null">{% trans "View full list" %}</a>)
</div>
{% endif %}
{% endif %}
{% else %}
<div class="text-muted">
None
{% trans "None" %}
</div>
{% endif %}
</div>
@@ -54,21 +55,21 @@
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:device_add' %}?site={{ object.site.pk }}&rack={{ object.pk }}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
Add a Non-Racked Device
{% trans "Add a Non-Racked Device" %}
</a>
</div>
{% elif object|meta:'verbose_name' == 'site' %}
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:device_add' %}?site={{ object.pk }}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
Add a Non-Racked Device
{% trans "Add a Non-Racked Device" %}
</a>
</div>
{% elif object|meta:'verbose_name' == 'location' %}
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:device_add' %}?site={{ object.site.pk }}&location={{ object.pk }}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
Add a Non-Racked Device
{% trans "Add a Non-Racked Device" %}
</a>
</div>
{% endif %}

View File

@@ -1,14 +1,15 @@
{% load helpers %}
{% load i18n %}
<div class="card">
<h5 class="card-header">Inventory Items</h5>
<h5 class="card-header">{% trans "Inventory Items" %}</h5>
<div class="card-body">
<table class="table table-hover table-headings">
<thead>
<tr>
<th>Name</th>
<th>Label</th>
<th>Role</th>
<th>{% trans "Name" %}</th>
<th>{% trans "Label" %}</th>
<th>{% trans "Role" %}</th>
<th></th>
</tr>
</thead>
@@ -20,12 +21,12 @@
<td>{{ item.role|linkify|placeholder }}</td>
<td class="text-end noprint">
{% if perms.dcim.change_inventoryitem %}
<a href="{% url 'dcim:inventoryitem_edit' pk=item.pk %}?return_url={{ object.get_absolute_url }}" class="btn btn-warning btn-sm lh-1" title="Edit">
<a href="{% url 'dcim:inventoryitem_edit' pk=item.pk %}?return_url={{ object.get_absolute_url }}" class="btn btn-warning btn-sm lh-1" title="{% trans "Edit" %}">
<i class="mdi mdi-pencil" aria-hidden="true"></i>
</a>
{% endif %}
{% if perms.ipam.delete_inventoryitem %}
<a href="{% url 'dcim:inventoryitem_delete' pk=item.pk %}?return_url={{ object.get_absolute_url }}" class="btn btn-danger btn-sm lh-1" title="Delete">
<a href="{% url 'dcim:inventoryitem_delete' pk=item.pk %}?return_url={{ object.get_absolute_url }}" class="btn btn-danger btn-sm lh-1" title="{% trans "Delete" %}">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i>
</a>
{% endif %}
@@ -33,7 +34,7 @@
</tr>
{% empty %}
<tr>
<td colspan="5" class="text-muted">None</td>
<td colspan="5" class="text-muted">{% trans "None" %}</td>
</tr>
{% endfor %}
</tbody>
@@ -42,7 +43,7 @@
<div class="card-footer text-end noprint">
{% if perms.dcim.add_inventoryitem %}
<a href="{% url 'dcim:inventoryitem_add' %}?device={{ object.device.pk }}&component_type={{ object|content_type_id }}&component_id={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Inventory Item
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Inventory Item" %}
</a>
{% endif %}
</div>

View File

@@ -1,8 +1,9 @@
{% load i18n %}
<div style="margin-left: -30px">
<object data="{% url 'dcim-api:rack-elevation' pk=object.pk %}?face={{face}}&render=svg{% if extra_params %}&{{ extra_params }}{% endif %}" class="rack_elevation"></object>
</div>
<div class="text-center mt-3">
<a class="btn btn-outline-primary btn-sm" href="{% url 'dcim-api:rack-elevation' pk=object.pk %}?face={{face}}&render=svg{% if extra_params %}&{{ extra_params }}{% endif %}">
<i class="mdi mdi-file-download"></i> Download SVG
<i class="mdi mdi-file-download"></i> {% trans "Download SVG" %}
</a>
</div>

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,7 +14,7 @@
{% block extra_controls %}
{% if perms.dcim.add_interface and not object.is_virtual %}
<a href="{% url 'dcim:interface_add' %}?device={{ object.device.pk }}&parent={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-success">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Child Interface
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Child Interface" %}
</a>
{% endif %}
{{ block.super }}
@@ -23,89 +24,89 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Interface</h5>
<h5 class="card-header">{% trans "Interface" %}</h5>
<div class="card-body">
<table class="table table-hover">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ object.module|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">Speed/Duplex</th>
<th scope="row">{% trans "Speed/Duplex" %}</th>
<td>
{{ object.speed|humanize_speed|placeholder }} /
{{ object.get_duplex_display|placeholder }}
</td>
</tr>
<tr>
<th scope="row">MTU</th>
<th scope="row">{% trans "MTU" %}</th>
<td>{{ object.mtu|placeholder }}</td>
</tr>
<tr>
<th scope="row">Enabled</th>
<th scope="row">{% trans "Enabled" %}</th>
<td>{% checkmark object.enabled %}</td>
</tr>
<tr>
<th scope="row">Management Only</th>
<th scope="row">{% trans "Management Only" %}</th>
<td>{% checkmark object.mgmt_only %}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }} </td>
</tr>
<tr>
<th scope="row">PoE Mode</th>
<th scope="row">{% trans "PoE Mode" %}</th>
<td>{{ object.get_poe_mode_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">PoE Type</th>
<th scope="row">{% trans "PoE Type" %}</th>
<td>{{ object.get_poe_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">802.1Q Mode</th>
<th scope="row">{% trans "802.1Q Mode" %}</th>
<td>{{ object.get_mode_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Transmit power (dBm)</th>
<th scope="row">{% trans "Transmit power (dBm)" %}</th>
<td>{{ object.tx_power|placeholder }}</td>
</tr>
</table>
</div>
</div>
<div class="card">
<h5 class="card-header">Related Interfaces</h5>
<h5 class="card-header">{% trans "Related Interfaces" %}</h5>
<div class="card-body">
<table class="table table-hover">
<tr>
<th scope="row">Parent</th>
<th scope="row">{% trans "Parent" %}</th>
<td>{{ object.parent|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Bridge</th>
<th scope="row">{% trans "Bridge" %}</th>
<td>{{ object.bridge|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">LAG</th>
<th scope="row">{% trans "LAG" %}</th>
<td>{{ object.lag|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">L2VPN</th>
<th scope="row">{% trans "L2VPN" %}</th>
<td>{{ object.l2vpn_termination.l2vpn|linkify|placeholder }}</td>
</tr>
</table>
@@ -118,19 +119,19 @@
<div class="col col-md-6">
{% include 'inc/panel_table.html' with table=vdc_table heading="Virtual Device Contexts" %}
<div class="card">
<h5 class="card-header">Addressing</h5>
<h5 class="card-header">{% trans "Addressing" %}</h5>
<div class="card-body">
<table class="table table-hover">
<tr>
<th scope="row">MAC Address</th>
<th scope="row">{% trans "MAC Address" %}</th>
<td><span class="font-monospace">{{ object.mac_address|placeholder }}</span></td>
</tr>
<tr>
<th scope="row">WWN</th>
<th scope="row">{% trans "WWN" %}</th>
<td><span class="font-monospace">{{ object.wwn|placeholder }}</span></td>
</tr>
<tr>
<th scope="row">VRF</th>
<th scope="row">{% trans "VRF" %}</th>
<td>{{ object.vrf|linkify|placeholder }}</td>
</tr>
</table>
@@ -138,67 +139,67 @@
</div>
{% if not object.is_virtual %}
<div class="card">
<h5 class="card-header">Connection</h5>
<h5 class="card-header">{% trans "Connection" %}</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as Connected" %}
</div>
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' with trace_url='dcim:interface_trace' %}
{% elif object.wireless_link %}
<table class="table table-hover">
<tr>
<th scope="row">Wireless Link</th>
<th scope="row">{% trans "Wireless Link" %}</th>
<td>
{{ object.wireless_link|linkify }}
<a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<a href="{% url 'dcim:interface_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="{% trans "Trace" %}">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
{% with peer_interface=object.link_peers.0 %}
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ peer_interface.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ peer_interface|linkify }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ peer_interface.get_type_display }}</td>
</tr>
{% endwith %}
</table>
{% else %}
<div class="text-muted">
Not Connected
{% trans "Not Connected" %}
{% if object.is_wired and perms.dcim.add_cable %}
<div class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> {% trans "Connect" %}
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}">Interface</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}">{% trans "Interface" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}">Front Port</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}">{% trans "Front Port" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}">Rear Port</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}">{% trans "Rear Port" %}</a>
</li>
<li>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}">Circuit Termination</a>
<a class="dropdown-item" href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.interface&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}">{% trans "Circuit Termination" %}</a>
</li>
</ul>
</div>
{% elif object.is_wireless and perms.wireless.add_wirelesslink %}
<div class="dropdown float-end">
<a href="{% url 'wireless:wirelesslink_add' %}?interface_a={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
<span class="mdi mdi-wifi-plus" aria-hidden="true"></span> Connect
<span class="mdi mdi-wifi-plus" aria-hidden="true"></span> {% trans "Connect" %}
</a>
</div>
{% endif %}
@@ -209,28 +210,28 @@
{% endif %}
{% if object.is_wireless %}
<div class="card">
<h5 class="card-header">Wireless</h5>
<h5 class="card-header">{% trans "Wireless" %}</h5>
<div class="card-body">
{% with peer=object.connected_endpoints.0 %}
<table class="table table-hover">
<thead>
<tr>
<th></th>
<th>Local</th>
<th>{% trans "Local" %}</th>
{% if peer %}
<th>Peer</th>
<th>{% trans "Peer" %}</th>
{% endif %}
</tr>
</thead>
<tr>
<th scope="row">Role</th>
<th scope="row">{% trans "Role" %}</th>
<td>{{ object.get_rf_role_display|placeholder }}</td>
{% if peer %}
<td>{{ peer.get_rf_role_display|placeholder }}</td>
{% endif %}
</tr>
<tr>
<th scope="row">Channel</th>
<th scope="row">{% trans "Channel" %}</th>
<td>{{ object.get_rf_channel_display|placeholder }}</td>
{% if peer %}
<td{% if peer.rf_channel != object.rf_channel %} class="text-danger"{% endif %}>
@@ -239,10 +240,10 @@
{% endif %}
</tr>
<tr>
<th scope="row">Channel Frequency</th>
<th scope="row">{% trans "Channel Frequency" %}</th>
<td>
{% if object.rf_channel_frequency %}
{{ object.rf_channel_frequency|floatformat:"-2" }} MHz
{{ object.rf_channel_frequency|floatformat:"-2" }} {% trans "MHz" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
@@ -250,7 +251,7 @@
{% if peer %}
<td{% if peer.rf_channel_frequency != object.rf_channel_frequency %} class="text-danger"{% endif %}>
{% if peer.rf_channel_frequency %}
{{ peer.rf_channel_frequency|floatformat:"-2" }} MHz
{{ peer.rf_channel_frequency|floatformat:"-2" }} {% trans "MHz" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
@@ -258,10 +259,10 @@
{% endif %}
</tr>
<tr>
<th scope="row">Channel Width</th>
<th scope="row">{% trans "Channel Width" %}</th>
<td>
{% if object.rf_channel_width %}
{{ object.rf_channel_width|floatformat:"-3" }} MHz
{{ object.rf_channel_width|floatformat:"-3" }} {% trans "MHz" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
@@ -269,7 +270,7 @@
{% if peer %}
<td{% if peer.rf_channel_width != object.rf_channel_width %} class="text-danger"{% endif %}>
{% if peer.rf_channel_width %}
{{ peer.rf_channel_width|floatformat:"-3" }} MHz
{{ peer.rf_channel_width|floatformat:"-3" }} {% trans "MHz" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
@@ -281,13 +282,13 @@
</div>
</div>
<div class="card">
<h5 class="card-header">Wireless LANs</h5>
<h5 class="card-header">{% trans "Wireless LANs" %}</h5>
<div class="card-body">
<table class="table table-hover table-headings">
<thead>
<tr>
<th>Group</th>
<th>SSID</th>
<th>{% trans "Group" %}</th>
<th>{% trans "SSID" %}</th>
</tr>
</thead>
<tbody>
@@ -298,7 +299,7 @@
</tr>
{% empty %}
<tr>
<td colspan="3" class="text-muted">None</td>
<td colspan="3" class="text-muted">{% trans "None" %}</td>
</tr>
{% endfor %}
</tbody>
@@ -308,14 +309,14 @@
{% endif %}
{% if object.is_lag %}
<div class="card">
<h5 class="card-header">LAG Members</h5>
<h5 class="card-header">{% trans "LAG Members" %}</h5>
<div class="card-body">
<table class="table table-hover table-headings">
<thead>
<tr>
<th>Parent</th>
<th>Interface</th>
<th>Type</th>
<th>{% trans "Parent" %}</th>
<th>{% trans "Interface" %}</th>
<th>{% trans "Type" %}</th>
</tr>
</thead>
<tbody>
@@ -327,7 +328,7 @@
</tr>
{% empty %}
<tr>
<td colspan="3" class="text-muted">No member interfaces</td>
<td colspan="3" class="text-muted">{% trans "No member interfaces" %}</td>
</tr>
{% endfor %}
</tbody>
@@ -343,7 +344,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">IP Addresses</h5>
<h5 class="card-header">{% trans "IP Addresses" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'ipam:ipaddress_list' %}?interface_id={{ object.pk }}"
hx-trigger="load"
@@ -351,7 +352,7 @@
{% if perms.ipam.add_ipaddress %}
<div class="card-footer text-end noprint">
<a href="{% url 'ipam:ipaddress_add' %}?device={{ object.device.pk }}&interface={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add IP Address
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add IP Address" %}
</a>
</div>
{% endif %}

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Delete interface {{ interface }}?{% endblock %}
{% block title %}{% blocktrans %}Delete interface {{ interface }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to delete this interface from <strong>{{ interface.device }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to delete this interface from <strong>{{ interface.device }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,51 +14,51 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Inventory Item</h5>
<h5 class="card-header">{% trans "Inventory Item" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Parent Item</th>
<th scope="row">{% trans "Parent Item" %}</th>
<td>{{ object.parent|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Role</th>
<th scope="row">{% trans "Role" %}</th>
<td>{{ object.role|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Component</th>
<th scope="row">{% trans "Component" %}</th>
<td>{{ object.component|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Manufacturer</th>
<th scope="row">{% trans "Manufacturer" %}</th>
<td>{{ object.manufacturer|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Part ID</th>
<th scope="row">{% trans "Part ID" %}</th>
<td>{{ object.part_id|placeholder }}</td>
</tr>
<tr>
<th scope="row">Serial</th>
<th scope="row">{% trans "Serial" %}</th>
<td>{{ object.serial|placeholder }}</td>
</tr>
<tr>
<th scope="row">Asset Tag</th>
<th scope="row">{% trans "Asset Tag" %}</th>
<td>{{ object.asset_tag|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>

View File

@@ -1,5 +1,6 @@
{% extends 'generic/bulk_delete.html' %}
{% load i18n %}
{% block message_extra %}
<p class="text-center text-danger"><i class="mdi mdi-alert"></i> This will also delete all child inventory items of those listed.</p>
<p class="text-center text-danger"><i class="mdi mdi-alert"></i> {% trans "This will also delete all child inventory items of those listed" %}.</p>
{% endblock %}

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Delete inventory item {{ inventoryitem }}?{% endblock %}
{% block title %}{% blocktrans %}Delete inventory item {{ inventoryitem }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to delete this inventory item from <strong>{{ inventoryitem.device }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to delete this inventory item from <strong>{{ inventoryitem.device }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -2,11 +2,12 @@
{% load static %}
{% load form_helpers %}
{% load helpers %}
{% load i18n %}
{% block form %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">InventoryItem</h5>
<h5 class="offset-sm-3">{% trans "Inventory Item" %}</h5>
</div>
{% render_field form.device %}
{% render_field form.parent %}
@@ -19,7 +20,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Hardware</h5>
<h5 class="offset-sm-3">{% trans "Hardware" %}</h5>
</div>
{% render_field form.manufacturer %}
{% render_field form.part_id %}
@@ -29,43 +30,43 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Component Assignment</h5>
<h5 class="offset-sm-3">{% trans "Component Assignment" %}</h5>
</div>
<div class="row mb-2 offset-sm-3">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="consoleport_tab" data-bs-toggle="tab" aria-controls="consoleport" data-bs-target="#consoleport" class="nav-link {% if form.initial.consoleport or form.no_component %}active{% endif %}">
Console Port
{% trans "Console Port" %}
</button>
</li>
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="consoleserverport_tab" data-bs-toggle="tab" aria-controls="consoleserverport" data-bs-target="#consoleserverport" class="nav-link {% if form.initial.consoleserverport %}active{% endif %}">
Console Server Port
{% trans "Console Server Port" %}
</button>
</li>
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="frontport_tab" data-bs-toggle="tab" aria-controls="frontport" data-bs-target="#frontport" class="nav-link {% if form.initial.frontport %}active{% endif %}">
Front Port
{% trans "Front Port" %}
</button>
</li>
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="interface_tab" data-bs-toggle="tab" aria-controls="interface" data-bs-target="#interface" class="nav-link {% if form.initial.interface %}active{% endif %}">
Interface
{% trans "Interface" %}
</button>
</li>
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="poweroutlet_tab" data-bs-toggle="tab" aria-controls="poweroutlet" data-bs-target="#poweroutlet" class="nav-link {% if form.initial.poweroutlet %}active{% endif %}">
Power Outlet
{% trans "Power Outlet" %}
</button>
</li>
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="powerport_tab" data-bs-toggle="tab" aria-controls="powerport" data-bs-target="#powerport" class="nav-link {% if form.initial.powerport %}active{% endif %}">
Power Port
{% trans "Power Port" %}
</button>
</li>
<li role="presentation" class="nav-item">
<button role="tab" type="button" id="rearport_tab" data-bs-toggle="tab" aria-controls="rearport" data-bs-target="#rearport" class="nav-link {% if form.initial.rearport %}active{% endif %}">
Rear Port
{% trans "Rear Port" %}
</button>
</li>
</ul>
@@ -98,7 +99,7 @@
{% if form.custom_fields %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
<h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5>
</div>
{% render_custom_fields form %}
</div>

View File

@@ -2,34 +2,35 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'dcim:inventoryitemrole_list' %}">Inventory Item Roles</a></li>
<li class="breadcrumb-item"><a href="{% url 'dcim:inventoryitemrole_list' %}">{% trans "Inventory Item Roles" %}</a></li>
{% endblock %}
{% block content %}
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Inventory Item Role</h5>
<h5 class="card-header">{% trans "Inventory Item Role" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Color</th>
<th scope="row">{% trans "Color" %}</th>
<td>
<span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
</td>
</tr>
<tr>
<th scope="row">Inventory Items</th>
<th scope="row">{% trans "Inventory Items" %}</th>
<td>
<a href="{% url 'dcim:inventoryitem_list' %}?role_id={{ object.pk }}">{{ inventoryitem_count }}</a>
</td>

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,7 +14,7 @@
{% block extra_controls %}
{% if perms.dcim.add_location %}
<a href="{% url 'dcim:location_add' %}?site={{ object.site.pk }}&parent={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Child Location
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Child Location" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -23,32 +24,32 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Location
{% trans "Location" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Site</th>
<th scope="row">{% trans "Site" %}</th>
<td>{{ object.site|linkify }}</td>
</tr>
<tr>
<th scope="row">Parent</th>
<th scope="row">{% trans "Parent" %}</th>
<td>{{ object.parent|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -73,7 +74,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Child Locations</h5>
<h5 class="card-header">{% trans "Child Locations" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'dcim:location_list' %}?parent_id={{ object.pk }}"
hx-trigger="load"

View File

@@ -2,22 +2,23 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block extra_controls %}
{% if perms.dcim.add_devicetype or perms.dcim.add_moduletype %}
<div class="dropdown">
<button id="add-components" type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add" %}
</button>
<ul class="dropdown-menu" aria-labeled-by="add-components">
{% if perms.dcim.add_devicetype %}
<li><a class="dropdown-item" href="{% url 'dcim:devicetype_add' %}?manufacturer={{ object.pk }}">
Add Device Type
{% trans "Add Device Type" %}
</a></li>
{% endif %}
{% if perms.dcim.add_moduletype %}
<li><a class="dropdown-item" href="{% url 'dcim:moduletype_add' %}?manufacturer={{ object.pk }}">
Add Module Type
{% trans "Add Module Type" %}
</a></li>
{% endif %}
</ul>
@@ -30,16 +31,16 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Manufacturer
{% trans "Manufacturer" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load tz %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,29 +15,29 @@
{% if perms.dcim.change_module %}
<div class="dropdown">
<button id="add-components" type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Components
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
</button>
<ul class="dropdown-menu" aria-labeled-by="add-components">
{% if perms.dcim.add_consoleport %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_consoleports' pk=object.device.pk %}">Console Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_consoleports' pk=object.device.pk %}">{% trans "Console Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_consoleserverport %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_consoleserverports' pk=object.device.pk %}">Console Server Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_consoleserverports' pk=object.device.pk %}">{% trans "Console Server Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_powerport %}
<li><a class="dropdown-item" href="{% url 'dcim:powerport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_powerports' pk=object.device.pk %}">Power Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:powerport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_powerports' pk=object.device.pk %}">{% trans "Power Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_poweroutlet %}
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlet_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_poweroutlets' pk=object.device.pk %}">Power Outlets</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlet_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_poweroutlets' pk=object.device.pk %}">{% trans "Power Outlets" %}</a></li>
{% endif %}
{% if perms.dcim.add_interface %}
<li><a class="dropdown-item" href="{% url 'dcim:interface_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_interfaces' pk=object.device.pk %}">Interfaces</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:interface_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_interfaces' pk=object.device.pk %}">{% trans "Interfaces" %}</a></li>
{% endif %}
{% if perms.dcim.add_frontport %}
<li><a class="dropdown-item" href="{% url 'dcim:frontport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_frontports' pk=object.device.pk %}">Front Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:frontport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_frontports' pk=object.device.pk %}">{% trans "Front Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_rearport %}
<li><a class="dropdown-item" href="{% url 'dcim:rearport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_rearports' pk=object.device.pk %}">Rear Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:rearport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_rearports' pk=object.device.pk %}">{% trans "Rear Ports" %}</a></li>
{% endif %}
</ul>
</div>
@@ -47,35 +48,35 @@
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Module</h5>
<h5 class="card-header">{% trans "Module" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Device Type</th>
<th scope="row">{% trans "Device Type" %}</th>
<td>{{ object.device.device_type|linkify }}</td>
</tr>
<tr>
<th scope="row">Module Type</th>
<th scope="row">{% trans "Module Type" %}</th>
<td>{{ object.module_type|linkify }}</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Serial Number</th>
<th scope="row">{% trans "Serial Number" %}</th>
<td class="font-monospace">{{ object.serial|placeholder }}</td>
</tr>
<tr>
<th scope="row">Asset Tag</th>
<th scope="row">{% trans "Asset Tag" %}</th>
<td class="font-monospace">{{ object.asset_tag|placeholder }}</td>
</tr>
</table>

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,29 +14,29 @@
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Module Bay</h5>
<h5 class="card-header">{% trans "Module Bay" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>
<a href="{% url 'dcim:device_modulebays' pk=object.device.pk %}">{{ object.device }}</a>
</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Position</th>
<th scope="row">{% trans "Position" %}</th>
<td>{{ object.position|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -47,35 +48,35 @@
<div class="col col-md-6">
{% include 'inc/panels/custom_fields.html' %}
<div class="card">
<h5 class="card-header">Installed Module</h5>
<h5 class="card-header">{% trans "Installed Module" %}</h5>
<div class="card-body">
{% if object.installed_module %}
{% with module=object.installed_module %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ module|linkify }}</td>
</tr>
<tr>
<th scope="row">Manufacturer</th>
<th scope="row">{% trans "Manufacturer" %}</th>
<td>{{ module.module_type.manufacturer|linkify }}</td>
</tr>
<tr>
<th scope="row">Module Type</th>
<th scope="row">{% trans "Module Type" %}</th>
<td>{{ module.module_type|linkify }}</td>
</tr>
<tr>
<th scope="row">Serial Number</th>
<th scope="row">{% trans "Serial Number" %}</th>
<td class="font-monospace">{{ module.serial|placeholder }}</td>
</tr>
<tr>
<th scope="row">Asset Tag</th>
<th scope="row">{% trans "Asset Tag" %}</th>
<td class="font-monospace">{{ module.asset_tag|placeholder }}</td>
</tr>
</table>
{% endwith %}
{% else %}
<div class="text-muted">None</div>
<div class="text-muted">{% trans "None" %}</div>
{% endif %}
</div>
</div>

View File

@@ -2,32 +2,33 @@
{% load buttons %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Module Type</h5>
<h5 class="card-header">{% trans "Module Type" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<td>Manufacturer</td>
<td>{% trans "Manufacturer" %}</td>
<td>{{ object.manufacturer|linkify }}</td>
</tr>
<tr>
<td>Model Name</td>
<td>{% trans "Model Name" %}</td>
<td>{{ object.model }}</td>
</tr>
<tr>
<td>Part Number</td>
<td>{% trans "Part Number" %}</td>
<td>{{ object.part_number|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<td>Weight</td>
<td>{% trans "Weight" %}</td>
<td>
{% if object.weight %}
{{ object.weight|floatformat }} {{ object.get_weight_unit_display }}

View File

@@ -2,6 +2,7 @@
{% load buttons %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block title %}{{ object.manufacturer }} {{ object.model }}{% endblock %}
@@ -14,29 +15,29 @@
{% if perms.dcim.change_devicetype %}
<div class="dropdown">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle"data-bs-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Components
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
</button>
<ul class="dropdown-menu">
{% if perms.dcim.add_consoleporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_consoleports' pk=object.pk %}">Console Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_consoleports' pk=object.pk %}">{% trans "Console Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_consoleserverporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_consoleserverports' pk=object.pk %}">Console Server Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:consoleserverporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_consoleserverports' pk=object.pk %}">{% trans "Console Server Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_powerporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:powerporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_powerports' pk=object.pk %}">Power Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:powerporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_powerports' pk=object.pk %}">{% trans "Power Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_poweroutlettemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlettemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_poweroutlets' pk=object.pk %}">Power Outlets</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:poweroutlettemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_poweroutlets' pk=object.pk %}">{% trans "Power Outlets" %}</a></li>
{% endif %}
{% if perms.dcim.add_interfacetemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:interfacetemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_interfaces' pk=object.pk %}">Interfaces</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:interfacetemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_interfaces' pk=object.pk %}">{% trans "Interfaces" %}</a></li>
{% endif %}
{% if perms.dcim.add_frontporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:frontporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_frontports' pk=object.pk %}">Front Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:frontporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_frontports' pk=object.pk %}">{% trans "Front Ports" %}</a></li>
{% endif %}
{% if perms.dcim.add_rearporttemplate %}
<li><a class="dropdown-item" href="{% url 'dcim:rearporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_rearports' pk=object.pk %}">Rear Ports</a></li>
<li><a class="dropdown-item" href="{% url 'dcim:rearporttemplate_add' %}?module_type={{ object.pk }}&return_url={% url 'dcim:moduletype_rearports' pk=object.pk %}">{% trans "Rear Ports" %}</a></li>
{% endif %}
</ul>
</div>

View File

@@ -1,6 +1,7 @@
{% extends 'dcim/moduletype/base.html' %}
{% load render_table from django_tables2 %}
{% load helpers %}
{% load i18n %}
{% block content %}
{% if perms.dcim.change_moduletype %}
@@ -14,19 +15,19 @@
<div class="card-footer noprint">
{% if table.rows %}
<button type="submit" name="_edit" formaction="{% url table.Meta.model|viewname:"bulk_rename" %}?return_url={{ return_url }}" class="btn btn-sm btn-warning">
<span class="mdi mdi-pencil-outline" aria-hidden="true"></span> Rename
<span class="mdi mdi-pencil-outline" aria-hidden="true"></span> {% trans "Rename" %}
</button>
<button type="submit" name="_edit" formaction="{% url table.Meta.model|viewname:"bulk_edit" %}?return_url={{ return_url }}" class="btn btn-sm btn-warning">
<span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
<span class="mdi mdi-pencil" aria-hidden="true"></span> {% trans "Edit" %}
</button>
<button type="submit" name="_delete" formaction="{% url table.Meta.model|viewname:"bulk_delete" %}?return_url={{ return_url }}" class="btn btn-sm btn-danger">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
<div class="float-end">
<a href="{% url table.Meta.model|viewname:"add" %}?module_type={{ object.pk }}&return_url={{ return_url }}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
Add {{ title }}
{% blocktrans %}Add {{ title }}{% endblocktrans %}
</a>
</div>
<div class="clearfix"></div>

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,7 +14,7 @@
{% block extra_controls %}
{% if perms.dcim.add_device %}
<a href="{% url 'dcim:device_add' %}?device_role={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Device
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Device" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -23,34 +24,34 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Platform
{% trans "Platform" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Manufacturer</th>
<th scope="row">{% trans "Manufacturer" %}</th>
<td>{{ object.manufacturer|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Config Template</th>
<th scope="row">{% trans "Config Template" %}</th>
<td>{{ object.config_template|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">
NAPALM Driver
{% trans "NAPALM Driver" %}
<i
class="mdi mdi-alert-box text-warning"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="This field has been deprecated, and will be removed in NetBox v3.6."
title="{% trans "This field has been deprecated, and will be removed in NetBox v3.6" %}."
></i>
</th>
</tr>

View File

@@ -3,6 +3,7 @@
{% load static %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -18,32 +19,32 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Power Feed
{% trans "Power Feed" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Power Panel</th>
<th scope="row">{% trans "Power Panel" %}</th>
<td>{{ object.power_panel|linkify }}</td>
</tr>
<tr>
<th scope="row">Rack</th>
<th scope="row">{% trans "Rack" %}</th>
<td>{{ object.rack|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{% badge object.get_type_display bg_color=object.get_type_color %}</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Connected Device</th>
<th scope="row">{% trans "Connected Device" %}</th>
<td>
{% if object.connected_endpoints %}
{{ object.connected_endpoints.0.device|linkify }} ({{ object.connected_endpoints.0|linkify:"name" }})
@@ -53,17 +54,17 @@
</td>
</tr>
<tr>
<th scope="row">Utilization (Allocated)</th>
<th scope="row">{% trans "Utilization (Allocated" %})</th>
{% with utilization=object.connected_endpoints.0.get_power_draw %}
{% if utilization %}
<td>
{{ utilization.allocated }}VA / {{ object.available_power }}VA
{{ utilization.allocated }}{% trans "VA" %} / {{ object.available_power }}{% trans "VA" %}
{% if object.available_power > 0 %}
{% utilization_graph utilization.allocated|percentage:object.available_power %}
{% endif %}
</td>
{% else %}
<td class="text-muted">N/A</td>
<td class="text-muted">{% trans "N/A" %}</td>
{% endif %}
{% endwith %}
</tr>
@@ -72,28 +73,28 @@
</div>
<div class="card">
<h5 class="card-header">
Electrical Characteristics
{% trans "Electrical Characteristics" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Supply</th>
<th scope="row">{% trans "Supply" %}</th>
<td>{{ object.get_supply_display }}</td>
</tr>
<tr>
<th scope="row">Voltage</th>
<td>{{ object.voltage }}V</td>
<th scope="row">{% trans "Voltage" %}</th>
<td>{{ object.voltage }}{% trans "V" context "Abbreviation for volts" %}</td>
</tr>
<tr>
<th scope="row">Amperage</th>
<td>{{ object.amperage }}A</td>
<th scope="row">{% trans "Amperage" %}</th>
<td>{{ object.amperage }}{% trans "A" context "Abbreviation for amperes" %}</td>
</tr>
<tr>
<th scope="row">Phase</th>
<th scope="row">{% trans "Phase" %}</th>
<td>{{ object.get_phase_display }}</td>
</tr>
<tr>
<th scope="row">Max Utilization</th>
<th scope="row">{% trans "Max Utilization" %}</th>
<td>{{ object.max_utilization }}%</td>
</tr>
</table>
@@ -105,17 +106,17 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Connection</h5>
<h5 class="card-header">{% trans "Connection" %}</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as connected" %}
</div>
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' with trace_url='dcim:powerfeed_trace' %}
{% else %}
<div class="text-muted">
Not connected
{% trans "Not connected" %}
</div>
{% endif %}
</div>
@@ -123,7 +124,7 @@
<div class="card-footer">
{% if perms.dcim.add_cable %}
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerfeed&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Connect
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> {% trans "Connect" %}
</a>
{% endif %}
</div>

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,40 +15,40 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Power Outlet
{% trans "Power Outlet" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ object.module|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Power Port</th>
<th scope="row">{% trans "Power Port" %}</th>
<td>{{ object.power_port|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Feed Leg</th>
<th scope="row">{% trans "Feed Leg" %}</th>
<td>{{ object.get_feed_leg_display|placeholder }}</td>
</tr>
</table>
@@ -59,20 +60,20 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Connection</h5>
<h5 class="card-header">{% trans "Connection" %}</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as Connected" %}
</div>
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' with trace_url='dcim:poweroutlet_trace' %}
{% else %}
<div class="text-muted">
Not Connected
{% trans "Not Connected" %}
{% if perms.dcim.add_cable %}
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.poweroutlet&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&return_url={{ object.get_absolute_url }}" title="Connect" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> Connect
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.poweroutlet&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerport&return_url={{ object.get_absolute_url }}" title="{% trans "Connect" %}" class="btn btn-primary btn-sm float-end">
<i class="mdi mdi-ethernet-cable" aria-hidden="true"></i> {% trans "Connect" %}
</a>
{% endif %}
</div>

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Delete power outlet {{ poweroutlet }}?{% endblock %}
{% block title %}{% blocktrans %}Delete power outlet {{ poweroutlet }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to delete this power outlet from <strong>{{ poweroutlet.device }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to delete this power outlet from <strong>{{ poweroutlet.device }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -15,19 +16,19 @@
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Power Panel</h5>
<h5 class="card-header">{% trans "Power Panel" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Site</th>
<th scope="row">{% trans "Site" %}</th>
<td>{{ object.site|linkify }}</td>
</tr>
<tr>
<th scope="row">Location</th>
<th scope="row">{% trans "Location" %}</th>
<td>{{ object.location|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -49,7 +50,7 @@
<form method="post">
{% csrf_token %}
<div class="card">
<h5 class="card-header">Power Feeds</h5>
<h5 class="card-header">{% trans "Power Feeds" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'dcim:powerfeed_list' %}?power_panel_id={{ object.pk }}"
hx-trigger="load"
@@ -57,23 +58,23 @@
<div class="card-footer noprint">
{% if perms.dcim.change_powerfeed %}
<button type="submit" name="_edit" formaction="{% url 'dcim:powerfeed_bulk_edit' %}?return_url={% url 'dcim:powerpanel' pk=object.pk %}" class="btn btn-warning btn-sm">
<span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
<span class="mdi mdi-pencil" aria-hidden="true"></span> {% trans "Edit" %}
</button>
{% endif %}
{% if perms.dcim.delete_cable %}
<button type="submit" name="_disconnect" formaction="{% url 'dcim:powerfeed_bulk_disconnect' %}?return_url={% url 'dcim:powerpanel' pk=object.pk %}" class="btn btn-outline-danger btn-sm">
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> Disconnect
<span class="mdi mdi-ethernet-cable-off" aria-hidden="true"></span> {% trans "Disconnect" %}
</button>
{% endif %}
{% if perms.dcim.delete_powerfeed %}
<button type="submit" name="_delete" formaction="{% url 'dcim:powerfeed_bulk_delete' %}?return_url={% url 'dcim:powerpanel' pk=object.pk %}" class="btn btn-danger btn-sm">
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> {% trans "Delete" %}
</button>
{% endif %}
{% if perms.dcim.add_powerfeed %}
<div class="float-end">
<a href="{% url 'dcim:powerfeed_add' %}?power_panel={{ object.pk }}&return_url={% url 'dcim:powerpanel' pk=object.pk %}" class="btn btn-primary btn-sm">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Power Feeds
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Power Feeds" %}
</a>
</div>
{% endif %}

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,40 +15,40 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Power Port
{% trans "Power Port" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ object.module|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Maximum Draw</th>
<th scope="row">{% trans "Maximum Draw" %}</th>
<td>{{ object.maximum_draw|placeholder }}</td>
</tr>
<tr>
<th scope="row">Allocated Draw</th>
<th scope="row">{% trans "Allocated Draw" %}</th>
<td>{{ object.allocated_draw|placeholder }}</td>
</tr>
</table>
@@ -59,28 +60,28 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Connection</h5>
<h5 class="card-header">{% trans "Connection" %}</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as Connected" %}
</div>
{% elif object.cable %}
{% include 'dcim/inc/connection_endpoints.html' with trace_url='dcim:powerport_trace' %}
{% else %}
<div class="text-muted">
Not Connected
{% trans "Not Connected" %}
{% if perms.dcim.add_cable %}
<span class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> {% trans "Connect" %}
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerport&a_terminations={{ object.pk }}&b_terminations_type=dcim.poweroutlet&return_url={{ object.get_absolute_url }}" class="dropdown-item">Power Outlet</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerport&a_terminations={{ object.pk }}&b_terminations_type=dcim.poweroutlet&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Power Outlet" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerport&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerfeed&return_url={{ object.get_absolute_url }}" class="dropdown-item">Power Feed</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.powerport&a_terminations={{ object.pk }}&b_terminations_type=dcim.powerfeed&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Power Feed" %}</a>
</li>
</ul>
</span>

View File

@@ -1,8 +1,9 @@
{% extends 'generic/confirmation_form.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Delete power port {{ powerport }}?{% endblock %}
{% block title %}{% blocktrans %}Delete power port {{ powerport }}?{% endblocktrans %}{% endblock %}
{% block message %}
<p>Are you sure you want to delete this power port from <strong>{{ powerport.device }}</strong>?</p>
<p>{% blocktrans %}Are you sure you want to delete this power port from <strong>{{ powerport.device }}</strong>?{% endblocktrans %}</p>
{% endblock %}

View File

@@ -3,18 +3,19 @@
{% load helpers %}
{% load static %}
{% load plugins %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col col-12 col-xl-5">
<div class="card">
<h5 class="card-header">
Rack
{% trans "Rack" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Site</th>
<th scope="row">{% trans "Site" %}</th>
<td>
{% if object.site.region %}
{{ object.site.region|linkify }} /
@@ -23,7 +24,7 @@
</td>
</tr>
<tr>
<th scope="row">Location</th>
<th scope="row">{% trans "Location" %}</th>
<td>
{% if object.location %}
{% for location in object.location.get_ancestors %}
@@ -36,11 +37,11 @@
</td>
</tr>
<tr>
<th scope="row">Facility ID</th>
<th scope="row">{% trans "Facility ID" %}</th>
<td>{{ object.facility_id|placeholder }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -49,42 +50,42 @@
</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Role</th>
<th scope="row">{% trans "Role" %}</th>
<td>{{ object.role|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Serial Number</th>
<th scope="row">{% trans "Serial Number" %}</th>
<td class="font-monospace">{{ object.serial|placeholder }}</td>
</tr>
<tr>
<th scope="row">Asset Tag</th>
<th scope="row">{% trans "Asset Tag" %}</th>
<td class="font-monospace">{{ object.asset_tag|placeholder }}</td>
</tr>
<tr>
<th scope="row">Space Utilization</th>
<th scope="row">{% trans "Space Utilization" %}</th>
<td>{% utilization_graph object.get_utilization %}</td>
</tr>
<tr>
<th scope="row">Power Utilization</th>
<th scope="row">{% trans "Power Utilization" %}</th>
<td>{% utilization_graph object.get_power_utilization %}</td>
</tr>
</table>
</div>
</div>
<div class="card">
<h5 class="card-header">Dimensions</h5>
<h5 class="card-header">{% trans "Dimensions" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>
{% if object.type %}
{{ object.get_type_display }}
@@ -94,21 +95,21 @@
</td>
</tr>
<tr>
<th scope="row">Width</th>
<th scope="row">{% trans "Width" %}</th>
<td>{{ object.get_width_display }}</td>
</tr>
<tr>
<th scope="row">Height</th>
<td>{{ object.u_height }}U ({% if object.desc_units %}descending{% else %}ascending{% endif %})</td>
<th scope="row">{% trans "Height" %}</th>
<td>{{ object.u_height }}U ({% if object.desc_units %}{% trans "descending" %}{% else %}{% trans "ascending" %}{% endif %})</td>
</tr>
<tr>
<th scope="row">Starting Unit</th>
<th scope="row">{% trans "Starting Unit" %}</th>
<td>
{{ object.starting_unit }}
</td>
</tr>
<tr>
<th scope="row">Outer Width</th>
<th scope="row">{% trans "Outer Width" %}</th>
<td>
{% if object.outer_width %}
{{ object.outer_width }} {{ object.get_outer_unit_display }}
@@ -118,7 +119,7 @@
</td>
</tr>
<tr>
<th scope="row">Outer Depth</th>
<th scope="row">{% trans "Outer Depth" %}</th>
<td>
{% if object.outer_depth %}
{{ object.outer_depth }} {{ object.get_outer_unit_display }}
@@ -128,17 +129,17 @@
</td>
</tr>
<tr>
<th scope="row">Mounting Depth</th>
<th scope="row">{% trans "Mounting Depth" %}</th>
<td>
{% if object.mounting_depth %}
{{ object.mounting_depth }} Millimeters
{{ object.mounting_depth }} {% trans "Millimeters" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Rack Weight</th>
<th scope="row">{% trans "Rack Weight" %}</th>
<td>
{% if object.weight %}
{{ object.weight|floatformat }} {{ object.get_weight_unit_display }}
@@ -148,7 +149,7 @@
</td>
</tr>
<tr>
<th scope="row">Maximum Weight</th>
<th scope="row">{% trans "Maximum Weight" %}</th>
<td>
{% if object.max_weight %}
{{ object.max_weight }} {{ object.get_weight_unit_display }}
@@ -158,10 +159,10 @@
</td>
</tr>
<tr>
<th scope="row">Total Weight</th>
<th scope="row">{% trans "Total Weight" %}</th>
<td>
{{ object.total_weight|floatformat }} Kilograms
({{ object.total_weight|kg_to_pounds|floatformat }} Pounds)
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
({{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %})
</td>
</tr>
</table>
@@ -176,21 +177,21 @@
<div class="col col-12 col-xl-7">
<div class="text-end mb-4">
<select class="btn btn-sm btn-outline-dark rack-view">
<option value="images-and-labels" selected="selected">Images and Labels</option>
<option value="images-only">Images only</option>
<option value="labels-only">Labels only</option>
<option value="images-and-labels" selected="selected">{% trans "Images and Labels" %}</option>
<option value="images-only">{% trans "Images only" %}</option>
<option value="labels-only">{% trans "Labels only" %}</option>
</select>
</div>
<div class="row" style="margin-bottom: 20px">
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
<h4>Front</h4>
<h4>{% trans "Front" %}</h4>
{% include 'dcim/inc/rack_elevation.html' with face='front' extra_params=svg_extra %}
</div>
</div>
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
<h4>Rear</h4>
<h4>{% trans "Rear" %}</h4>
{% include 'dcim/inc/rack_elevation.html' with face='rear' extra_params=svg_extra %}
</div>
</div>

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load i18n %}
{% block title %}Rack {{ object }}{% endblock %}
{% block title %}{% blocktrans %}Rack {{ object }}{% endblocktrans %}{% endblock %}
{% block breadcrumbs %}
{{ block.super }}

View File

@@ -1,5 +1,6 @@
{% extends 'dcim/rack/base.html' %}
{% load helpers %}
{% load i18n %}
{% block content %}
{% include 'inc/table_controls_htmx.html' with table_modal="RackReservationTable_config" %}
@@ -17,19 +18,19 @@
<div class="bulk-button-group">
{% if 'bulk_edit' in actions %}
<button type="submit" name="_edit" formaction="{% url 'dcim:rackreservation_bulk_edit' %}?return_url={% url 'dcim:rack_reservations' pk=object.pk %}" class="btn btn-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</button>
{% endif %}
{% if 'bulk_delete' in actions %}
<button type="submit" formaction="{% url 'dcim:rackreservation_bulk_delete' %}?return_url={% url 'dcim:rack_reservations' pk=object.pk %}" class="btn btn-danger btn-sm">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> {% trans "Delete" %}
</button>
{% endif %}
</div>
{% if perms.dcim.add_rackreservation %}
<div class="bulk-button-group">
<a href="{% url 'dcim:rackreservation_add' %}?rack={{ object.pk }}&return_url={% url 'dcim:rack_reservations' pk=object.pk %}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add reservation
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add reservation" %}
</a>
</div>
{% endif %}

View File

@@ -1,10 +1,11 @@
{% extends 'generic/object_edit.html' %}
{% load form_helpers %}
{% load i18n %}
{% block form %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Rack</h5>
<h5 class="offset-sm-3">{% trans "Rack" %}</h5>
</div>
{% render_field form.site %}
{% render_field form.location %}
@@ -17,7 +18,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Inventory Control</h5>
<h5 class="offset-sm-3">{% trans "Inventory Control" %}</h5>
</div>
{% render_field form.facility_id %}
{% render_field form.serial %}
@@ -26,7 +27,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
<h5 class="offset-sm-3">{% trans "Tenancy" %}</h5>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
@@ -34,39 +35,39 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Dimensions</h5>
<h5 class="offset-sm-3">{% trans "Dimensions" %}</h5>
</div>
{% render_field form.type %}
{% render_field form.width %}
{% render_field form.u_height %}
<div class="row mb-3">
<label class="col col-md-3 col-form-label text-lg-end">Outer Dimensions</label>
<label class="col col-md-3 col-form-label text-lg-end">{% trans "Outer Dimensions" %}</label>
<div class="col col-md-3 mb-1">
{{ form.outer_width }}
<div class="form-text">Width</div>
<div class="form-text">{% trans "Width" %}</div>
</div>
<div class="col col-md-3 mb-1">
{{ form.outer_depth }}
<div class="form-text">Depth</div>
<div class="form-text">{% trans "Depth" %}</div>
</div>
<div class="col col-md-3 mb-1">
{{ form.outer_unit }}
<div class="form-text">Unit</div>
<div class="form-text">{% trans "Unit" %}</div>
</div>
</div>
<div class="row mb-3">
<label class="col col-md-3 col-form-label text-lg-end">Weight</label>
<label class="col col-md-3 col-form-label text-lg-end">{% trans "Weight" %}</label>
<div class="col col-md-3 mb-1">
{{ form.weight }}
<div class="form-text">Weight</div>
<div class="form-text">{% trans "Weight" %}</div>
</div>
<div class="col col-md-3 mb-1">
{{ form.max_weight }}
<div class="form-text">Maximum Weight</div>
<div class="form-text">{% trans "Maximum Weight" %}</div>
</div>
<div class="col col-md-3 mb-1">
{{ form.weight_unit }}
<div class="form-text">Unit</div>
<div class="form-text">{% trans "Unit" %}</div>
</div>
</div>
{% render_field form.mounting_depth %}
@@ -77,7 +78,7 @@
{% if form.custom_fields %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
<h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5>
</div>
{% render_custom_fields form %}
</div>

View File

@@ -1,29 +1,30 @@
{% extends 'generic/object_list.html' %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block title %}Rack Elevations{% endblock %}
{% block title %}{% trans "Rack Elevations" %}{% endblock %}
{% block controls %}
<div class="controls">
<div class="control-group">
<a href="{% url 'dcim:rack_list' %}{% querystring request %}" class="btn btn-sm btn-primary">
<i class="mdi mdi-format-list-checkbox"></i> View List
<i class="mdi mdi-format-list-checkbox"></i> {% trans "View List" %}
</a>
<div class="btn-group btn-group-sm" role="group">
<select class="btn btn-sm btn-outline-secondary rack-view">
<option value="images-and-labels" selected="selected">Images and Labels</option>
<option value="images-only">Images only</option>
<option value="labels-only">Labels only</option>
<option value="images-and-labels" selected="selected">{% trans "Images and Labels" %}</option>
<option value="images-only">{% trans "Images only" %}</option>
<option value="labels-only">{% trans "Labels only" %}</option>
</select>
</div>
<div class="btn-group btn-group-sm" role="group">
<a href="{% url 'dcim:rack_elevation_list' %}{% querystring request face='front' %}" class="btn btn-outline-secondary{% if rack_face == 'front' %} active{% endif %}">Front</a>
<a href="{% url 'dcim:rack_elevation_list' %}{% querystring request face='rear' %}" class="btn btn-outline-secondary{% if rack_face == 'rear' %} active{% endif %}">Rear</a>
<a href="{% url 'dcim:rack_elevation_list' %}{% querystring request face='front' %}" class="btn btn-outline-secondary{% if rack_face == 'front' %} active{% endif %}">{% trans "Front" %}</a>
<a href="{% url 'dcim:rack_elevation_list' %}{% querystring request face='rear' %}" class="btn btn-outline-secondary{% if rack_face == 'rear' %} active{% endif %}">{% trans "Rear" %}</a>
</div>
<div class="dropdown">
<button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="mdi mdi-sort"></i>&nbsp;Sort By {{ sort_display_name }}
<i class="mdi mdi-sort"></i> {% trans "Sort By" %} {{ sort_display_name }}
</button>
<ul class="dropdown-menu dropdown-menu-end">
{% for sort_key, sort_display_name in sort_choices.items %}
@@ -73,7 +74,7 @@
<br />
{% include 'inc/paginator.html' %}
{% else %}
<p>No Racks Found</p>
<p>{% trans "No Racks Found" %}</p>
{% endif %}
</div>

View File

@@ -1,9 +1,10 @@
{% extends 'generic/object_list.html' %}
{% load helpers %}
{% load static %}
{% load i18n %}
{% block extra_controls %}
<a href="{% url 'dcim:rack_elevation_list' %}{% querystring request %}" class="btn btn-sm btn-primary">
<i class="mdi mdi-view-day-outline"></i> View Elevations
<i class="mdi mdi-view-day-outline"></i> {% trans "View Elevations" %}
</a>
{% endblock %}

View File

@@ -3,11 +3,12 @@
{% load helpers %}
{% load static %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
<li class="breadcrumb-item"><a href="{% url 'dcim:rackreservation_list' %}?rack_id={{ object.rack.pk }}">{{ object.rack }}</a></li>
<li class="breadcrumb-item">Units {{ object.unit_list }}</li>
<li class="breadcrumb-item">{% trans "Units" %} {{ object.unit_list }}</li>
{% endblock %}
{% block content %}
@@ -15,13 +16,13 @@
<div class="col col-12 col-xl-5">
<div class="card">
<h5 class="card-header">
Rack
{% trans "Rack" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
{% with rack=object.rack %}
<tr>
<th scope="row">Site</th>
<th scope="row">{% trans "Site" %}</th>
<td>
{% if rack.site.region %}
{{ rack.site.region|linkify }} /
@@ -30,11 +31,11 @@
</td>
</tr>
<tr>
<th scope="row">Location</th>
<th scope="row">{% trans "Location" %}</th>
<td>{{ rack.location|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Rack</th>
<th scope="row">{% trans "Rack" %}</th>
<td>{{ rack|linkify }}</td>
</tr>
{% endwith %}
@@ -43,16 +44,16 @@
</div>
<div class="card">
<h5 class="card-header">
Reservation Details
{% trans "Reservation Details" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Units</th>
<th scope="row">{% trans "Units" %}</th>
<td>{{ object.unit_list }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -61,11 +62,11 @@
</td>
</tr>
<tr>
<th scope="row">User</th>
<th scope="row">{% trans "User" %}</th>
<td>{{ object.user }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description }}</td>
</tr>
</table>
@@ -80,13 +81,13 @@
<div class="row" style="margin-bottom: 20px">
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
<h4>Front</h4>
<h4>{% trans "Front" %}</h4>
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='front' %}
</div>
</div>
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: -30px">
<h4>Rear</h4>
<h4>{% trans "Rear" %}</h4>
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='rear' %}
</div>
</div>

View File

@@ -2,11 +2,12 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block extra_controls %}
{% if perms.dcim.add_rack %}
<a href="{% url 'dcim:rack_add' %}?role={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Rack
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Rack" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -16,20 +17,20 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Rack Role
{% trans "Rack Role" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Color</th>
<th scope="row">{% trans "Color" %}</th>
<td>
<span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
</td>

View File

@@ -1,6 +1,7 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -14,32 +15,32 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Rear Port
{% trans "Rear Port" %}
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Device</th>
<th scope="row">{% trans "Device" %}</th>
<td>{{ object.device|linkify }}</td>
</tr>
<tr>
<th scope="row">Module</th>
<th scope="row">{% trans "Module" %}</th>
<td>{{ object.module|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>
<th scope="row">{% trans "Label" %}</th>
<td>{{ object.label|placeholder }}</td>
</tr>
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">Color</th>
<th scope="row">{% trans "Color" %}</th>
<td>
{% if object.color %}
<span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
@@ -49,11 +50,11 @@
</td>
</tr>
<tr>
<th scope="row">Positions</th>
<th scope="row">{% trans "Positions" %}</th>
<td>{{ object.positions }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -66,26 +67,26 @@
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Connection
{% trans "Connection" %}
</h5>
<div class="card-body">
{% if object.mark_connected %}
<div class="text-muted">
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> Marked as Connected
<span class="text-success"><i class="mdi mdi-check-bold"></i></span> {% trans "Marked as Connected" %}
</div>
{% elif object.cable %}
<table class="table table-hover attr-table">
<tr>
<th scope="row">Cable</th>
<th scope="row">{% trans "Cable" %}</th>
<td>
{{ object.cable|linkify }}
<a href="{% url 'dcim:rearport_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<a href="{% url 'dcim:rearport_trace' pk=object.pk %}" class="btn btn-primary btn-sm lh-1" title="{% trans "Trace" %}">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
</a>
</td>
</tr>
<tr>
<th scope="row">Connection Status</th>
<th scope="row">{% trans "Connection Status" %}</th>
<td>
{% if object.cable.status %}
<span class="badge bg-success">{{ object.cable.get_status_display }}</span>
@@ -97,24 +98,24 @@
</table>
{% else %}
<div class="text-muted">
Not connected
{% trans "Not connected" %}
{% if perms.dcim.add_cable %}
<span class="dropdown float-end">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> Connect
<span class="mdi mdi-ethernet-cable" aria-hidden="true"></span> {% trans "Connect" %}
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}" class="dropdown-item">Interface</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=dcim.interface&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Interface" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Front Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=dcim.frontport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Front Port" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}" class="dropdown-item">Rear Port</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=dcim.rearport&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Rear Port" %}</a>
</li>
<li>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}" class="dropdown-item">Circuit Termination</a>
<a href="{% url 'dcim:cable_add' %}?a_terminations_type=dcim.rearport&a_terminations={{ object.pk }}&b_terminations_type=circuits.circuittermination&return_url={{ object.get_absolute_url }}" class="dropdown-item">{% trans "Circuit Termination" %}</a>
</li>
</ul>
</span>

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,7 +14,7 @@
{% block extra_controls %}
{% if perms.dcim.add_site %}
<a href="{% url 'dcim:site_add' %}?region={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Site
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Site" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -22,19 +23,19 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Region</h5>
<h5 class="card-header">{% trans "Region" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Parent</th>
<th scope="row">{% trans "Parent" %}</th>
<td>{{ object.parent|linkify|placeholder }}</td>
</tr>
</table>
@@ -52,7 +53,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Child Regions</h5>
<h5 class="card-header">{% trans "Child Regions" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'dcim:region_list' %}?parent_id={{ object.pk }}"
hx-trigger="load"
@@ -60,7 +61,7 @@
{% if perms.dcim.add_region %}
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:region_add' %}?parent={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Region
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Region" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load tz %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -22,11 +23,11 @@
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Site</h5>
<h5 class="card-header">{% trans "Site" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Region</th>
<th scope="row">{% trans "Region" %}</th>
<td>
{% if object.region %}
{% for region in object.region.get_ancestors %}
@@ -39,7 +40,7 @@
</td>
</tr>
<tr>
<th scope="row">Group</th>
<th scope="row">{% trans "Group" %}</th>
<td>
{% if object.group %}
{% for group in object.group.get_ancestors %}
@@ -52,11 +53,11 @@
</td>
</tr>
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -65,32 +66,32 @@
</td>
</tr>
<tr>
<th scope="row">Facility</th>
<th scope="row">{% trans "Facility" %}</th>
<td>{{ object.facility|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Time Zone</th>
<th scope="row">{% trans "Time Zone" %}</th>
<td>
{% if object.time_zone %}
{{ object.time_zone }} (UTC {{ object.time_zone|tzoffset }})<br />
<small class="text-muted">Site time: {% timezone object.time_zone %}{% annotated_now %}{% endtimezone %}</small>
{{ object.time_zone }} ({% trans "UTC" %} {{ object.time_zone|tzoffset }})<br />
<small class="text-muted">{% trans "Site time" %}: {% timezone object.time_zone %}{% annotated_now %}{% endtimezone %}</small>
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Physical Address</th>
<th scope="row">{% trans "Physical Address" %}</th>
<td class="position-relative">
{% if object.physical_address %}
{% if config.MAPS_URL %}
<div class="position-absolute top-50 end-0 translate-middle-y noprint">
<a href="{{ config.MAPS_URL }}{{ object.physical_address|urlencode }}" target="_blank" class="btn btn-primary btn-sm">
<i class="mdi mdi-map-marker"></i> Map
<i class="mdi mdi-map-marker"></i> {% trans "Map" %}
</a>
</div>
{% endif %}
@@ -101,17 +102,17 @@
</td>
</tr>
<tr>
<th scope="row">Shipping Address</th>
<th scope="row">{% trans "Shipping Address" %}</th>
<td>{{ object.shipping_address|linebreaksbr|placeholder }}</td>
</tr>
<tr>
<th scope="row">GPS Coordinates</th>
<th scope="row">{% trans "GPS Coordinates" %}</th>
<td class="position-relative">
{% if object.latitude and object.longitude %}
{% if config.MAPS_URL %}
<div class="position-absolute top-50 end-0 translate-middle-y noprint">
<a href="{{ config.MAPS_URL }}{{ object.latitude }},{{ object.longitude }}" target="_blank" class="btn btn-primary btn-sm">
<i class="mdi mdi-map-marker"></i> Map It
<i class="mdi mdi-map-marker"></i> {% trans "Map It" %}
</a>
</div>
{% endif %}
@@ -132,14 +133,14 @@
<div class="col col-md-6">
{% include 'inc/panels/related_objects.html' with filter_name='site_id' %}
<div class="card">
<h5 class="card-header">Locations</h5>
<h5 class="card-header">{% trans "Locations" %}</h5>
<div class='card-body'>
{% if locations %}
<table class="table table-hover">
<tr>
<th>Location</th>
<th>Racks</th>
<th>Devices</th>
<th>{% trans "Location" %}</th>
<th>{% trans "Racks" %}</th>
<th>{% trans "Devices" %}</th>
<th></th>
</tr>
{% for location in locations %}
@@ -155,7 +156,7 @@
<a href="{% url 'dcim:device_list' %}?location_id={{ location.pk }}">{{ location.device_count }}</a>
</td>
<td class="text-end noprint">
<a href="{% url 'dcim:rack_elevation_list' %}?location_id={{ location.pk }}" class="btn btn-sm btn-primary" title="View Elevations">
<a href="{% url 'dcim:rack_elevation_list' %}?location_id={{ location.pk }}" class="btn btn-sm btn-primary" title="{% trans "View Elevations" %}">
<i class="mdi mdi-server"></i>
</a>
</td>
@@ -163,13 +164,13 @@
{% endfor %}
</table>
{% else %}
<span class="text-muted">None</span>
<span class="text-muted">{% trans "None" %}</span>
{% endif %}
</div>
{% if perms.dcim.add_location %}
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:location_add' %}?site={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a location
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add a location" %}
</a>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,7 +14,7 @@
{% block extra_controls %}
{% if perms.dcim.add_site %}
<a href="{% url 'dcim:site_add' %}?group={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Site
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Site" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -22,19 +23,19 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Site Group</h5>
<h5 class="card-header">{% trans "Site Group" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Parent</th>
<th scope="row">{% trans "Parent" %}</th>
<td>{{ object.parent|linkify|placeholder }}</td>
</tr>
</table>
@@ -52,7 +53,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Child Groups</h5>
<h5 class="card-header">{% trans "Child Groups" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'dcim:sitegroup_list' %}?parent_id={{ object.pk }}"
hx-trigger="load"
@@ -60,7 +61,7 @@
{% if perms.dcim.add_sitegroup %}
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:sitegroup_add' %}?parent={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Site Group
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Site Group" %}
</a>
</div>
{% endif %}

View File

@@ -1,5 +1,6 @@
{% load helpers %}
{% load i18n %}
<div class="cable" style="border-left-color: #c0c0c0; border-left-style: dashed">
<strong>Attachment</strong>
<strong>{% trans "Attachment" %}</strong>
</div>

View File

@@ -1,9 +1,10 @@
{% load helpers %}
{% load i18n %}
<div class="cable" style="border-left-color: #{% if cable.color == 'ffffff' %}909090; border-left-style: double; border-left-width: 0.4rem;{% else %}{{ cable.color|default:'606060' }};{% endif %} {% if cable.status != 'connected' %} border-left-style: dashed{% endif %}">
<strong>
<a href="{% url 'dcim:cable' pk=cable.pk %}">
{% if cable.label %}<code>{{ cable.label }}</code>{% else %}Cable #{{ cable.pk }}{% endif %}
{% if cable.label %}<code>{{ cable.label }}</code>{% else %}{% trans "Cable" %} #{{ cable.pk }}{% endif %}
</a>
</strong><br />
{% if cable.type %}

View File

@@ -1,5 +1,6 @@
{% load i18n %}
<div class="node">
<strong>{{ circuit|linkify }}</strong><br />
Circuit<br />
{% trans "Circuit" %}<br />
{{ circuit.provider|linkify }}
</div>

View File

@@ -1,5 +1,6 @@
{% load i18n %}
<div class="node">
<strong>{{ powerpanel|linkify }}</strong><br />
Power Panel<br />
{% trans "Power Panel" %}<br />
{{ powerpanel.site|linkify }}
</div>

View File

@@ -2,6 +2,7 @@
{% load buttons %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block buttons %}
{% if perms.dcim.change_virtualchassis %}
@@ -16,19 +17,19 @@
<div class="row">
<div class="col col-md-4">
<div class="card">
<h5 class="card-header">Virtual Chassis</h5>
<h5 class="card-header">{% trans "Virtual Chassis" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Domain</th>
<th scope="row">{% trans "Domain" %}</th>
<td>{{ object.domain|placeholder }}</td>
</tr>
<tr>
<th scope="row">Master</th>
<th scope="row">{% trans "Master" %}</th>
<td>{{ object.master|linkify }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
@@ -50,14 +51,14 @@
</div>
<div class="col col-md-8">
<div class="card">
<h5 class="card-header">Members</h5>
<h5 class="card-header">{% trans "Members" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th>Device</th>
<th>Position</th>
<th>Master</th>
<th>Priority</th>
<th>{% trans "Device" %}</th>
<th>{% trans "Position" %}</th>
<th>{% trans "Master" %}</th>
<th>{% trans "Priority" %}</th>
</tr>
{% for vc_member in members %}
<tr{% if vc_member == device %} class="info"{% endif %}>
@@ -82,7 +83,7 @@
{% if perms.dcim.change_virtualchassis %}
<div class="card-footer text-end noprint">
<a href="{% url 'dcim:virtualchassis_add_member' pk=object.pk %}?site={{ object.master.site.pk }}&rack={{ object.master.rack.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Member
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Member" %}
</a>
</div>
{% endif %}

View File

@@ -1,10 +1,11 @@
{% extends 'generic/object_edit.html' %}
{% load form_helpers %}
{% load i18n %}
{% block form %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Virtual Chassis</h5>
<h5 class="offset-sm-3">{% trans "Virtual Chassis" %}</h5>
</div>
{% render_field form.name %}
{% render_field form.domain %}
@@ -14,7 +15,7 @@
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Member Devices</h5>
<h5 class="offset-sm-3">{% trans "Member Devices" %}</h5>
</div>
{% render_field form.region %}
{% render_field form.site_group %}
@@ -27,7 +28,7 @@
{% if form.custom_fields %}
<div class="field-group my-5">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
<h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5>
</div>
{% render_custom_fields form %}
</div>

View File

@@ -1,7 +1,8 @@
{% extends 'base/layout.html' %}
{% load form_helpers %}
{% load i18n %}
{% block title %}Add New Member to Virtual Chassis {{ virtual_chassis }}{% endblock %}
{% block title %}{% blocktrans %}Add New Member to Virtual Chassis {{ virtual_chassis }}{% endblocktrans %}{% endblock %}
{% block content %}
<form action="" method="post" enctype="multipart/form-data" class="form-object-edit">
@@ -9,16 +10,16 @@
{% csrf_token %}
<div class="card">
<h5 class="card-header">Add New Member</h5>
<h5 class="card-header">{% trans "Add New Member" %}</h5>
<div class="card-body">
{% render_form member_select_form %}
{% render_form membership_form %}
</div>
</div>
<div class="text-end my-3">
<a href="{{ return_url }}" class="btn btn-outline-danger">Cancel</a>
<button type="submit" name="_addanother" class="btn btn-outline-primary">Add Another</button>
<button type="submit" name="_save" class="btn btn-primary">Save</button>
<a href="{{ return_url }}" class="btn btn-outline-danger">{% trans "Cancel" %}</a>
<button type="submit" name="_addanother" class="btn btn-outline-primary">{% trans "Add Another" %}</button>
<button type="submit" name="_save" class="btn btn-primary">{% trans "Save" %}</button>
</div>
</form>
{% endblock %}

Some files were not shown because too many files have changed in this diff Show More