Show if a list is active or not.

This commit is contained in:
Santiago Lamora 2020-01-14 11:28:57 +01:00
parent fb0c734f60
commit 4cc3707ad5
2 changed files with 6 additions and 6 deletions

View file

@ -229,6 +229,7 @@ class MailinglistService(OrchestraModel):
fields = ('name', 'status', 'address_name', 'admin_email', 'configure') fields = ('name', 'status', 'address_name', 'admin_email', 'configure')
param_defaults = { param_defaults = {
'name': None, 'name': None,
'is_active': True,
'admin_email': None, 'admin_email': None,
} }
@ -236,11 +237,6 @@ class MailinglistService(OrchestraModel):
self.data = kwargs self.data = kwargs
super().__init__(**kwargs) super().__init__(**kwargs)
@property
def status(self):
# TODO(@slamora): where retrieve if the list is active?
return 'active'
@property @property
def address_name(self): def address_name(self):
return "{}@{}".format(self.data['address_name'], self.data['address_domain']['name']) return "{}@{}".format(self.data['address_name'], self.data['address_domain']['name'])

View file

@ -30,7 +30,11 @@
{% for resource in object_list %} {% for resource in object_list %}
<tr> <tr>
<th scope="row">{{ resource.name }}</th> <th scope="row">{{ resource.name }}</th>
<td class="text-primary font-weight-bold">{{ resource.status|capfirst }}</td> {% if resource.is_active %}
<td class="text-primary font-weight-bold">{% trans "Active" %}</td>
{% else %}
<td class="text-danger font-weight-bold">{% trans "Inactive" %}</td>
{% endif %}
<td>{{ resource.address_name}}</td> <td>{{ resource.address_name}}</td>
<td>{{ resource.admin_email }}</td> <td>{{ resource.admin_email }}</td>
<td><a href="#TODO-{{ resource.manager_url }}" target="_blank" rel="noopener noreferrer">Mailtrain</a></td> <td><a href="#TODO-{{ resource.manager_url }}" target="_blank" rel="noopener noreferrer">Mailtrain</a></td>