Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #12128: Refresh the web UI to employ the Tabler CSS framework #14833

Merged
merged 87 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
edcdc90
Remove dark mode styling
jeremystretch Dec 29, 2023
6b61b22
Condense & rename light mode stylesheet
jeremystretch Dec 29, 2023
f0ef7d8
Upgrade to Bootstrap 5.3.2
jeremystretch Dec 29, 2023
76d8344
Swap out Bootstrap for Tabler; remove custom styling
jeremystretch Dec 29, 2023
69f849d
Update base page layout for Tabler
jeremystretch Dec 29, 2023
4e18897
Update login page
jeremystretch Dec 29, 2023
f646576
Bump node to v18
jeremystretch Dec 29, 2023
ecb6347
Update button styles
jeremystretch Dec 30, 2023
0a03a7e
Update object list view
jeremystretch Dec 30, 2023
f746ab1
Tweak navbar size
jeremystretch Dec 30, 2023
6fc83eb
Clean up dashboard widgets
jeremystretch Jan 2, 2024
135aff7
Ditch separate stylesheet for print media
jeremystretch Jan 2, 2024
bb1e6aa
Remove simplebar
jeremystretch Jan 2, 2024
693cc27
Remove obsolete sidebar styling
jeremystretch Jan 2, 2024
1b0182b
Clean up object view template
jeremystretch Jan 3, 2024
13265eb
Clean up object edit template
jeremystretch Jan 3, 2024
17f400e
Standardize primary button sizing
jeremystretch Jan 3, 2024
b4a5e19
Clean up object list styling
jeremystretch Jan 3, 2024
68e9c14
Add buttons for add & import to navigation menu
jeremystretch Jan 3, 2024
a2a1c38
Fix global search bar
jeremystretch Jan 4, 2024
62626bb
Fix slim-select form widget styling
jeremystretch Jan 4, 2024
910d79d
Fix toast styling
jeremystretch Jan 4, 2024
dde1cca
Set base fonts
jeremystretch Jan 4, 2024
c91aec0
Clean up paginator styling
jeremystretch Jan 4, 2024
3696871
Clean up navigation menu group headings
jeremystretch Jan 4, 2024
a1830cb
Clean up footer links
jeremystretch Jan 4, 2024
f38973e
Clean up card styles
jeremystretch Jan 5, 2024
fc24534
Move SVG styles to a designated directory
jeremystretch Jan 5, 2024
fc8cee3
Restructure SCSS files
jeremystretch Jan 5, 2024
f30d0d0
Remove obsolete/redundant dependencies
jeremystretch Jan 5, 2024
d2eab22
Fix icon spacing
jeremystretch Jan 5, 2024
06b0e1e
Update background color classes
jeremystretch Jan 5, 2024
ee4842e
Tweak banner & footer styling and spacing
jeremystretch Jan 5, 2024
cdbf195
Fix badge background colors in table content
jeremystretch Jan 5, 2024
dde6803
Bump @types/bootstrap to 5.2.10
jeremystretch Jan 5, 2024
0658ea9
Clean up form layouts
jeremystretch Jan 5, 2024
5f2fe97
Fix object selector button style
jeremystretch Jan 5, 2024
39c0e68
Fix icon padding inside small buttons
jeremystretch Jan 5, 2024
e30ff42
Fix icon & badge spacing inside buttons and tabs
jeremystretch Jan 5, 2024
8197e83
Hide paginator for empty pages
jeremystretch Jan 5, 2024
bcf1596
Fix hover color for list items (Tabler bug #1694)
jeremystretch Jan 5, 2024
fb92905
Fix width of checkbox column in empty tables
jeremystretch Jan 5, 2024
c1ecd22
Clean up bulk edit template
jeremystretch Jan 5, 2024
ba34476
Fix border color of reslug button
jeremystretch Jan 5, 2024
dab4302
Package & serve Google fonts locally
jeremystretch Jan 8, 2024
6439a91
Fix tab styling
jeremystretch Jan 8, 2024
58628aa
Reduce vetical space at top of dashboard
jeremystretch Jan 9, 2024
a88919c
Remove obsolete content-wrapper template block
jeremystretch Jan 9, 2024
9bffd41
Fix icon spacing in dropdown menu items
jeremystretch Jan 9, 2024
08ee45b
Fix color label sizing
jeremystretch Jan 9, 2024
9b2c258
Separate bulk delete form & object list into tabs
jeremystretch Jan 9, 2024
ac2343f
Fix styling of filter group headings
jeremystretch Jan 9, 2024
95d68dd
Fix styling for object changelog & journal views
jeremystretch Jan 9, 2024
f394476
Standardize ordering & styling of action buttons
jeremystretch Jan 9, 2024
77dbf5c
Fix designation of active menu item
jeremystretch Jan 10, 2024
feda63d
Automatically expand menu section containing the active link
jeremystretch Jan 11, 2024
bc6508c
Clean up nav menu styling
jeremystretch Jan 11, 2024
15385ee
Remove button colors; hide buttons except on hover/active
jeremystretch Jan 11, 2024
f864fc6
Highlight menu group containing the active item
jeremystretch Jan 11, 2024
8eed94c
Update & standardize alert styling
jeremystretch Jan 11, 2024
d8a665d
Refactor base templates to ensure consistent display of header content
jeremystretch Jan 11, 2024
ed41ce3
Tweak styling for links inside badges
jeremystretch Jan 11, 2024
d74e420
Clean up top menu
jeremystretch Jan 11, 2024
db9a583
Fix JSON/YAML toggles for config context data
jeremystretch Jan 11, 2024
a9d30d3
Fix object template header
jeremystretch Jan 11, 2024
68ccee7
Constrain tabs to container-xl; tweak header margins
jeremystretch Jan 11, 2024
dad5c8c
Fix object identifier styling
jeremystretch Jan 11, 2024
2b2e722
Fix positioning of card header buttons
jeremystretch Jan 11, 2024
04dc9a1
Remove padding from HTMX tables inside cards
jeremystretch Jan 12, 2024
a16f272
Ensure consistent use of row headings in attribute tables
jeremystretch Jan 12, 2024
d8e853d
Remove padding surrounding tables inside cards
jeremystretch Jan 12, 2024
8e8a84f
Remove obsolete CSS classes
jeremystretch Jan 12, 2024
5e1e1a9
Misc cleanup of old styling
jeremystretch Jan 12, 2024
ae399eb
Refactor 'controls' template block; ditch old classes
jeremystretch Jan 12, 2024
0045c7a
Fix login button sizing
jeremystretch Jan 12, 2024
d61414a
Limit object edit form width
jeremystretch Jan 12, 2024
b84d023
Append asterisk to required form field labels
jeremystretch Jan 12, 2024
27a3de0
Remove obsolete styling
jeremystretch Jan 12, 2024
0d7417d
Remove obsolete styling
jeremystretch Jan 16, 2024
16e212e
Fix position of progress bar outside label
jeremystretch Jan 16, 2024
94e6dd6
Fix alignment of delete button in report/script lists
jeremystretch Jan 16, 2024
2ee68d3
Fix <pre> styling
jeremystretch Jan 16, 2024
ddb53ca
Clean up page headers
jeremystretch Jan 16, 2024
f28cae6
Replace SVG icons with Material Design icons
jeremystretch Jan 17, 2024
cdba308
Restore dark mode togle functionality
jeremystretch Jan 17, 2024
0ade488
Fix top navbar background color under dark mode
jeremystretch Jan 17, 2024
bbd71fd
Rebuild static assets
jeremystretch Jan 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
node-version: ['14.x']
node-version: ['18.x']
services:
redis:
image: redis
Expand Down
14 changes: 5 additions & 9 deletions netbox/dcim/tables/template_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,33 @@
"""

DEVICE_LINK = """
{{ value|default:'<span class="badge bg-info">Unnamed device</span>' }}
{{ value|default:'<span class="badge text-bg-info">Unnamed device</span>' }}
"""

DEVICEBAY_STATUS = """
{% if record.installed_device_id %}
<span class="badge bg-{{ record.installed_device.get_status_color }}">
<span class="badge text-bg-{{ record.installed_device.get_status_color }}">
{{ record.installed_device.get_status_display }}
</span>
{% else %}
<span class="badge bg-secondary">Vacant</span>
<span class="badge text-bg-secondary">Vacant</span>
{% endif %}
"""

INTERFACE_IPADDRESSES = """
<div class="table-badge-group">
{% for ip in value.all %}
{% if ip.status != 'active' %}
<a href="{{ ip.get_absolute_url }}" class="table-badge badge bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a>
<a href="{{ ip.get_absolute_url }}" class="badge text-bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a>
{% else %}
<a href="{{ ip.get_absolute_url }}" class="table-badge">{{ ip }}</a>
<a href="{{ ip.get_absolute_url }}">{{ ip }}</a>
{% endif %}
{% endfor %}
</div>
"""

INTERFACE_FHRPGROUPS = """
<div class="table-badge-group">
{% for assignment in value.all %}
<a href="{{ assignment.group.get_absolute_url }}">{{ assignment.group.get_protocol_display }}: {{ assignment.group.group_id }}</a>
{% endfor %}
</div>
"""

INTERFACE_TAGGED_VLANS = """
Expand Down
1 change: 1 addition & 0 deletions netbox/dcim/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3353,6 +3353,7 @@ def get(self, request, pk):
formset = VCMemberFormSet(queryset=members_queryset)

return render(request, 'dcim/virtualchassis_edit.html', {
'object': virtual_chassis,
'vc_form': vc_form,
'formset': formset,
'return_url': self.get_return_url(request, virtual_chassis),
Expand Down
2 changes: 1 addition & 1 deletion netbox/ipam/tables/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'RoleTable',
)

AVAILABLE_LABEL = mark_safe('<span class="badge bg-success">Available</span>')
AVAILABLE_LABEL = mark_safe('<span class="badge text-bg-success">Available</span>')

AGGREGATE_COPY_BUTTON = """
{% copy_content record.pk prefix="aggregate_" %}
Expand Down
2 changes: 1 addition & 1 deletion netbox/ipam/tables/vlans.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'VLANVirtualMachinesTable',
)

AVAILABLE_LABEL = mark_safe('<span class="badge bg-success">Available</span>')
AVAILABLE_LABEL = mark_safe('<span class="badge text-bg-success">Available</span>')

VLAN_LINK = """
{% if record.pk %}
Expand Down
6 changes: 2 additions & 4 deletions netbox/netbox/navigation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ def get_model_buttons(app_label, model_name, actions=('add', 'import')):
link=f'{app_label}:{model_name}_add',
title='Add',
icon_class='mdi mdi-plus-thick',
permissions=[f'{app_label}.add_{model_name}'],
color=ButtonColorChoices.GREEN
permissions=[f'{app_label}.add_{model_name}']
)
)
if 'import' in actions:
Expand All @@ -89,8 +88,7 @@ def get_model_buttons(app_label, model_name, actions=('add', 'import')):
link=f'{app_label}:{model_name}_import',
title='Import',
icon_class='mdi mdi-upload',
permissions=[f'{app_label}.add_{model_name}'],
color=ButtonColorChoices.CYAN
permissions=[f'{app_label}.add_{model_name}']
)
)

Expand Down
12 changes: 4 additions & 8 deletions netbox/netbox/navigation/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,13 @@
link=f'users:netboxuser_add',
title='Add',
icon_class='mdi mdi-plus-thick',
permissions=[f'auth.add_user'],
color=ButtonColorChoices.GREEN
permissions=[f'auth.add_user']
),
MenuItemButton(
link=f'users:netboxuser_import',
title='Import',
icon_class='mdi mdi-upload',
permissions=[f'auth.add_user'],
color=ButtonColorChoices.CYAN
permissions=[f'auth.add_user']
)
)
),
Expand All @@ -409,15 +407,13 @@
link=f'users:netboxgroup_add',
title='Add',
icon_class='mdi mdi-plus-thick',
permissions=[f'auth.add_group'],
color=ButtonColorChoices.GREEN
permissions=[f'auth.add_group']
),
MenuItemButton(
link=f'users:netboxgroup_import',
title='Import',
icon_class='mdi mdi-upload',
permissions=[f'auth.add_group'],
color=ButtonColorChoices.CYAN
permissions=[f'auth.add_group']
)
)
),
Expand Down
7 changes: 5 additions & 2 deletions netbox/netbox/tables/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ def __init__(self, *args, **kwargs):
visible = kwargs.pop('visible', False)
if 'attrs' not in kwargs:
kwargs['attrs'] = {
'th': {
'class': 'w-1',
},
'td': {
'class': 'min-width',
'class': 'w-1',
},
'input': {
'class': 'form-check-input'
Expand Down Expand Up @@ -322,7 +325,7 @@ def render(self, record, bound_column, value):
except AttributeError:
bg_color = self.DEFAULT_BG_COLOR

return mark_safe(f'<span class="badge bg-{bg_color}">{value}</span>')
return mark_safe(f'<span class="badge text-bg-{bg_color}">{value}</span>')

def value(self, value):
return value
Expand Down
2 changes: 1 addition & 1 deletion netbox/netbox/tables/template_code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SEARCH_RESULT_ATTRS = """
{% for name, value in record.display_attrs.items %}
<span class="badge bg-secondary"
<span class="badge text-bg-secondary"
{% if value|length > 40 %} data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ value }}"{% endif %}
>
{{ name|bettertitle }}:
Expand Down
13 changes: 5 additions & 8 deletions netbox/project-static/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ async function bundleScripts() {
async function bundleStyles() {
try {
const entryPoints = {
'netbox-external': 'styles/_external.scss',
'netbox-light': 'styles/_light.scss',
'netbox-dark': 'styles/_dark.scss',
'netbox-print': 'styles/_print.scss',
rack_elevation: 'styles/_rack_elevation.scss',
cable_trace: 'styles/_cable_trace.scss',
'netbox-external': 'styles/external.scss',
'netbox': 'styles/netbox.scss',
rack_elevation: 'styles/svg/rack_elevation.scss',
cable_trace: 'styles/svg/cable_trace.scss',
graphiql: 'netbox-graphiql/graphiql.scss',
};
const pluginOptions = { outputStyle: 'compressed' };
Expand All @@ -102,8 +100,7 @@ async function bundleStyles() {
});
if (result.errors.length === 0) {
for (const [targetName, sourceName] of Object.entries(entryPoints)) {
const source = sourceName.split('/')[1];
console.log(`✅ Bundled source file '${source}' to '${targetName}.css'`);
console.log(`✅ Bundled source file '${sourceName}' to '${targetName}.css'`);
}
}
} catch (err) {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion netbox/project-static/dist/cable_trace.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox-external.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox-print.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions netbox/project-static/dist/netbox.css

Large diffs are not rendered by default.

31 changes: 14 additions & 17 deletions netbox/project-static/dist/netbox.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions netbox/project-static/dist/netbox.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion netbox/project-static/dist/rack_elevation.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading