Compare commits
6 Commits
3ad769f5a6
...
c807d39dca
Author | SHA1 | Date |
---|---|---|
Arthur Hanson | c807d39dca | |
Arthur | 835012f2ed | |
Arthur | fcce7b7bf4 | |
Arthur | 510aa2156d | |
Arthur | 4b436c9d4f | |
Arthur | 5429bf651d |
|
@ -113,6 +113,7 @@ async function bundleStyles() {
|
||||||
'netbox': 'styles/netbox.scss',
|
'netbox': 'styles/netbox.scss',
|
||||||
rack_elevation: 'styles/svg/rack_elevation.scss',
|
rack_elevation: 'styles/svg/rack_elevation.scss',
|
||||||
cable_trace: 'styles/svg/cable_trace.scss',
|
cable_trace: 'styles/svg/cable_trace.scss',
|
||||||
|
'rest-api': 'styles/rest_api.scss',
|
||||||
};
|
};
|
||||||
const pluginOptions = { outputStyle: 'compressed' };
|
const pluginOptions = { outputStyle: 'compressed' };
|
||||||
// Allow cache disabling.
|
// Allow cache disabling.
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
.breadcrumb {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.btn-primary {
|
||||||
|
background-color: #17a2b8;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.navbar-default {
|
||||||
|
background-color: #1f2e41;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.navbar-default .navbar-text {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.navbar>.container .navbar-brand, .navbar>.container-fluid .navbar-brand {
|
||||||
|
padding: 12px 0 12px 0;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-left: 1px;
|
||||||
|
}
|
||||||
|
.prettyprint {
|
||||||
|
background-color: #f6f8fb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-header {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
|
@ -2,6 +2,13 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block bootstrap_theme %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/bootstrap.min.css" %}"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "rest-api.css" %}"/>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block bootstrap_navbar_variant %}navbar-default{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
<link rel="icon" type="image/png" href="{% static 'rest-api.ico' %}" />
|
<link rel="icon" type="image/png" href="{% static 'rest-api.ico' %}" />
|
||||||
|
@ -10,5 +17,7 @@
|
||||||
{% block title %}{% if name %}{{ name }} | {% endif %}NetBox {% trans "REST API" %}{% endblock %}
|
{% block title %}{% if name %}{{ name }} | {% endif %}NetBox {% trans "REST API" %}{% endblock %}
|
||||||
|
|
||||||
{% block branding %}
|
{% block branding %}
|
||||||
<a class="navbar-brand" href="{% url 'home' %}">NetBox</a>
|
<a class="navbar-brand" href="{% url 'home' %}">
|
||||||
|
<img src="{% static 'netbox_logo.svg' %}" height="32" alt="{% trans "NetBox Logo" %}" class="navbar-brand-image">
|
||||||
|
</a>
|
||||||
{% endblock branding %}
|
{% endblock branding %}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import re
|
||||||
import yaml
|
import yaml
|
||||||
from django import template
|
from django import template
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.contrib.humanize.templatetags.humanize import naturaltime
|
from django.contrib.humanize.templatetags.humanize import naturalday, naturaltime
|
||||||
from django.utils.html import escape
|
from django.utils.html import escape
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from markdown import markdown
|
from markdown import markdown
|
||||||
|
@ -216,11 +216,12 @@ def render_yaml(value):
|
||||||
def isodate(value):
|
def isodate(value):
|
||||||
if type(value) is datetime.date:
|
if type(value) is datetime.date:
|
||||||
text = value.isoformat()
|
text = value.isoformat()
|
||||||
|
return mark_safe(f'<span title="{naturalday(value)}">{text}</span>')
|
||||||
elif type(value) is datetime.datetime:
|
elif type(value) is datetime.datetime:
|
||||||
text = value.date().isoformat()
|
text = value.date().isoformat()
|
||||||
|
return mark_safe(f'<span title="{naturaltime(value)}">{text}</span>')
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
return mark_safe(f'<span title="{naturaltime(value)}">{text}</span>')
|
|
||||||
|
|
||||||
|
|
||||||
@register.filter()
|
@register.filter()
|
||||||
|
|
Loading…
Reference in New Issue