diff --git a/CHANGELOG.md b/CHANGELOG.md index 64c8751..e6b2333 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.2.0] - 2026-04-22 + +### Added + +- **Add button on Typed tabs** ([#9](https://github.com/CESNET/netbox-custom-objects-tab/issues/9)) — + each Typed tab now shows an "Add *Type*" button (top-right) that opens the native + `customobject_add` view with the reverse-reference field pre-filled to the parent + object's PK and `return_url` set back to the tab. After saving, the user lands back + on the same tab, with any active filters preserved. When a Custom Object Type has + multiple fields referencing the same parent model (e.g. `primary_device` and + `backup_device` both → Device), the button becomes a split-dropdown listing each + field. The button is hidden for users without `add_customobject` permission. + Tabs with `hide_if_empty=True` are still hidden until the first object is created + via the native menu — subsequent additions can use the new button. + ## [2.1.0] - 2026-03-16 ### Added diff --git a/netbox_custom_objects_tab/templates/netbox_custom_objects_tab/typed/tab.html b/netbox_custom_objects_tab/templates/netbox_custom_objects_tab/typed/tab.html index 3ad9097..ad313c3 100644 --- a/netbox_custom_objects_tab/templates/netbox_custom_objects_tab/typed/tab.html +++ b/netbox_custom_objects_tab/templates/netbox_custom_objects_tab/typed/tab.html @@ -5,6 +5,34 @@ {% load i18n %} {% block content %} {% if table %} + {# Add button (single) or split-dropdown (multiple back-reference fields) #} + {% if can_add and add_links %} +