switch-port-edit.html 1.89 KB
Newer Older
1 2 3 4 5 6 7
{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load staticfiles %}
{% load crispy_forms_tags %}

Kálmán Viktor committed
8 9
{% block title-page %}{{ switch_port_pk }} | {% trans "switch port" %}{% endblock %}

10 11
{% block content %}
<div class="page-header">
Kálmán Viktor committed
12
  <a href="{% url "network.switch_port_delete" pk=switch_port_pk %}" class="btn btn-danger pull-right"><i class="fa fa-times-circle"></i> {% trans "Delete this switchport" %}</a>
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  <h2>Welp <small>dunno what to write here</small></h2>
</div>
<div class="row">
  <div class="col-sm-5">
    {% crispy form %}
  </div>
  <style>
    .ethernet-devices-mini-table tr td:last-child {
      width: 1px;
    }
  </style>
  <div class="col-sm-5 col-sm-offset-1">
    <h3>{% trans "Ethernet Devices" %}</h3>
      <hr />
      {% if devices %}
        <table class="table table-condensed table-bordered ethernet-devices-mini-table">
        {% for i in devices %}
          <tr>
            <td>{{ i }}</td>
            <td>
33
              <a href="{% url "network.remove_switch_port_device" pk=switch_port_pk device_pk=i.pk %}"><i class="fa fa-times"></i></a>
34 35 36 37 38 39 40 41 42
            </td>
          </tr>
        {% endfor %}
        </table>
      {% else %}
        {% trans "No ethernet device" %}
      {% endif %}
      <hr />
      <form action="{% url "network.add_switch_port_device" pk=switch_port_pk %}" method="POST">
43 44
        {% csrf_token %}
          <div class="input-group">
45
            <input type="text" class="form-control" name="device_name" placeholder="{% trans "Name" %}"/>
46
              <div class="input-group-btn">
47
                <input type="submit" value="{% trans "Add new Ethernet Device" %}" class="btn btn-default"></input>
48 49 50
              </div>
            </div><!-- input-group -->
        </form>
51 52 53 54 55 56 57
  </div>
</div>
{% endblock %}

{% block extra_etc %}
  <script src="{% static "js/switch-port.js" %}"></script>
{% endblock %}