From 0991a8edaafb14e53f64244256ba9ca0433ff421 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 22 Jul 2020 16:43:25 -0400 Subject: [PATCH 1/3] Fixes #4876: Fix labels for sites in staging or decommissioning status --- docs/release-notes/version-2.8.md | 8 ++++++++ netbox/dcim/models/__init__.py | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.8.md b/docs/release-notes/version-2.8.md index d3f566e59..125f598b8 100644 --- a/docs/release-notes/version-2.8.md +++ b/docs/release-notes/version-2.8.md @@ -1,5 +1,13 @@ # NetBox v2.8 +## v2.8.9 (FUTURE) + +### Bug Fixes + +* [#4876](https://github.com/netbox-community/netbox/issues/4876) - Fix labels for sites in staging or decommissioning status + +--- + ## v2.8.8 (2020-07-21) ### Enhancements diff --git a/netbox/dcim/models/__init__.py b/netbox/dcim/models/__init__.py index 993de734c..ef5b07aca 100644 --- a/netbox/dcim/models/__init__.py +++ b/netbox/dcim/models/__init__.py @@ -254,8 +254,10 @@ class Site(ChangeLoggedModel, CustomFieldModel): ] STATUS_CLASS_MAP = { - SiteStatusChoices.STATUS_ACTIVE: 'success', SiteStatusChoices.STATUS_PLANNED: 'info', + SiteStatusChoices.STATUS_STAGING: 'primary', + SiteStatusChoices.STATUS_ACTIVE: 'success', + SiteStatusChoices.STATUS_DECOMMISSIONING: 'warning', SiteStatusChoices.STATUS_RETIRED: 'danger', } From 86956c8fc32afe0747da5bd9be6264931f2ed2d1 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 22 Jul 2020 16:48:56 -0400 Subject: [PATCH 2/3] Fixes #4875: Fix documentation for image attachments --- docs/models/extras/imageattachment.md | 3 +++ docs/release-notes/version-2.8.md | 1 + 2 files changed, 4 insertions(+) create mode 100644 docs/models/extras/imageattachment.md diff --git a/docs/models/extras/imageattachment.md b/docs/models/extras/imageattachment.md new file mode 100644 index 000000000..da15462ab --- /dev/null +++ b/docs/models/extras/imageattachment.md @@ -0,0 +1,3 @@ +# Image Attachments + +Certain objects in NetBox support the attachment of uploaded images. These will be saved to the NetBox server and made available whenever the object is viewed. diff --git a/docs/release-notes/version-2.8.md b/docs/release-notes/version-2.8.md index 125f598b8..fb5e8277f 100644 --- a/docs/release-notes/version-2.8.md +++ b/docs/release-notes/version-2.8.md @@ -4,6 +4,7 @@ ### Bug Fixes +* [#4875](https://github.com/netbox-community/netbox/issues/4875) - Fix documentation for image attachments * [#4876](https://github.com/netbox-community/netbox/issues/4876) - Fix labels for sites in staging or decommissioning status --- From 9f4c1e64ce5b0f6967b83b5ea31083e37f7bc670 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 22 Jul 2020 17:06:08 -0400 Subject: [PATCH 3/3] Refactor clone_button() to avoid undefined URL --- netbox/utilities/templatetags/buttons.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/utilities/templatetags/buttons.py b/netbox/utilities/templatetags/buttons.py index 85f75f79e..77320980d 100644 --- a/netbox/utilities/templatetags/buttons.py +++ b/netbox/utilities/templatetags/buttons.py @@ -27,12 +27,12 @@ def _get_viewname(instance, action): @register.inclusion_tag('buttons/clone.html') def clone_button(instance): - viewname = _get_viewname(instance, 'add') + url = reverse(_get_viewname(instance, 'add')) # Populate cloned field values param_string = prepare_cloned_fields(instance) if param_string: - url = '{}?{}'.format(reverse(viewname), param_string) + url = f'{url}?{param_string}' return { 'url': url,