Quellcode durchsuchen

Add model doc modal to object add/edit template

Jeremy Stretch vor 6 Jahren
Ursprung
Commit
25f4cae3ff
1 geänderte Dateien mit 8 neuen und 1 gelöschten Zeilen
  1. 8 1
      netbox/templates/utilities/obj_edit.html

+ 8 - 1
netbox/templates/utilities/obj_edit.html

@@ -1,5 +1,6 @@
 {% extends '_base.html' %}
 {% load form_helpers %}
+{% load helpers %}
 
 {% block content %}
     <form action="" method="post" enctype="multipart/form-data" class="form form-horizontal">
@@ -9,7 +10,12 @@
         {% endfor %}
         <div class="row">
             <div class="col-md-6 col-md-offset-3">
-                <h3>{% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}</h3>
+                <h3>
+                    <div class="pull-right">
+                        <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#docs_modal"><i class="fa fa-question"></i></button>
+                    </div>
+                    {% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}
+                </h3>
                 {% block tabs %}{% endblock %}
                 {% if form.non_field_errors %}
                     <div class="panel panel-danger">
@@ -43,4 +49,5 @@
             </div>
         </div>
     </form>
+    {% include 'inc/modal.html' with name='docs' title='Documentation' content=obj|get_docs %}
 {% endblock %}