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

View File

@ -2,7 +2,7 @@
{% load helpers %}
{% load i18n %}
{% block title %}{% blocktrans %}Disconnect" {{ obj_type_plural|bettertitle }}{% endblocktrans %}{% endblock %}
{% block title %}{% trans "Disconnect" %} {{ obj_type_plural|bettertitle }}{% endblock %}
{% block message %}
<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" %}
<li>
<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>
{% endwith %}
{% else %}

View File

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

View File

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

View File

@ -100,7 +100,7 @@
</tr>
<tr>
<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>
<th scope="row">{% trans "Starting Unit" %}</th>

View File

@ -3,18 +3,23 @@
{% block message %}
<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>
<i class="mdi mdi-alert"></i> <strong>{% trans "Missing required packages" %}</strong> - {% trans "This installation of NetBox might be
missing one or more required Python packages. These packages are listed in" %} <code>{% trans "requirements.txt" %}</code> {% trans "and" %}
<code>{% trans "local_requirements.txt" %}</code>, {% trans "and are normally installed as part of the installation or upgrade process. To
verify installed packages, run" %} <code>{% trans "pip freeze" %}</code> {% trans "from the console and compare the output to the list of
required packages" %}.
<i class="mdi mdi-alert"></i>
{% blocktrans %}
<strong>Missing required packages.</strong> This installation of NetBox might be missing one or more required
Python packages. These packages are listed in <code>requirements.txt</code> and
<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>
<i class="mdi mdi-alert"></i> <strong>{% trans "WSGI service not restarted after upgrade" %}</strong> - {% trans "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" %}.
<i class="mdi mdi-alert"></i>
{% blocktrans %}
<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>
{% endblock message %}

View File

@ -3,11 +3,14 @@
{% block message %}
<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>
<i class="mdi mdi-alert"></i> <strong>{% trans "Insufficient write permission to the media root" %}</strong> - {% trans "The configured
media root is" %} <code>{{ settings.MEDIA_ROOT }}</code>. {% trans "Ensure that the user NetBox runs as has access to write files
to all locations within this path" %}.
<i class="mdi mdi-alert"></i>
{% blocktrans with media_root=settings.MEDIA_ROOT %}
<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>
{% endblock message %}

View File

@ -3,16 +3,22 @@
{% block message %}
<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>
<i class="mdi mdi-alert"></i> <strong>{% trans "Database migrations missing" %}</strong> - {% trans "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>{% trans "python3 manage.py migrate" %}</code> {% trans "from the command line" %}.
<i class="mdi mdi-alert"></i>
{% blocktrans %}
<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>
<i class="mdi mdi-alert"></i> <strong>{% trans "Unsupported PostgreSQL version" %}</strong> - {% trans "Ensure that PostgreSQL version 10
or later is in use. You can check this by connecting to the database using NetBox's credentials and issuing a query
for" %} <code>{% trans "SELECT VERSION" %}()</code>.
<i class="mdi mdi-alert"></i>
{% blocktrans %}
<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>
{% endblock message %}

View File

@ -116,7 +116,10 @@
<div class="alert alert-info" role="alert">
<h4 class="alert-heading">{% trans "No Reports Found" %}</h4>
{% 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 %}
</div>
{% endfor %}

View File

@ -40,7 +40,10 @@
{% include 'inc/sync_warning.html' with object=module %}
{% if not module.scripts %}
<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>
{% else %}
<table class="table table-hover table-headings reports">
@ -87,7 +90,10 @@
<div class="alert alert-info">
<h4 class="alert-heading">{% trans "No Scripts Found" %}</h4>
{% 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 %}
</div>
{% endfor %}

View File

@ -1,5 +1,6 @@
{% load static %}
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
<head>
@ -25,25 +26,36 @@
<p>{% trans "Check the following" %}:</p>
<ul>
<li class="tip">
<code><strong>{% trans "manage.py collectstatic" %}</strong></code> {% trans "was run during the most recent upgrade. This installs the most recent
iteration of each static file into the static root path" %}.
{% blocktrans %}
<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 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.
Refer to" %} <a href="https://docs.netbox.dev/en/stable/installation/">{% trans "the installation
documentation" %}</a> {% trans "for further guidance" %}.
{% blocktrans with docs_url="https://docs.netbox.dev/en/stable/installation/" %}
The HTTP service (e.g. nginx or Apache) is configured to serve files from the <code>STATIC_ROOT</code>
path. Refer to <a href="{{ docs_url }}">the installation documentation</a> for further guidance.
{% endblocktrans %}
<ul>
{% 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 %}
<li><code>{% trans "STATIC_URL" %}: <strong>{{ settings.STATIC_URL }}</strong></code></li>
<li><code>STATIC_URL: <strong>{{ settings.STATIC_URL }}</strong></code></li>
</ul>
</li>
<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>
</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>
</body>
</html>