From ecdf66c4543e2b211647726aaffd2db41feffed9 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 29 Aug 2017 22:29:30 -0400 Subject: [PATCH] Closes #1326: Added dropdown widget with common values for circuit speed fields --- netbox/templates/circuits/circuit_edit.html | 20 ++++++++++++- .../circuits/circuittermination_edit.html | 28 +++++++++++++++++-- .../templates/circuits/inc/speed_widget.html | 17 +++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 netbox/templates/circuits/inc/speed_widget.html diff --git a/netbox/templates/circuits/circuit_edit.html b/netbox/templates/circuits/circuit_edit.html index 7cff002ae..63d38ef52 100644 --- a/netbox/templates/circuits/circuit_edit.html +++ b/netbox/templates/circuits/circuit_edit.html @@ -9,7 +9,16 @@ {% render_field form.cid %} {% render_field form.type %} {% render_field form.install_date %} - {% render_field form.commit_rate %} +
+ +
+
+ {{ form.commit_rate }} + {% include 'circuits/inc/speed_widget.html' with target_field='commit_rate' %} +
+ {{ form.commit_rate.help_text }} +
+
{% render_field form.description %} @@ -35,3 +44,12 @@ {% endblock %} + +{% block javascript %} + +{% endblock %} diff --git a/netbox/templates/circuits/circuittermination_edit.html b/netbox/templates/circuits/circuittermination_edit.html index 13052966b..a2c7d966f 100644 --- a/netbox/templates/circuits/circuittermination_edit.html +++ b/netbox/templates/circuits/circuittermination_edit.html @@ -49,8 +49,26 @@
Termination Details
- {% render_field form.port_speed %} - {% render_field form.upstream_speed %} +
+ +
+
+ {{ form.port_speed }} + {% include 'circuits/inc/speed_widget.html' with target_field='port_speed' %} +
+ {{ form.port_speed.help_text }} +
+
+
+ +
+
+ {{ form.upstream_speed }} + {% include 'circuits/inc/speed_widget.html' with target_field='upstream_speed' %} +
+ {{ form.upstream_speed.help_text }} +
+
{% render_field form.xconnect_id %} {% render_field form.pp_info %}
@@ -72,4 +90,10 @@ {% block javascript %} + {% endblock %} diff --git a/netbox/templates/circuits/inc/speed_widget.html b/netbox/templates/circuits/inc/speed_widget.html new file mode 100644 index 000000000..988418945 --- /dev/null +++ b/netbox/templates/circuits/inc/speed_widget.html @@ -0,0 +1,17 @@ + + + +