Additional cleanup

This commit is contained in:
Jeremy Stretch 2023-07-28 16:06:32 -04:00
parent 7a80157e75
commit 3f62f66e86
12 changed files with 81 additions and 46 deletions

View File

@ -49,7 +49,7 @@
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Size" %}</th> <th scope="row">{% trans "Size" %}</th>
<td>{% blocktrans %}{{ object.size }} byte{{ object.size|pluralize }}{% endblocktrans %}</td> <td>{{ object.size }} {% trans "bytes" %}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "SHA256 Hash" %}</th> <th scope="row">{% trans "SHA256 Hash" %}</th>

View File

@ -2,7 +2,7 @@
{% load helpers %} {% load helpers %}
{% load i18n %} {% load i18n %}
{% block title %}{% blocktrans %}Disconnect" {{ obj_type_plural|bettertitle }}{% endblocktrans %}{% endblock %} {% block title %}{% trans "Disconnect" %} {{ obj_type_plural|bettertitle }}{% endblock %}
{% block message %} {% block message %}
<p>{% blocktrans %}Are you sure you want to disconnect these {{ selected_objects|length }} {{ obj_type_plural }}?{% endblocktrans %}</p> <p>{% blocktrans %}Are you sure you want to disconnect these {{ selected_objects|length }} {{ obj_type_plural }}?{% endblocktrans %}</p>

View File

@ -28,7 +28,7 @@
{% with viewname=next_node|viewname:"trace" %} {% with viewname=next_node|viewname:"trace" %}
<li> <li>
<a href="{% url viewname pk=next_node.pk %}">{{ next_node|meta:"verbose_name"|bettertitle }} {{ next_node }}</a> <a href="{% url viewname pk=next_node.pk %}">{{ next_node|meta:"verbose_name"|bettertitle }} {{ next_node }}</a>
({% blocktrans %}Cable {{ next_node.cable|linkify }}{% endblocktrans %}) ({% trans "Cable" %} {{ next_node.cable|linkify }})
</li> </li>
{% endwith %} {% endwith %}
{% else %} {% else %}

View File

@ -65,11 +65,11 @@
{% with object.parent_bay.device as parent %} {% with object.parent_bay.device as parent %}
{{ parent|linkify }} / {{ object.parent_bay }} {{ parent|linkify }} / {{ object.parent_bay }}
{% if parent.position %} {% if parent.position %}
({% trans "U" %}{{ parent.position|floatformat }} / {{ parent.get_face_display }}) (U{{ parent.position|floatformat }} / {{ parent.get_face_display }})
{% endif %} {% endif %}
{% endwith %} {% endwith %}
{% elif object.rack and object.position %} {% elif object.rack and object.position %}
<span>{% trans "U" %}{{ object.position|floatformat }} / {{ object.get_face_display }}</span> <span>U{{ object.position|floatformat }} / {{ object.get_face_display }}</span>
{% elif object.rack and object.device_type.u_height %} {% elif object.rack and object.device_type.u_height %}
<span class="badge bg-warning">{% trans "Not racked" %}</span> <span class="badge bg-warning">{% trans "Not racked" %}</span>
{% else %} {% else %}
@ -106,7 +106,7 @@
<tr> <tr>
<th scope="row">{% trans "Device Type" %}</th> <th scope="row">{% trans "Device Type" %}</th>
<td> <td>
{{ object.device_type|linkify:"get_full_name" }} ({{ object.device_type.u_height|floatformat }}{% trans "U" %}) {{ object.device_type|linkify:"get_full_name" }} ({{ object.device_type.u_height|floatformat }}U)
</td> </td>
</tr> </tr>
<tr> <tr>
@ -337,7 +337,7 @@
<tr> <tr>
<th scope="row">{% trans "Height" %}</th> <th scope="row">{% trans "Height" %}</th>
<td> <td>
{{ object.device_type.u_height }}{% trans "U" %} {{ object.device_type.u_height }}U
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -83,11 +83,11 @@
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Voltage" %}</th> <th scope="row">{% trans "Voltage" %}</th>
<td>{{ object.voltage }}V</td> <td>{{ object.voltage }}{% trans "V" context "Abbreviation for volts" %}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Amperage" %}</th> <th scope="row">{% trans "Amperage" %}</th>
<td>{{ object.amperage }}A</td> <td>{{ object.amperage }}{% trans "A" context "Abbreviation for amperes" %}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Phase" %}</th> <th scope="row">{% trans "Phase" %}</th>

View File

@ -100,7 +100,7 @@
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Height" %}</th> <th scope="row">{% trans "Height" %}</th>
<td>{{ object.u_height }}{% trans "U" %} ({% if object.desc_units %}{% trans "descending" %}{% else %}{% trans "ascending" %}{% endif %})</td> <td>{{ object.u_height }}U ({% if object.desc_units %}{% trans "descending" %}{% else %}{% trans "ascending" %}{% endif %})</td>
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Starting Unit" %}</th> <th scope="row">{% trans "Starting Unit" %}</th>

View File

@ -3,18 +3,23 @@
{% block message %} {% block message %}
<p> <p>
{% trans "A module import error occurred during this request. Common causes include the following" %}: {% trans "A module import error occurred during this request. Common causes include the following:" %}
</p> </p>
<p> <p>
<i class="mdi mdi-alert"></i> <strong>{% trans "Missing required packages" %}</strong> - {% trans "This installation of NetBox might be <i class="mdi mdi-alert"></i>
missing one or more required Python packages. These packages are listed in" %} <code>{% trans "requirements.txt" %}</code> {% trans "and" %} {% blocktrans %}
<code>{% trans "local_requirements.txt" %}</code>, {% trans "and are normally installed as part of the installation or upgrade process. To <strong>Missing required packages.</strong> This installation of NetBox might be missing one or more required
verify installed packages, run" %} <code>{% trans "pip freeze" %}</code> {% trans "from the console and compare the output to the list of Python packages. These packages are listed in <code>requirements.txt</code> and
required packages" %}. <code>local_requirements.txt</code>, and are normally installed as part of the installation or upgrade process.
To verify installed packages, run <code>pip freeze</code> from the console and compare the output to the list of
required packages.
{% endblocktrans %}
</p> </p>
<p> <p>
<i class="mdi mdi-alert"></i> <strong>{% trans "WSGI service not restarted after upgrade" %}</strong> - {% trans "If this installation has <i class="mdi mdi-alert"></i>
recently been upgraded, check that the WSGI service (e.g. gunicorn or uWSGI) has been restarted. This ensures that {% blocktrans %}
the new code is running" %}. <strong>WSGI service not restarted after upgrade.</strong> If this installation has recently been upgraded, check
that the WSGI service (e.g. gunicorn or uWSGI) has been restarted. This ensures that the new code is running.
{% endblocktrans %}
</p> </p>
{% endblock message %} {% endblock message %}

View File

@ -3,11 +3,14 @@
{% block message %} {% block message %}
<p> <p>
{% trans "A file permission error was detected while processing this request. Common causes include the following" %}: {% trans "A file permission error was detected while processing this request. Common causes include the following:" %}
</p> </p>
<p> <p>
<i class="mdi mdi-alert"></i> <strong>{% trans "Insufficient write permission to the media root" %}</strong> - {% trans "The configured <i class="mdi mdi-alert"></i>
media root is" %} <code>{{ settings.MEDIA_ROOT }}</code>. {% trans "Ensure that the user NetBox runs as has access to write files {% blocktrans with media_root=settings.MEDIA_ROOT %}
to all locations within this path" %}. <strong>Insufficient write permission to the media root.</strong> The configured media root is
<code>{{ media_root }}</code>. Ensure that the user NetBox runs as has access to write files to all locations
within this path.
{% endblocktrans %}
</p> </p>
{% endblock message %} {% endblock message %}

View File

@ -3,16 +3,22 @@
{% block message %} {% block message %}
<p> <p>
{% trans "A database programming error was detected while processing this request. Common causes include the following" %}: {% trans "A database programming error was detected while processing this request. Common causes include the following:" %}
</p> </p>
<p> <p>
<i class="mdi mdi-alert"></i> <strong>{% trans "Database migrations missing" %}</strong> - {% trans "When upgrading to a new NetBox release, <i class="mdi mdi-alert"></i>
the upgrade script must be run to apply any new database migrations. You can run migrations manually by executing" %} {% blocktrans %}
<code>{% trans "python3 manage.py migrate" %}</code> {% trans "from the command line" %}. <strong>Database migrations missing.</strong> When upgrading to a new NetBox release, the upgrade script must be
run to apply any new database migrations. You can run migrations manually by executing
<code>python3 manage.py migrate</code> from the command line.
{% endblocktrans %}
</p> </p>
<p> <p>
<i class="mdi mdi-alert"></i> <strong>{% trans "Unsupported PostgreSQL version" %}</strong> - {% trans "Ensure that PostgreSQL version 10 <i class="mdi mdi-alert"></i>
or later is in use. You can check this by connecting to the database using NetBox's credentials and issuing a query {% blocktrans %}
for" %} <code>{% trans "SELECT VERSION" %}()</code>. <strong>Unsupported PostgreSQL version.</strong> Ensure that PostgreSQL version 12 or later is in use. You can
check this by connecting to the database using NetBox's credentials and issuing a query for
<code>SELECT VERSION()</code>.
{% endblocktrans %}
</p> </p>
{% endblock message %} {% endblock message %}

View File

@ -116,7 +116,10 @@
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
<h4 class="alert-heading">{% trans "No Reports Found" %}</h4> <h4 class="alert-heading">{% trans "No Reports Found" %}</h4>
{% if perms.extras.add_reportmodule %} {% if perms.extras.add_reportmodule %}
{% trans "Get started by" %} <a href="{% url 'extras:reportmodule_add' %}">{% trans "creating a report" %}</a> {% trans "from an uploaded file or data source" %}. {% url 'extras:reportmodule_add' as create_report_url %}
{% blocktrans %}
Get started by <a href="{{ create_report_url }}">creating a report</a> from an uploaded file or data source.
{% endblocktrans %}
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}

View File

@ -40,7 +40,10 @@
{% include 'inc/sync_warning.html' with object=module %} {% include 'inc/sync_warning.html' with object=module %}
{% if not module.scripts %} {% if not module.scripts %}
<div class="alert alert-warning d-flex align-items-center" role="alert"> <div class="alert alert-warning d-flex align-items-center" role="alert">
<i class="mdi mdi-alert"></i>&nbsp; {% trans "Script file at" %}: {{module.full_path}} {% trans "could not be loaded" %}. <i class="mdi mdi-alert"></i>
{% blocktrans with file_path=module.full_path %}
Script file at <code>{{ file_path }}</code> could not be loaded.
{% endblocktrans %}
</div> </div>
{% else %} {% else %}
<table class="table table-hover table-headings reports"> <table class="table table-hover table-headings reports">
@ -87,7 +90,10 @@
<div class="alert alert-info"> <div class="alert alert-info">
<h4 class="alert-heading">{% trans "No Scripts Found" %}</h4> <h4 class="alert-heading">{% trans "No Scripts Found" %}</h4>
{% if perms.extras.add_scriptmodule %} {% if perms.extras.add_scriptmodule %}
{% trans "Get started by" %} <a href="{% url 'extras:scriptmodule_add' %}">{% trans "creating a script" %}</a> {% trans "from an uploaded file or data source" %}. {% url 'extras:scriptmodule_add' as create_script_url %}
{% blocktrans %}
Get started by <a href="{{ create_script_url }}">creating a script</a> from an uploaded file or data source.
{% endblocktrans %}
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}

View File

@ -1,5 +1,6 @@
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -25,25 +26,36 @@
<p>{% trans "Check the following" %}:</p> <p>{% trans "Check the following" %}:</p>
<ul> <ul>
<li class="tip"> <li class="tip">
<code><strong>{% trans "manage.py collectstatic" %}</strong></code> {% trans "was run during the most recent upgrade. This installs the most recent {% blocktrans %}
iteration of each static file into the static root path" %}. <code>manage.py collectstatic</code> was run during the most recent upgrade. This installs the most
recent iteration of each static file into the static root path.
{% endblocktrans %}
</li> </li>
<li class="tip"> <li class="tip">
{% trans "The HTTP service (e.g. nginx or Apache) is configured to serve files from the" %} <code>{% trans "STATIC_ROOT" %}</code> {% trans "path. {% blocktrans with docs_url="https://docs.netbox.dev/en/stable/installation/" %}
Refer to" %} <a href="https://docs.netbox.dev/en/stable/installation/">{% trans "the installation The HTTP service (e.g. nginx or Apache) is configured to serve files from the <code>STATIC_ROOT</code>
documentation" %}</a> {% trans "for further guidance" %}. path. Refer to <a href="{{ docs_url }}">the installation documentation</a> for further guidance.
{% endblocktrans %}
<ul> <ul>
{% if request.user.is_staff or request.user.is_superuser %} {% if request.user.is_staff or request.user.is_superuser %}
<li><code>{% trans "STATIC_ROOT" %}: <strong>{{ settings.STATIC_ROOT }}</strong></code></li> <li><code>STATIC_ROOT: <strong>{{ settings.STATIC_ROOT }}</strong></code></li>
{% endif %} {% endif %}
<li><code>{% trans "STATIC_URL" %}: <strong>{{ settings.STATIC_URL }}</strong></code></li> <li><code>STATIC_URL: <strong>{{ settings.STATIC_URL }}</strong></code></li>
</ul> </ul>
</li> </li>
<li class="tip"> <li class="tip">
{% trans "The file" %} <code>{{ filename }}</code> {% trans "exists in the static root directory and is readable by the HTTP process" %}. {% blocktrans %}
The file <code>{{ filename }}</code> exists in the static root directory and is readable by the HTTP
server.
{% endblocktrans %}
</li> </li>
</ul> </ul>
<p>{% trans "Click" %} <a href="{% url 'home' %}">{% trans "here" %}</a> {% trans "to attempt loading NetBox again" %}.</p> <p>
{% url 'home' as home_url %}
{% blocktrans %}
Click <a href="{{ home_url }}">here</a> to attempt loading NetBox again.
{% endblocktrans %}
</p>
</div> </div>
</body> </body>
</html> </html>