diff --git a/multi_op/migrations/0003_auto_20200904_1938.py b/multi_op/migrations/0003_auto_20200904_1938.py new file mode 100644 index 00000000..de4e6b82 --- /dev/null +++ b/multi_op/migrations/0003_auto_20200904_1938.py @@ -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'), + ), + ] diff --git a/multi_op/preferences/models.py b/multi_op/preferences/models.py index 8a185188..7d5e3d3a 100644 --- a/multi_op/preferences/models.py +++ b/multi_op/preferences/models.py @@ -27,13 +27,15 @@ with multiple operators. from django.db import models 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.""" enabled_dorm = models.ManyToManyField( "topologie.Dormitory", - related_name="vlan_tagged", + related_name="enabled_dorm_multiop", blank=True, verbose_name=_("enabled dorm"), ) diff --git a/multi_op/templates/multi_op/preferences.html b/multi_op/templates/multi_op/preferences.html index 391b7330..5529dbe3 100644 --- a/multi_op/templates/multi_op/preferences.html +++ b/multi_op/templates/multi_op/preferences.html @@ -8,23 +8,20 @@ -
- {% comment %} - +
+ {% trans "Edit" %} -

- {% endcomment %} +

- - - - -

{% trans "Enabled Dorm" %}

{{ preferences.enabled_dorm | tick}}

-
+ +

{% trans "Enabled Dorm" %}

+

{{ preferences.enabled_dorm.all|join:", " }}

+ +