Skip to content

Commit

Permalink
netbox-community#16009 Added btn-float-group style class and added to…
Browse files Browse the repository at this point in the history
… form templates for floating button groups
  • Loading branch information
atownson committed Sep 17, 2024
1 parent 7167f20 commit 8715f6f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions netbox/project-static/styles/custom/_misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ span.color-label {
.netbox-edition {
letter-spacing: .15rem;
}

// A floating div for form buttons
.btn-float-group {
position: sticky;
bottom: 0px;
z-index: 1;
padding: 2px 0px 10px 0px;
}
4 changes: 2 additions & 2 deletions netbox/project-static/styles/overrides/_tabler.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pre {
}

// Altering background colors
.page, .page-tabs .nav-tabs .nav-link.active {
.page, .page-tabs .nav-tabs .nav-link.active, .btn-float-group {
background-color: var(--#{$prefix}bg-surface-tertiary) !important;
}
.page-body .card .card-header {
Expand Down Expand Up @@ -105,7 +105,7 @@ body[data-bs-theme=dark] {
.navbar, .page-header {
background-color: $rich-black;
}
.page, .page-tabs .nav-tabs .nav-link.active {
.page, .page-tabs .nav-tabs .nav-link.active, .btn-float-group {
background-color: $rich-black-light !important;
}

Expand Down
2 changes: 1 addition & 1 deletion netbox/templates/generic/bulk_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h2 class="col-9 offset-3">{% trans "Comments" %}</h2>

{% endif %}

<div class="text-end">
<div class="text-end btn-float-group">
<a href="{{ return_url }}" class="btn btn-outline-secondary">{% trans "Cancel" %}</a>
<button type="submit" name="_apply" class="btn btn-primary">{% trans "Apply" %}</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion netbox/templates/generic/object_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{% endblock form %}
</div>

<div class="text-end my-3">
<div class="text-end my-3 btn-float-group">
{% block buttons %}
<a href="{{ return_url }}" class="btn btn-outline-secondary">{% trans "Cancel" %}</a>
{% if object.pk %}
Expand Down
2 changes: 1 addition & 1 deletion netbox/templates/inc/filter_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>
{% endif %}
</div>
<div class="card-footer text-end d-print-none border-0">
<div class="card-footer text-end btn-float-group d-print-none border-0">
<button type="button" class="btn btn-outline-danger m-1" data-reset-select>
<i class="mdi mdi-backspace"></i> {% trans "Reset" %}
</button>
Expand Down

0 comments on commit 8715f6f

Please sign in to comment.