From 3f62f66e863b139aaebdc756d3673d17a96ad337 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 28 Jul 2023 16:06:32 -0400 Subject: [PATCH] Additional cleanup --- netbox/templates/core/datafile.html | 2 +- netbox/templates/dcim/bulk_disconnect.html | 2 +- netbox/templates/dcim/cable_trace.html | 2 +- netbox/templates/dcim/device.html | 8 ++-- netbox/templates/dcim/powerfeed.html | 4 +- netbox/templates/dcim/rack.html | 2 +- netbox/templates/exceptions/import_error.html | 23 ++++++----- .../exceptions/permission_error.html | 11 ++++-- .../exceptions/programming_error.html | 20 ++++++---- netbox/templates/extras/report_list.html | 5 ++- netbox/templates/extras/script_list.html | 10 ++++- netbox/templates/media_failure.html | 38 ++++++++++++------- 12 files changed, 81 insertions(+), 46 deletions(-) diff --git a/netbox/templates/core/datafile.html b/netbox/templates/core/datafile.html index 38316ddf6..19ac3ab14 100644 --- a/netbox/templates/core/datafile.html +++ b/netbox/templates/core/datafile.html @@ -49,7 +49,7 @@ {% trans "Size" %} - {% blocktrans %}{{ object.size }} byte{{ object.size|pluralize }}{% endblocktrans %} + {{ object.size }} {% trans "bytes" %} {% trans "SHA256 Hash" %} diff --git a/netbox/templates/dcim/bulk_disconnect.html b/netbox/templates/dcim/bulk_disconnect.html index dcbba5b0c..26becb70b 100644 --- a/netbox/templates/dcim/bulk_disconnect.html +++ b/netbox/templates/dcim/bulk_disconnect.html @@ -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 %}

{% blocktrans %}Are you sure you want to disconnect these {{ selected_objects|length }} {{ obj_type_plural }}?{% endblocktrans %}

diff --git a/netbox/templates/dcim/cable_trace.html b/netbox/templates/dcim/cable_trace.html index b7d780cc4..c8b54c201 100644 --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -28,7 +28,7 @@ {% with viewname=next_node|viewname:"trace" %}
  • {{ next_node|meta:"verbose_name"|bettertitle }} {{ next_node }} - ({% blocktrans %}Cable {{ next_node.cable|linkify }}{% endblocktrans %}) + ({% trans "Cable" %} {{ next_node.cable|linkify }})
  • {% endwith %} {% else %} diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index cd2ba00ce..ddc17262f 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -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 %} - {% trans "U" %}{{ object.position|floatformat }} / {{ object.get_face_display }} + U{{ object.position|floatformat }} / {{ object.get_face_display }} {% elif object.rack and object.device_type.u_height %} {% trans "Not racked" %} {% else %} @@ -106,7 +106,7 @@ {% trans "Device Type" %} - {{ 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) @@ -337,7 +337,7 @@ {% trans "Height" %} - {{ object.device_type.u_height }}{% trans "U" %} + {{ object.device_type.u_height }}U diff --git a/netbox/templates/dcim/powerfeed.html b/netbox/templates/dcim/powerfeed.html index 5e8345db7..ecfee3a3c 100644 --- a/netbox/templates/dcim/powerfeed.html +++ b/netbox/templates/dcim/powerfeed.html @@ -83,11 +83,11 @@ {% trans "Voltage" %} - {{ object.voltage }}V + {{ object.voltage }}{% trans "V" context "Abbreviation for volts" %} {% trans "Amperage" %} - {{ object.amperage }}A + {{ object.amperage }}{% trans "A" context "Abbreviation for amperes" %} {% trans "Phase" %} diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index cb8a57d5c..db4fa4289 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -100,7 +100,7 @@ {% trans "Height" %} - {{ object.u_height }}{% trans "U" %} ({% if object.desc_units %}{% trans "descending" %}{% else %}{% trans "ascending" %}{% endif %}) + {{ object.u_height }}U ({% if object.desc_units %}{% trans "descending" %}{% else %}{% trans "ascending" %}{% endif %}) {% trans "Starting Unit" %} diff --git a/netbox/templates/exceptions/import_error.html b/netbox/templates/exceptions/import_error.html index 4b483074d..70896328d 100644 --- a/netbox/templates/exceptions/import_error.html +++ b/netbox/templates/exceptions/import_error.html @@ -3,18 +3,23 @@ {% block message %}

    - {% 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:" %}

    - {% trans "Missing required packages" %} - {% trans "This installation of NetBox might be - missing one or more required Python packages. These packages are listed in" %} {% trans "requirements.txt" %} {% trans "and" %} - {% trans "local_requirements.txt" %}, {% trans "and are normally installed as part of the installation or upgrade process. To - verify installed packages, run" %} {% trans "pip freeze" %} {% trans "from the console and compare the output to the list of - required packages" %}. + + {% blocktrans %} + Missing required packages. This installation of NetBox might be missing one or more required + Python packages. These packages are listed in requirements.txt and + local_requirements.txt, and are normally installed as part of the installation or upgrade process. + To verify installed packages, run pip freeze from the console and compare the output to the list of + required packages. + {% endblocktrans %}

    - {% trans "WSGI service not restarted after upgrade" %} - {% 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" %}. + + {% blocktrans %} + WSGI service not restarted after upgrade. 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 %}

    {% endblock message %} diff --git a/netbox/templates/exceptions/permission_error.html b/netbox/templates/exceptions/permission_error.html index 4946e5f81..3df6ad5c8 100644 --- a/netbox/templates/exceptions/permission_error.html +++ b/netbox/templates/exceptions/permission_error.html @@ -3,11 +3,14 @@ {% block message %}

    - {% 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:" %}

    - {% trans "Insufficient write permission to the media root" %} - {% trans "The configured - media root is" %} {{ settings.MEDIA_ROOT }}. {% trans "Ensure that the user NetBox runs as has access to write files - to all locations within this path" %}. + + {% blocktrans with media_root=settings.MEDIA_ROOT %} + Insufficient write permission to the media root. The configured media root is + {{ media_root }}. Ensure that the user NetBox runs as has access to write files to all locations + within this path. + {% endblocktrans %}

    {% endblock message %} diff --git a/netbox/templates/exceptions/programming_error.html b/netbox/templates/exceptions/programming_error.html index 0c78ec894..5d82e4511 100644 --- a/netbox/templates/exceptions/programming_error.html +++ b/netbox/templates/exceptions/programming_error.html @@ -3,16 +3,22 @@ {% block message %}

    - {% 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:" %}

    - {% trans "Database migrations missing" %} - {% 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" %} - {% trans "python3 manage.py migrate" %} {% trans "from the command line" %}. + + {% blocktrans %} + Database migrations missing. 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 + python3 manage.py migrate from the command line. + {% endblocktrans %}

    - {% trans "Unsupported PostgreSQL version" %} - {% 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" %} {% trans "SELECT VERSION" %}(). + + {% blocktrans %} + Unsupported PostgreSQL version. 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 + SELECT VERSION(). + {% endblocktrans %}

    {% endblock message %} diff --git a/netbox/templates/extras/report_list.html b/netbox/templates/extras/report_list.html index c6a536d58..81b5beb3b 100644 --- a/netbox/templates/extras/report_list.html +++ b/netbox/templates/extras/report_list.html @@ -116,7 +116,10 @@ {% endfor %} diff --git a/netbox/templates/extras/script_list.html b/netbox/templates/extras/script_list.html index 97720d394..c78aedc1c 100644 --- a/netbox/templates/extras/script_list.html +++ b/netbox/templates/extras/script_list.html @@ -40,7 +40,10 @@ {% include 'inc/sync_warning.html' with object=module %} {% if not module.scripts %} {% else %} @@ -87,7 +90,10 @@

    {% trans "No Scripts Found" %}

    {% if perms.extras.add_scriptmodule %} - {% trans "Get started by" %} {% trans "creating a script" %} {% trans "from an uploaded file or data source" %}. + {% url 'extras:scriptmodule_add' as create_script_url %} + {% blocktrans %} + Get started by creating a script from an uploaded file or data source. + {% endblocktrans %} {% endif %}
    {% endfor %} diff --git a/netbox/templates/media_failure.html b/netbox/templates/media_failure.html index c78ffc9d7..264c58a16 100644 --- a/netbox/templates/media_failure.html +++ b/netbox/templates/media_failure.html @@ -1,5 +1,6 @@ {% load static %} {% load i18n %} + @@ -25,25 +26,36 @@

    {% trans "Check the following" %}:

    -

    {% trans "Click" %} {% trans "here" %} {% trans "to attempt loading NetBox again" %}.

    +

    + {% url 'home' as home_url %} + {% blocktrans %} + Click here to attempt loading NetBox again. + {% endblocktrans %} +