Merge branch 'develop' into feature

This commit is contained in:
jeremystretch 2021-12-28 16:14:24 -05:00
commit 7b66dae2f0
8 changed files with 73 additions and 54 deletions

View File

@ -6,6 +6,7 @@
* [#6782](https://github.com/netbox-community/netbox/issues/6782) - Enable the inclusion of custom links in tables * [#6782](https://github.com/netbox-community/netbox/issues/6782) - Enable the inclusion of custom links in tables
* [#8100](https://github.com/netbox-community/netbox/issues/8100) - Add "other" choice for FHRP group protocol * [#8100](https://github.com/netbox-community/netbox/issues/8100) - Add "other" choice for FHRP group protocol
* [#8175](https://github.com/netbox-community/netbox/issues/8175) - Display parent object when attaching an image
### Bug Fixes ### Bug Fixes

View File

@ -473,6 +473,7 @@ class ObjectChangeLogView(View):
class ImageAttachmentEditView(generic.ObjectEditView): class ImageAttachmentEditView(generic.ObjectEditView):
queryset = ImageAttachment.objects.all() queryset = ImageAttachment.objects.all()
model_form = forms.ImageAttachmentForm model_form = forms.ImageAttachmentForm
template_name = 'extras/imageattachment_edit.html'
def alter_object(self, instance, request, args, kwargs): def alter_object(self, instance, request, args, kwargs):
if not instance.pk: if not instance.pk:

Binary file not shown.

Binary file not shown.

View File

@ -8,6 +8,7 @@ $theme-colors: map-merge(
$theme-colors, $theme-colors,
( (
'primary': #337ab7, 'primary': #337ab7,
'info': #54d6f0,
'red': $red-500, 'red': $red-500,
'yellow': $yellow-500, 'yellow': $yellow-500,
'green': $green-500, 'green': $green-500,

View File

@ -10,7 +10,7 @@
</a> </a>
{% endif %} {% endif %}
{% if termination and perms.circuits.change_circuittermination %} {% if termination and perms.circuits.change_circuittermination %}
<a href="{% url 'circuits:circuittermination_edit' pk=termination.pk %}" class="btn btn-sm btn-yellow lh-1"> <a href="{% url 'circuits:circuittermination_edit' pk=termination.pk %}" class="btn btn-sm btn-warning lh-1">
<span class="mdi mdi-pencil" aria-hidden="true"></span> Edit <span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
</a> </a>
<a href="{% url 'circuits:circuit_terminations_swap' pk=object.pk %}" class="btn btn-sm btn-primary lh-1"> <a href="{% url 'circuits:circuit_terminations_swap' pk=object.pk %}" class="btn btn-sm btn-primary lh-1">

View File

@ -0,0 +1,16 @@
{% extends 'generic/object_edit.html' %}
{% load helpers %}
{% block form_fields %}
<div class="row mb-3">
<label class="col-sm-3 col-form-label text-lg-end required">
{{ obj.parent|meta:"verbose_name"|bettertitle }}
</label>
<div class="col-sm-9">
<div class="form-control-plaintext">
<a href="{{ obj.parent.get_absolute_url }}" class="">{{ obj.parent }}</a>
</div>
</div>
</div>
{{ block.super }}
{% endblock form_fields %}

View File

@ -1,56 +1,56 @@
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}
<span class="dropdown profile-button"> <div class="dropdown profile-button">
<button <button type="button" aria-expanded="false" data-bs-toggle="dropdown" class="btn btn-outline-secondary dropdown-toggle w-100">
type="button" <i class="mdi mdi-account"></i>
aria-expanded="false" <span id="navbar_user">{{ request.user|truncatechars:"30" }}</span>
data-bs-toggle="dropdown" </button>
class="btn btn-outline-secondary dropdown-toggle w-100" <ul class="dropdown-menu dropdown-menu-end">
> <li>
<i class="mdi mdi-account"></i> <button type="button" class="dropdown-item color-mode-toggle">
<span id="navbar_user">{{ request.user|truncatechars:"30" }}</span> <i class="color-mode-icon mdi mdi-lightbulb"></i>
</button> <span class="color-mode-text">Dark Mode</span>
<ul class="dropdown-menu dropdown-menu-end"> </button>
<li> </li>
<button type="button" class="dropdown-item color-mode-toggle"> <li>
<i class="color-mode-icon mdi mdi-lightbulb"></i>&nbsp; {% if request.user.is_staff %}
<span class="color-mode-text">Dark Mode</span> <a class="dropdown-item" href="{% url 'admin:index' %}">
</button> <i class="mdi mdi-cog"></i> Admin
</li> </a>
<li> {% endif %}
{% if request.user.is_staff %} </li>
<a class="dropdown-item" href="{% url 'admin:index' %}"> <li>
<i class="mdi mdi-cog"></i> Admin <a class="dropdown-item" href="{% url 'user:profile' %}">
</a> <i class="mdi mdi-account"></i> Profile
{% endif %} </a>
</li> </li>
<li> <li>
<a class="dropdown-item" href="{% url 'user:profile' %}"> <a class="dropdown-item" href="{% url 'user:preferences' %}">
<i class="mdi mdi-account"></i> Profile & Settings <i class="mdi mdi-wrench"></i> Preferences
</a> </a>
</li> </li>
<li><hr class="dropdown-divider" /></li> <li><hr class="dropdown-divider" /></li>
<li> <li>
<a class="dropdown-item" href="{% url 'logout' %}"> <a class="dropdown-item" href="{% url 'logout' %}">
<i class="mdi mdi-logout-variant"></i> Log Out <i class="mdi mdi-logout-variant"></i> Log Out
</a> </a>
</li> </li>
</ul> </ul>
</span> </div>
{% else %} {% else %}
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-primary ws-nowrap" type="button" href="{% url 'login' %}"> <a class="btn btn-primary ws-nowrap" type="button" href="{% url 'login' %}">
<i class="mdi mdi-login-variant"></i> Log In <i class="mdi mdi-login-variant"></i> Log In
</a> </a>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown">
<span class="visually-hidden">Toggle Dropdown</span> <span class="visually-hidden">Toggle Dropdown</span>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li> <li>
<button class="dropdown-item color-mode-toggle"> <button class="dropdown-item color-mode-toggle">
<i class="color-mode-icon mdi mdi-lightbulb"></i>&nbsp; <i class="color-mode-icon mdi mdi-lightbulb"></i>
<span class="color-mode-text">Dark Mode</span> <span class="color-mode-text">Dark Mode</span>
</button> </button>
</li> </li>
</ul> </ul>
</div> </div>
{% endif %} {% endif %}