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:
@@ -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>
|
||||
|
Reference in New Issue
Block a user