device_component_add.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {% extends 'base/layout.html' %}
  2. {% load helpers %}
  3. {% load form_helpers %}
  4. {% block title %}Create {{ component_type }}{% endblock %}
  5. {% render_errors form %}
  6. {% block content %}
  7. <form action="" method="post" enctype="multipart/form-data">
  8. {% csrf_token %}
  9. <div class="row">
  10. <div class="col col-md-8 offset-md-2 col-lg-6 offset-lg-3">
  11. <div class="field-group">
  12. <h5 class="text-center">{{ component_type|title }}</h5>
  13. {% for field in form.hidden_fields %}
  14. {{ field }}
  15. {% endfor %}
  16. {% for field in form.visible_fields %}
  17. {% if not form.custom_fields or field.name not in form.custom_fields %}
  18. {% render_field field %}
  19. {% endif %}
  20. {% endfor %}
  21. {% if form.custom_fields %}
  22. <div class="field-group">
  23. <h5 class="text-center">Custom Fields</h5>
  24. {% render_custom_fields form %}
  25. </div>
  26. {% endif %}
  27. </div>
  28. </div>
  29. </div>
  30. <div class="row my-3">
  31. <div class="col col-md-8 offset-md-2 col-lg-6 offset-lg-3 text-end">
  32. {% block buttons %}
  33. <a class="btn btn-outline-danger" href="{{ return_url }}">Cancel</a>
  34. {% if component_type == 'interface' and perms.ipam.add_ipaddress %}
  35. <button type="submit" name="_assignip" class="btn btn-outline-success">
  36. Create & Assign IP Address
  37. </button>
  38. {% endif %}
  39. <button type="submit" name="_addanother" class="btn btn-outline-primary">
  40. Create & Add Another
  41. </button>
  42. <button type="submit" name="_create" class="btn btn-primary">
  43. Create
  44. </button>
  45. {% endblock %}
  46. </div>
  47. </div>
  48. </form>
  49. {% endblock %}