mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
Merge pull request #10163 from netbox-community/10156-svg-link-target
Fixes #10156: Avoid forcing SVG image links to open in a new window
This commit is contained in:
commit
74ba5a61bf
@ -5,6 +5,7 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#10155](https://github.com/netbox-community/netbox/issues/10155) - Fix rear port display when editing front port template for module type
|
* [#10155](https://github.com/netbox-community/netbox/issues/10155) - Fix rear port display when editing front port template for module type
|
||||||
|
* [#10156](https://github.com/netbox-community/netbox/issues/10156) - Avoid forcing SVG image links to open in a new window
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class Connector(Group):
|
|||||||
self.add(cable)
|
self.add(cable)
|
||||||
|
|
||||||
# Add link
|
# Add link
|
||||||
link = Hyperlink(href=url, target='_blank')
|
link = Hyperlink(href=url, target='_parent')
|
||||||
|
|
||||||
# Add text label(s)
|
# Add text label(s)
|
||||||
cursor = start[1]
|
cursor = start[1]
|
||||||
@ -281,7 +281,7 @@ class CableTraceSVG:
|
|||||||
self.cursor += PADDING * 2
|
self.cursor += PADDING * 2
|
||||||
|
|
||||||
# Add link
|
# Add link
|
||||||
link = Hyperlink(href=f'{self.base_url}{wirelesslink.get_absolute_url()}', target='_blank')
|
link = Hyperlink(href=f'{self.base_url}{wirelesslink.get_absolute_url()}', target='_parent')
|
||||||
|
|
||||||
# Add text label(s)
|
# Add text label(s)
|
||||||
for i, label in enumerate(labels):
|
for i, label in enumerate(labels):
|
||||||
|
@ -151,7 +151,7 @@ class RackElevationSVG:
|
|||||||
css_extra = ' shaded' if is_shaded else ''
|
css_extra = ' shaded' if is_shaded else ''
|
||||||
|
|
||||||
# Create hyperlink element
|
# Create hyperlink element
|
||||||
link = Hyperlink(href=f'{self.base_url}{device.get_absolute_url()}', target='_blank')
|
link = Hyperlink(href=f'{self.base_url}{device.get_absolute_url()}', target="_parent")
|
||||||
link.set_desc(description)
|
link.set_desc(description)
|
||||||
|
|
||||||
# Add rect element to hyperlink
|
# Add rect element to hyperlink
|
||||||
@ -235,10 +235,7 @@ class RackElevationSVG:
|
|||||||
self.margin_width,
|
self.margin_width,
|
||||||
u_height * self.unit_height
|
u_height * self.unit_height
|
||||||
)
|
)
|
||||||
link = Hyperlink(
|
link = Hyperlink(href=f'{self.base_url}{reservation.get_absolute_url()}', target='_parent')
|
||||||
href='{}{}'.format(self.base_url, reservation.get_absolute_url()),
|
|
||||||
target='_blank'
|
|
||||||
)
|
|
||||||
link.set_desc(f'Reservation #{reservation.pk}: {reservation.description}')
|
link.set_desc(f'Reservation #{reservation.pk}: {reservation.description}')
|
||||||
link.add(
|
link.add(
|
||||||
Rect(coords, size, class_='reservation')
|
Rect(coords, size, class_='reservation')
|
||||||
@ -268,7 +265,7 @@ class RackElevationSVG:
|
|||||||
y_offset + self.unit_height / 2
|
y_offset + self.unit_height / 2
|
||||||
)
|
)
|
||||||
|
|
||||||
link = Hyperlink(href=url_string.format(unit), target='_blank')
|
link = Hyperlink(href=url_string.format(unit), target='_parent')
|
||||||
link.add(Rect((x_offset, y_offset), (self.unit_width, self.unit_height), class_='slot'))
|
link.add(Rect((x_offset, y_offset), (self.unit_width, self.unit_height), class_='slot'))
|
||||||
link.add(Text('add device', insert=text_coords, class_='add-device'))
|
link.add(Text('add device', insert=text_coords, class_='add-device'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user