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

Material Design Icons #2776

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions netbox/circuits/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

CIRCUITTYPE_ACTIONS = """
<a href="{% url 'circuits:circuittype_changelog' slug=record.slug %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.circuit.change_circuittype %}
<a href="{% url 'circuits:circuittype_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'circuits:circuittype_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

Expand Down
38 changes: 19 additions & 19 deletions netbox/dcim/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

REGION_LINK = """
{% if record.get_children %}
<span style="padding-left: {{ record.get_ancestors|length }}0px "><i class="fa fa-caret-right"></i>
<span style="padding-left: {{ record.get_ancestors|length }}0px "><i class="mdi mdi-chevron-right"></i>
{% else %}
<span style="padding-left: {{ record.get_ancestors|length }}9px">
{% endif %}
Expand Down Expand Up @@ -41,33 +41,33 @@

REGION_ACTIONS = """
<a href="{% url 'dcim:region_changelog' pk=record.pk %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.dcim.change_region %}
<a href="{% url 'dcim:region_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'dcim:region_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

RACKGROUP_ACTIONS = """
<a href="{% url 'dcim:rackgroup_changelog' pk=record.pk %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
<a href="{% url 'dcim:rack_elevation_list' %}?site={{ record.site.slug }}&group_id={{ record.pk }}" class="btn btn-xs btn-primary" title="View elevations">
<i class="fa fa-eye"></i>
<i class="mdi mdi-eye"></i>
</a>
{% if perms.dcim.change_rackgroup %}
<a href="{% url 'dcim:rackgroup_edit' pk=record.pk %}" class="btn btn-xs btn-warning" title="Edit">
<i class="glyphicon glyphicon-pencil"></i>
<i class="mdi mdi-lead-pencil"></i>
</a>
{% endif %}
"""

RACKROLE_ACTIONS = """
<a href="{% url 'dcim:rackrole_changelog' pk=record.pk %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.dcim.change_rackrole %}
<a href="{% url 'dcim:rackrole_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'dcim:rackrole_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

Expand All @@ -85,28 +85,28 @@

RACKRESERVATION_ACTIONS = """
<a href="{% url 'dcim:rackreservation_changelog' pk=record.pk %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.dcim.change_rackreservation %}
<a href="{% url 'dcim:rackreservation_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'dcim:rackreservation_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

MANUFACTURER_ACTIONS = """
<a href="{% url 'dcim:manufacturer_changelog' slug=record.slug %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.dcim.change_manufacturer %}
<a href="{% url 'dcim:manufacturer_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'dcim:manufacturer_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

DEVICEROLE_ACTIONS = """
<a href="{% url 'dcim:devicerole_changelog' slug=record.slug %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.dcim.change_devicerole %}
<a href="{% url 'dcim:devicerole_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'dcim:devicerole_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

Expand All @@ -128,10 +128,10 @@

PLATFORM_ACTIONS = """
<a href="{% url 'dcim:platform_changelog' slug=record.slug %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.dcim.change_platform %}
<a href="{% url 'dcim:platform_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'dcim:platform_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

Expand Down Expand Up @@ -164,10 +164,10 @@

VIRTUALCHASSIS_ACTIONS = """
<a href="{% url 'dcim:virtualchassis_changelog' pk=record.pk %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.dcim.change_virtualchassis %}
<a href="{% url 'dcim:virtualchassis_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'dcim:virtualchassis_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

Expand All @@ -190,7 +190,7 @@

class RegionTable(BaseTable):
pk = ToggleColumn()
name = tables.TemplateColumn(template_code=REGION_LINK, orderable=False)
name = tables.TemplateColumn(template_code=REGION_LINK, orderable=False, attrs={'th': {'style': 'padding-left: 17px'}})
site_count = tables.Column(verbose_name='Sites')
slug = tables.Column(verbose_name='Slug')
actions = tables.TemplateColumn(
Expand Down
8 changes: 4 additions & 4 deletions netbox/extras/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

TAG_ACTIONS = """
{% if perms.taggit.change_tag %}
<a href="{% url 'extras:tag_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'extras:tag_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
{% if perms.taggit.delete_tag %}
<a href="{% url 'extras:tag_delete' slug=record.slug %}" class="btn btn-xs btn-danger"><i class="glyphicon glyphicon-trash" aria-hidden="true"></i></a>
<a href="{% url 'extras:tag_delete' slug=record.slug %}" class="btn btn-xs btn-danger"><i class="mdi mdi-trash-can-outline" aria-hidden="true"></i></a>
{% endif %}
"""

Expand All @@ -24,10 +24,10 @@

CONFIGCONTEXT_ACTIONS = """
{% if perms.extras.change_configcontext %}
<a href="{% url 'extras:configcontext_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'extras:configcontext_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
{% if perms.extras.delete_configcontext %}
<a href="{% url 'extras:configcontext_delete' pk=record.pk %}" class="btn btn-xs btn-danger"><i class="glyphicon glyphicon-trash" aria-hidden="true"></i></a>
<a href="{% url 'extras:configcontext_delete' pk=record.pk %}" class="btn btn-xs btn-danger"><i class="mdi mdi-trash-can-outline" aria-hidden="true"></i></a>
{% endif %}
"""

Expand Down
20 changes: 10 additions & 10 deletions netbox/ipam/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

RIR_ACTIONS = """
<a href="{% url 'ipam:rir_changelog' slug=record.slug %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.ipam.change_rir %}
<a href="{% url 'ipam:rir_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'ipam:rir_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

Expand All @@ -49,16 +49,16 @@

ROLE_ACTIONS = """
<a href="{% url 'ipam:role_changelog' slug=record.slug %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% if perms.ipam.change_role %}
<a href="{% url 'ipam:role_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'ipam:role_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

PREFIX_LINK = """
{% if record.has_children %}
<span class="text-nowrap" style="padding-left: {{ record.depth }}0px "><i class="fa fa-caret-right"></i></a>
<span class="text-nowrap" style="padding-left: {{ record.depth }}0px "><i class="mdi mdi-chevron-right"></i></a>
{% else %}
<span class="text-nowrap" style="padding-left: {{ record.depth }}9px">
{% endif %}
Expand Down Expand Up @@ -142,29 +142,29 @@

VLANGROUP_ACTIONS = """
<a href="{% url 'ipam:vlangroup_changelog' pk=record.pk %}" class="btn btn-default btn-xs" title="Changelog">
<i class="fa fa-history"></i>
<i class="mdi mdi-history"></i>
</a>
{% with next_vid=record.get_next_available_vid %}
{% if next_vid and perms.ipam.add_vlan %}
<a href="{% url 'ipam:vlan_add' %}?site={{ record.site_id }}&group={{ record.pk }}&vid={{ next_vid }}" title="Add VLAN" class="btn btn-xs btn-success">
<i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
<i class="mdi mdi-plus" aria-hidden="true"></i>
</a>
{% endif %}
{% endwith %}
{% if perms.ipam.change_vlangroup %}
<a href="{% url 'ipam:vlangroup_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
<a href="{% url 'ipam:vlangroup_edit' pk=record.pk %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil" aria-hidden="true"></i></a>
{% endif %}
"""

VLAN_MEMBER_UNTAGGED = """
{% if record.untagged_vlan_id == vlan.pk %}
<i class="glyphicon glyphicon-ok">
<i class="mdi mdi-check-circle">
{% endif %}
"""

VLAN_MEMBER_ACTIONS = """
{% if perms.dcim.change_interface %}
<a href="{% if record.device %}{% url 'dcim:interface_edit' pk=record.pk %}{% else %}{% url 'virtualization:interface_edit' pk=record.pk %}{% endif %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil"></i></a>
<a href="{% if record.device %}{% url 'dcim:interface_edit' pk=record.pk %}{% else %}{% url 'virtualization:interface_edit' pk=record.pk %}{% endif %}" class="btn btn-xs btn-warning"><i class="mdi mdi-lead-pencil"></i></a>
{% endif %}
"""

Expand Down
79 changes: 78 additions & 1 deletion netbox/project-static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,23 @@ table.interface-ips th {
font-weight: normal;
}

/* Interfaces */
#interfaces_table tr.ipaddresses td:nth-child(2) {
padding: 0;
}
#interfaces_table tr.ipaddresses td:nth-child(2) tr th:first-child,
#interfaces_table tr.ipaddresses td:nth-child(2) tr td:first-child{
border-left: 1px solid #ddd;
}
#interfaces_table tr.ipaddresses td:nth-child(2) td.text-right {
padding-right: 8px;
}
tr a.trace {
position: relative;
top: -1px;
margin-left: 3px;
}

/* Reports */
table.reports td.method {
font-family: monospace;
Expand Down Expand Up @@ -413,7 +430,7 @@ table.report th a {
z-index: 999;
height: 2em;
width: 2em;
overflow: show;
overflow: visible;
margin: auto;
top: 0;
left: 0;
Expand Down Expand Up @@ -464,4 +481,64 @@ td .progress {
}
textarea {
font-family: Consolas, Lucida Console, monospace;
}
/* MaterialDesign Icons */
.mdi::before {
font-size: 14px;
line-height: 14px;
}
.mdi.mdi-magnify::before,
.mdi.mdi-close::before,
.mdi.mdi-plus::before {
font-weight: bold;
}
.mdi.mdi-fw::before {
width: 1.2857142857142858em;
text-align: center;
}
.mdi.mdi-7em::before {
font-size: 7em;
}
.btn .mdi {
vertical-align: text-top;
}
.btn .mdi::before {
margin: 0 -3px;
font-size: 20px;
}
.btn-xs .mdi {
vertical-align: unset;
}
.btn-xs .mdi::before {
vertical-align: text-top;
font-size: 17px;
}
.btn-sm .mdi {
vertical-align: text-top;
}
.btn-sm .mdi::before {
font-size: 17px;
margin: 0;
}
span.mdi::before {
font-size: 18px;
}
span.label .mdi {
vertical-align: text-top;
}
span.label .mdi::before {
vertical-align: text-top;
margin: 0 -3px;
}
tr.interface span i.mdi::before {
vertical-align: middle;
font-size: 16px;
}
tr.interface span i.mdi.mdi-format-align-justify::before {
vertical-align: text-top;
}
.table i.mdi.mdi-chevron-right::before {
vertical-align: text-bottom;
margin-left: -5px;
margin-right: -5px;
}
22 changes: 22 additions & 0 deletions netbox/project-static/vendor/materialdesign-webfont/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
> *Note:* Please use the main [MaterialDesign](https://github.com/Templarian/MaterialDesign/issues) repo to report issues. This repo is for distribution of the Webfont files only.

# Webfont - Material Design Icons

Webfont distribution for the [Material Design Icons](https://materialdesignicons.com).

```
npm install @mdi/font
bower install mdi
```

## Related Packages

[NPM @MDI Organization](https://npmjs.com/org/mdi)

- JavaScript/Typescript: [MaterialDesign-JS](https://github.com/Templarian/MaterialDesign-JS)
- SVG: [MaterialDesign-SVG](https://github.com/Templarian/MaterialDesign-SVG)

## Learn More

- [MaterialDesignIcons.com](https://materialdesignicons.com)
- https://github.com/Templarian/MaterialDesign
22 changes: 22 additions & 0 deletions netbox/project-static/vendor/materialdesign-webfont/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "mdi",
"main": [
"scss/materialdesignicons.scss"
],
"homepage": "http://materialdesignicons.com",
"authors": [
{ "name": "Austin Andrews", "homepage": "http://templarian.com" },
{ "name": "Google", "homepage": "http://www.google.com/design" }
],
"license": ["OFL-1.1", "MIT"],
"ignore": [
"*.md",
"*.json"
],
"keywords": [
"material",
"design",
"icons",
"webfont"
]
}
Loading