Commit 41cd115f authored by chirac's avatar chirac

Merge branch 'ticks' into 'master'

Fix #143

Closes #143

See merge request federez/re2o!190
parents 7457d840 cf1057b7
......@@ -25,20 +25,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load i18n %}
{% load logs_extra %}
{% load design %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Article" %}</th>
<th>{% trans "Price" %}</th>
<th>{% trans "Cotisation type" %}</th>
<th>{% trans "Duration (month)" %}</th>
<th>{% trans "Concerned users" %}</th>
<th>{% trans "Available for everyone" %}</th>
<th></th>
</tr>
</thead>
{% for article in article_list %}
<table class="table table-striped">
<thead>
<tr>
<td>{{ article.name }}</td>
<td>{{ article.prix }}</td>
......@@ -54,7 +44,34 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% acl_end %}
{% history_button article %}
</td>
<th>{% trans "Article" %}</th>
<th>{% trans "Price" %}</th>
<th>{% trans "Cotisation type" %}</th>
<th>{% trans "Duration (month)" %}</th>
<th>{% trans "Concerned users" %}</th>
<th>{% trans "Available for everyone" %}</th>
<th></th>
</tr>
{% endfor %}
</table>
</thead>
{% for article in article_list %}
<tr>
<td>{{ article.name }}</td>
<td>{{ article.prix }}</td>
<td>{{ article.type_cotisation }}</td>
<td>{{ article.duration }}</td>
<td>{{ article.type_user }}</td>
<td>{{ article.available_for_everyone|tick }}</td>
<td class="text-right">
{% can_edit article %}
<a class="btn btn-primary btn-sm" role="button" title="{% trans "Edit" %}" href="{% url 'cotisations:edit-article' article.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
<a class="btn btn-info btn-sm" role="button" title="{% trans "Historique" %}" href="{% url 'cotisations:history' 'article' article.id %}">
<i class="fa fa-history"></i>
</a>
</td>
</tr>
{% endfor %}
</table>
......@@ -25,17 +25,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load i18n %}
{% load logs_extra %}
{% load design %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Payment type" %}</th>
<th>{% trans "Is available for everyone" %}</th>
<th>{% trans "Custom payment method" %}</th>
<th></th>
</tr>
</thead>
{% for paiement in paiement_list %}
<table class="table table-striped">
<thead>
<tr>
<td>{{ paiement.moyen }}</td>
<td>{{ paiement.available_for_everyone }}</td>
......@@ -50,7 +43,30 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% acl_end %}
{% history_button paiement %}
</td>
<th>{% trans "Payment type" %}</th>
<th>{% trans "Is available for everyone" %}</th>
<th>{% trans "Custom payment method" %}</th>
<th></th>
</tr>
{% endfor %}
</table>
</thead>
{% for paiement in paiement_list %}
<tr>
<td>{{ paiement.moyen }}</td>
<td>{{ paiement.available_for_everyone|tick }}</td>
<td>
{{paiement.get_payment_method_name}}
</td>
<td class="text-right">
{% can_edit paiement %}
<a class="btn btn-primary btn-sm" role="button" title="{% trans "Edit" %}" href="{% url 'cotisations:edit-paiement' paiement.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
<a class="btn btn-info btn-sm" role="button" title="{% trans "Historique" %}" href="{% url 'cotisations:history' 'paiement' paiement.id %}">
<i class="fa fa-history"></i>
</a>
</td>
</tr>
{% endfor %}
</table>
......@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load design %}
<div class="table-responsive">
<table class="table table-striped">
......@@ -42,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% for extension in extension_list %}
<tr>
<td>{{ extension.name }}</td>
<td>{{ extension.need_infra }}</td>
<td>{{ extension.need_infra|tick }}</td>
<td>{{ extension.soa}}</td>
<td>{{ extension.origin }}</td>
{% if ipv6_enabled %}
......@@ -53,6 +54,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include 'buttons/edit.html' with href='machines:edit-extension' id=extension.id %}
{% acl_end %}
{% history_button extension %}
{% include 'buttons/history.html' with href='machines:history' name='extension' id=extension.id %}
</td>
</tr>
{% endfor %}
......
......@@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% load design %}
{% load acl %}
{% load logs_extra %}
<div class="table-responsive">
......@@ -43,7 +45,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>{{ type.type }}</td>
<td>{{ type.extension }}</td>
<td>{{ type.need_infra }}</td>
<td>{{ type.need_infra|tick }}</td>
<td>{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}</td>
<td>{{ type.prefix_v6 }}</td>
<td>{{ type.vlan }}</td>
......@@ -53,6 +55,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include 'buttons/edit.html' with href='machines:edit-iptype' id=type.id %}
{% acl_end %}
{% history_button type %}
{% include 'buttons/history.html' with href='machines:history' name='iptype' id=type.id %}
</td>
</tr>
{% endfor %}
......
......@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load design %}
<table class="table table-striped">
<thead>
......@@ -42,12 +43,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ nas.nas_type }}</td>
<td>{{ nas.machine_type }}</td>
<td>{{ nas.port_access_mode }}</td>
<td>{{ nas.autocapture_mac }}</td>
<td>{{ nas.autocapture_mac|tick }}</td>
<td class="text-right">
{% can_edit nas %}
{% include 'buttons/edit.html' with href='machines:edit-nas' id=nas.id %}
{% acl_end %}
{% history_button nas %}
{% include 'buttons/history.html' with href='machines:history' name='nas' id=nas.id %}
</td>
</tr>
{% endfor %}
......
......@@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% load design %}
<table class="table table-striped">
<thead>
<tr>
......@@ -37,8 +39,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ server.service }}</td>
<td>{{ server.server }}</td>
<td>{{ server.last_regen }}</td>
<td>{{ server.asked_regen }}</td>
<td>{{ server.need_regen }}</td>
<td>{{ server.asked_regen| tick }}</td>
<td>{{ server.need_regen | tick }}</td>
<td class="text-right">
</td>
</tr>
......
......@@ -47,6 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include 'buttons/edit.html' with href='machines:edit-service' id=service.id %}
{% acl_end %}
{% history_button service %}
{% include 'buttons/history.html' with href='machines:history' name='service' id=service.id %}
</td>
</tr>
{% endfor %}
......
This diff is collapsed.
#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 Maël Kervella
#
# 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.
#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 Maël Kervella
#
# 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.
from django import template
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(needs_autoescape=False)
def tick(valeur, autoescape=False):
if isinstance(valeur,bool):
if valeur == True:
result = '<i style="color: #1ECA18;" class="fas fa-check"></i>'
else:
result = '<i style="color: #D10115;" class="fas fa-times"></i>'
return mark_safe(result)
else: # if the value is not a boolean, display it as if tick was not called
return valeur
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment