aff_port.html 4.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.

Copyright © 2017  Gabriel Détraz
Copyright © 2017  Goulven Kermarec
Copyright © 2017  Augustin Lemesle

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}

25
{% load acl %}
26
{% load logs_extra %}
27
{% load i18n %}
28

29
<div class="table-responsive">
30 31
    <table class="table table-striped">
        <thead>
32 33
            <tr>
                {% trans "Port" as tr_port %}
34
                <th>{% include 'buttons/sort.html' with prefix='port' col='port' text=tr_port %}</th>
35 36 37
                {%  if search %}
                    <th>{% trans "Switch" %}</th>
                {% endif %}
38
                {% trans "Room" as tr_room %}
39
                <th>{% include 'buttons/sort.html' with prefix='port' col='room' text=tr_room %}</th>
40
                {% trans "Interface" as tr_interface %}
41
                <th>{% include 'buttons/sort.html' with prefix='port' col='interface' text=tr_interface %}</th>
42
                {% trans "Related port" as tr_related_port %}
43
                <th>{% include 'buttons/sort.html' with prefix='port' col='related' text=tr_related_port %}</th>
44 45 46 47 48 49 50 51
                <th>{% trans "Port state" %}</th>
                <th>{% trans "Port profile" %}</th>
                <th>{% trans "Details" %}</th>
                <th></th>
            </tr>
        </thead>
       {% for port in port_list %}
            <tr>
52
			<td>{{ port.port }}</td>
53 54 55 56 57
            {% if search %}
                <td>
                    <a href="{% url 'topologie:index-port' switchid=port.switch.id %}">{{ port.switch }}</a>
                </td>
            {% endif %}
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
                <td>
                    {% if port.room %}
                    {{ port.room }}
                    {% endif %}
                </td>
                <td>
                    {% if port.machine_interface %}
                    {% can_view port.machine_interface.machine.user %}
                    <a href="{% url 'users:profil' userid=port.machine_interface.machine.user.id %}">
                        {{ port.machine_interface }}
                    </a>
                    {% acl_end %}
                    {% endif %}
                </td>
                <td>
                    {% if port.related %}
                    {% can_view port.related.switch %}
                    <a href="{% url 'topologie:index-port' switchid=port.related.switch.id %}">
                        {{ port.related }}
                    </a>
                    {% acl_else %}
79
                    {{ port.related }}
80 81 82 83 84 85 86 87 88 89 90 91 92 93
                    {% acl_end %}
                    {% endif %}
                </td>
		<td>
                    {% if port.state %}
                    <i class="text-success">{% trans "Active" %}</i>
                    {% else %}
                    <i class="text-danger">{% trans "Disabled" %}</i>
                    {% endif %}
                </td>
                <td>
                    {% if not port.custom_profil %}
                    <u>{% trans "Default: " %}</u>
                    {% endif %}
94
                    {{ port.get_port_profile }}
95 96 97 98
                </td>
                <td>{{ port.details }}</td>
                <td class="text-right">
                    {% can_edit port %}
99
                    {% include 'buttons/edit.html' with href='topologie:edit-port' id=port.id %}
100 101 102
                    {% acl_end %}
                    {% history_button port %}
                    {% can_delete port %}
103
                    {% include 'buttons/suppr.html' with href='topologie:del-port' id=port.id %}
104 105 106
                    {% acl_end %}
                </td>
            </tr>
107 108
        {% endfor %}
    </table>
109
</div>
110