forked from openwisp/openwisp-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Added admin action to allow moving devices to groups openwi…
…sp#630 Closes openwisp#630
- Loading branch information
1 parent
67cc97f
commit 78e039d
Showing
6 changed files
with
129 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
openwisp_controller/config/static/config/css/admin-actions-intermediate-page.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.admin-actions form select { | ||
margin: 10px; | ||
} | ||
.admin-actions form input[type='submit'] { | ||
background: #ba2121; | ||
border-radius: 4px; | ||
padding: 10px 15px; | ||
color: #fff; | ||
margin: 10px 0 0 0; | ||
} | ||
.admin-actions form input[type='submit']:active, | ||
.admin-actions form input[type='submit']:focus, | ||
.admin-actions form input[type='submit']:hover { | ||
background: #a41515; | ||
} | ||
.admin-actions form .cancel-link { | ||
display: inline-block; | ||
vertical-align: middle; | ||
height: 15px; | ||
line-height: 15px; | ||
background: #ddd; | ||
border-radius: 4px; | ||
padding: 10px 15px; | ||
color: #333; | ||
margin: 10px 0 0 10px; | ||
} | ||
.admin-actions form .cancel-link:active, | ||
.admin-actions form .cancel-link:focus, | ||
.admin-actions form .cancel-link:hover { | ||
background: #ccc; | ||
} |
31 changes: 0 additions & 31 deletions
31
openwisp_controller/config/static/config/css/clone-template-form.css
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
openwisp_controller/config/templates/admin/config/change_device_group.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% extends "admin/base_site.html" %} | ||
{% load i18n l10n admin_urls static %} | ||
|
||
{% block extrahead %} | ||
<link rel="stylesheet" type="text/css" href="{% static 'config/css/admin-actions-intermediate-page.css' %}"> | ||
{% endblock %} | ||
|
||
{% block bodyclass %} | ||
change-device-group admin-actions | ||
{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<div class="breadcrumbs"> | ||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> | ||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a> | ||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a> | ||
› {% trans 'Change group' %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<p>{% blocktrans %}What group do you want to assign to the selected devices?{% endblocktrans %}</p> | ||
<form method="post">{% csrf_token %} | ||
<div> | ||
{% for obj in queryset %} | ||
<input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}"> | ||
{% endfor %} | ||
{{ form }} | ||
<br> | ||
<input type="hidden" name="action" value="change_group"> | ||
<input type="submit" name='apply' value="{% trans 'Change group' %}"> | ||
<a href="{% url changelist_url %}" class="button cancel-link">{% trans 'Cancel' %}</a> | ||
</div> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters