Procházet zdrojové kódy

Merge branch 'develop' into develop-2.9

Jeremy Stretch před 5 roky
rodič
revize
d23f97abc8

+ 3 - 0
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.

+ 9 - 0
docs/release-notes/version-2.8.md

@@ -1,5 +1,14 @@
 # NetBox v2.8
 # NetBox v2.8
 
 
+## v2.8.9 (FUTURE)
+
+### 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
+
+---
+
 ## v2.8.8 (2020-07-21)
 ## v2.8.8 (2020-07-21)
 
 
 ### Enhancements
 ### Enhancements

+ 3 - 1
netbox/dcim/models/__init__.py

@@ -260,8 +260,10 @@ class Site(ChangeLoggedModel, CustomFieldModel):
     ]
     ]
 
 
     STATUS_CLASS_MAP = {
     STATUS_CLASS_MAP = {
-        SiteStatusChoices.STATUS_ACTIVE: 'success',
         SiteStatusChoices.STATUS_PLANNED: 'info',
         SiteStatusChoices.STATUS_PLANNED: 'info',
+        SiteStatusChoices.STATUS_STAGING: 'primary',
+        SiteStatusChoices.STATUS_ACTIVE: 'success',
+        SiteStatusChoices.STATUS_DECOMMISSIONING: 'warning',
         SiteStatusChoices.STATUS_RETIRED: 'danger',
         SiteStatusChoices.STATUS_RETIRED: 'danger',
     }
     }
 
 

+ 2 - 2
netbox/utilities/templatetags/buttons.py

@@ -27,12 +27,12 @@ def _get_viewname(instance, action):
 
 
 @register.inclusion_tag('buttons/clone.html')
 @register.inclusion_tag('buttons/clone.html')
 def clone_button(instance):
 def clone_button(instance):
-    viewname = _get_viewname(instance, 'add')
+    url = reverse(_get_viewname(instance, 'add'))
 
 
     # Populate cloned field values
     # Populate cloned field values
     param_string = prepare_cloned_fields(instance)
     param_string = prepare_cloned_fields(instance)
     if param_string:
     if param_string:
-        url = '{}?{}'.format(reverse(viewname), param_string)
+        url = f'{url}?{param_string}'
 
 
     return {
     return {
         'url': url,
         'url': url,