aff_summary.html 5.47 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 26
{% if versions_list.paginator %}
{% include "pagination.html" with list=versions_list %}
27 28 29
{% endif %}

{% load logs_extra %}
30
{% load acl %}
31 32 33
    <table class="table table-striped">
        <thead>
            <tr>
34
                <th>{% include "buttons/sort.html" with prefix='sum' col='date' text='Date' %}</th>
35 36
                <th>Modification</th>
		<th></th>
37 38
            </tr>
        </thead>
39 40
    {% for v in versions_list %}
    {% if v.version.content_type.model == 'ban' %}
41
        <tr class="danger">
42
            <td>{{ v.datetime }}</td>
43
            <td>
44 45
                {{ v.username }} a banni
                <a href="{% url 'users:profil' v.version.object.user_id %}">{{ v.version.object.user.get_username }}</a>
46
		(<i>
47
                {% if v.version.object.raison == '' %}
48 49
                    Aucune raison
                {% else %}
50
                    {{ v.version.object.raison }}
51 52
                {% endif %}
                </i>)
53
            </td>
54
        {% can_edit_history %}
55
            <td>
56
                <a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
57
                    <i class="fa fa-times"></i>
58 59 60
                    Annuler
                </a>
            </td>
61
        {% acl_end %}
62
        </tr>
63
    {% elif v.version.content_type.model == 'whitelist' %}
64
        <tr class="success">
65
            <td>{{ v.datetime }}</td>
66
            <td>
67 68
                {{ v.username }} a autorisé gracieusement
                <a href="{% url 'users:profil' v.version.object.user_id %}">{{ v.version.object.user.get_username }}</a>
69
                (<i>
70
                {% if v.version.object.raison == '' %}
71 72
                    Aucune raison
                {% else %}
73
                    {{ v.version.object.raison }}
74 75
                {% endif %}
                </i>)
76
            </td>
77
        {% can_edit_history%}
78
            <td>
79
                <a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
80
                    <i class="fa fa-times"></i>
81 82 83
                    Annuler
                </a>
            </td>
84
        {% acl_end %}
85
        </tr>
86
    {% elif v.version.content_type.model == 'user' %}
87
        <tr>
88
            <td>{{ v.datetime }}</td>
89
            <td>
90 91 92 93
                {{ v.username }} a mis à jour
                <a href="{% url 'users:profil' v.version.object.id %}">{{ v.version.object.get_username }}</a>
            {% if v.comment != '' %}
                (<i>{{ v.comment }}</i>)
94
            {% endif %}
95
            </td>
96
        {% can_edit_history %}
97
            <td>
98
                <a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
99
                    <i class="fa fa-times"></i>
100 101 102
                    Annuler
                </a>
            </td>
103
        {% acl_end %}
104
        </tr>
105
    {% elif v.version.content_type.model == 'vente' %}
106
        <tr>
107
            <td>{{ v.datetime }}</td>
108
            <td>
109 110 111 112
                {{ v.username }} a vendu {{ v.version.object.number }}x {{ v.version.object.name }} à
                <a href="{% url 'users:profil' v.version.object.facture.user_id %}">{{ v.version.object.facture.user.get_username }}</a>
            {% if v.version.object.iscotisation %}
                (<i>+{{ v.version.object.duration }} mois</i>)
113 114
            {% endif %}
            </td>
115
        {% can_edit_history %}
116
            <td>
117
                <a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
118
                    <i class="fa fa-times"></i>
119 120 121
                    Annuler
                </a>
            </td>
122
        {% acl_end %}
123
        </tr>
124
    {% elif v.version.content_type.model == 'interface' %}
125
        <tr>
126
            <td>{{ v.datetime }}</td>
127
            <td>
128 129 130 131
                {{ v.username }} a modifié une interface de
                <a href="{% url 'users:profil' v.version.object.machine.user_id %}">{{ v.version.object.machine.user.get_username }}</a>
            {% if v.comment != '' %}
                (<i>{{ v.comment }}</i>)
132
            {% endif %}
133
            </td>
134
        {% can_edit_history %}
135
            <td>
136
                <a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
137
                    <i class="fa fa-times"></i>
138 139 140
                    Annuler
                </a>
            </td>
141
        {% acl_end %}
142
        </tr>
143
    {% endif %}
144
    {% endfor %}
145
    </table>
146

147 148 149
{% if versions_list.paginator %}
{% include "pagination.html" with list=versions_list %}
{% endif %}