Improve the action buttons

master
Pierre Jaury 9 years ago
parent ad879bc9f5
commit 22c095aef4

@ -15,6 +15,7 @@ Domain list
<tbody> <tbody>
<tr> <tr>
<th>Actions</th> <th>Actions</th>
<th>Manage</th>
<th>Domain name</th> <th>Domain name</th>
<th>Mailbox count</th> <th>Mailbox count</th>
<th>Alias count</th> <th>Alias count</th>
@ -24,12 +25,14 @@ Domain list
</tr> </tr>
{% for domain in current_user.get_managed_domains() %} {% for domain in current_user.get_managed_domains() %}
<tr> <tr>
<td>
<a href="{{ url_for('.domain_edit', domain_name=domain.name) }}" title="Edit"><i class="fa fa-pencil"></i></a>
<a href="{{ url_for('.domain_delete', domain_name=domain.name) }}" onclick="return confirm('Are you sure?')" title="Delete"><i class="fa fa-trash"></i></a>&nbsp;
</td>
<td> <td>
<a href="{{ url_for('.user_list', domain_name=domain.name) }}" title="Users"><i class="fa fa-envelope-o"></i></a>&nbsp; <a href="{{ url_for('.user_list', domain_name=domain.name) }}" title="Users"><i class="fa fa-envelope-o"></i></a>&nbsp;
<a href="{{ url_for('.alias_list', domain_name=domain.name) }}" title="Aliases"><i class="fa fa-at"></i></a>&nbsp; <a href="{{ url_for('.alias_list', domain_name=domain.name) }}" title="Aliases"><i class="fa fa-at"></i></a>&nbsp;
<a href="{{ url_for('.domain_admins', domain_name=domain.name) }}" title="Administrators"><i class="fa fa-user"></i></a>&nbsp; <a href="{{ url_for('.domain_admins', domain_name=domain.name) }}" title="Administrators"><i class="fa fa-user"></i></a>&nbsp;
<a href="{{ url_for('.domain_edit', domain_name=domain.name) }}" title="Edit"><i class="fa fa-pencil"></i></a>
<a href="{{ url_for('.domain_delete', domain_name=domain.name) }}" onclick="return confirm('Are you sure?')" title="Delete"><i class="fa fa-trash"></i></a>&nbsp;
</td> </td>
<td>{{ domain.name }}</td> <td>{{ domain.name }}</td>
<td>{{ domain.users | count }} / {{ domain.max_users or '∞' }}</td> <td>{{ domain.users | count }} / {{ domain.max_users or '∞' }}</td>

@ -17,6 +17,7 @@ User list
<tbody> <tbody>
<tr> <tr>
<th>Actions</th> <th>Actions</th>
<th>User settings</th>
<th>Address</th> <th>Address</th>
<th>Features</th> <th>Features</th>
<th>Quota</th> <th>Quota</th>
@ -26,14 +27,15 @@ User list
</tr> </tr>
{% for user in domain.users %} {% for user in domain.users %}
<tr> <tr>
<td>
<a href="{{ url_for('.user_edit', user_email=user.get_id()) }}" title="Edit"><i class="fa fa-pencil"></i></a>&nbsp;
<a href="{{ url_for('.user_delete', user_email=user.get_id()) }}" onclick="return confirm('Are you sure?')" title="Delete"><i class="fa fa-trash"></i></a>
</td>
<td> <td>
<a href="{{ url_for('.user_settings', user_email=user.get_id()) }}" title="Settings"><i class="fa fa-wrench"></i></a>&nbsp; <a href="{{ url_for('.user_settings', user_email=user.get_id()) }}" title="Settings"><i class="fa fa-wrench"></i></a>&nbsp;
<a href="{{ url_for('.user_password', user_email=user.get_id()) }}" title="Update password"><i class="fa fa-lock"></i></a>&nbsp;
<a href="{{ url_for('.user_forward', user_email=user.get_id()) }}" title="Auto-forward"><i class="fa fa-share"></i></a>&nbsp; <a href="{{ url_for('.user_forward', user_email=user.get_id()) }}" title="Auto-forward"><i class="fa fa-share"></i></a>&nbsp;
<a href="{{ url_for('.user_reply', user_email=user.get_id()) }}" title="Auto-reply"><i class="fa fa-plane"></i></a>&nbsp; <a href="{{ url_for('.user_reply', user_email=user.get_id()) }}" title="Auto-reply"><i class="fa fa-plane"></i></a>&nbsp;
<a href="{{ url_for('.user_fetchmail', user_email=user.get_id()) }}" title="Fetched accounts"><i class="fa fa-download"></i></a>&nbsp; <a href="{{ url_for('.user_fetchmail', user_email=user.get_id()) }}" title="Fetched accounts"><i class="fa fa-download"></i></a>&nbsp;
<a href="{{ url_for('.user_edit', user_email=user.get_id()) }}" title="Edit"><i class="fa fa-pencil"></i></a>&nbsp;
<a href="{{ url_for('.user_delete', user_email=user.get_id()) }}" onclick="return confirm('Are you sure?')" title="Delete"><i class="fa fa-trash"></i></a>
</td> </td>
<td>{{ user }}</td> <td>{{ user }}</td>
<td> <td>

@ -29,6 +29,8 @@ def user_create(domain_name):
user = models.User(localpart=form.localpart.data, domain=domain) user = models.User(localpart=form.localpart.data, domain=domain)
user.comment = form.comment.data user.comment = form.comment.data
user.quota_bytes = int(form.quota_bytes.data) user.quota_bytes = int(form.quota_bytes.data)
user.enable_imap = form.enable_imap.data
user.enable_pop = form.enable_pop.data
user.set_password(form.pw.data) user.set_password(form.pw.data)
db.session.add(user) db.session.add(user)
db.session.commit() db.session.commit()
@ -47,8 +49,12 @@ def user_edit(user_email):
wtforms_components.read_only(form.localpart) wtforms_components.read_only(form.localpart)
form.pw.validators = [] form.pw.validators = []
if form.validate_on_submit(): if form.validate_on_submit():
user.quota_bytes = int(form.quota_bytes.data)
user.comment = form.comment.data user.comment = form.comment.data
user.quota_bytes = int(form.quota_bytes.data)
user.enable_imap = form.enable_imap.data
user.enable_pop = form.enable_pop.data
if form.pw.data:
user.set_password(form.pw.data)
db.session.add(user) db.session.add(user)
db.session.commit() db.session.commit()
flask.flash('User %s updated' % user) flask.flash('User %s updated' % user)

Loading…
Cancel
Save