8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 09:26:27 +00:00

L'édition des réglages de multi_op fonctionne

This commit is contained in:
Gabriel Detraz 2020-09-04 19:54:46 +02:00 committed by Gabriel Detraz
parent b3333b020d
commit 000d64adf0
3 changed files with 32 additions and 13 deletions

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-09-04 17:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('multi_op', '0002_auto_20200904_1905'),
]
operations = [
migrations.AlterField(
model_name='multiopoption',
name='enabled_dorm',
field=models.ManyToManyField(blank=True, related_name='enabled_dorm_multiop', to='topologie.Dormitory', verbose_name='enabled dorm'),
),
]

View file

@ -27,13 +27,15 @@ with multiple operators.
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from re2o.mixins import AclMixin, RevMixin
from preferences.models import PreferencesModel
class Preferences(models.Model): class MultiopOption(AclMixin, PreferencesModel):
"""Definition of the settings of multi_op.""" """Definition of the settings of multi_op."""
enabled_dorm = models.ManyToManyField( enabled_dorm = models.ManyToManyField(
"topologie.Dormitory", "topologie.Dormitory",
related_name="vlan_tagged", related_name="enabled_dorm_multiop",
blank=True, blank=True,
verbose_name=_("enabled dorm"), verbose_name=_("enabled dorm"),
) )

View file

@ -9,21 +9,18 @@
</div> </div>
<div id="collapse_multiop" class="panel-collapse panel-body collapse"> <div id="collapse_multiop" class="panel-collapse panel-body collapse">
{% comment %} <a class="btn btn-primary btn-sm" role="button" href="{% url 'multi_op:edit-options' 'MultiopOption' %}">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'tickets:edit-options' 'TicketOption' %}">
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
{% trans "Edit" %} {% trans "Edit" %}
</a> </a>
<p></p> <p></p>
{% endcomment %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table"> <table class="table">
<tr> <tr>
<th><p>{% trans "Enabled Dorm" %}</p></th> <th><p>{% trans "Enabled Dorm" %}</p></th>
<td><p>{{ preferences.enabled_dorm | tick}}</p></td> <td><p>{{ preferences.enabled_dorm.all|join:", " }}</p></td>
</tr> </tr>
<table class="table">
</table> </table>
</div> </div>
</div> </div>