|
@@ -14,11 +14,12 @@
|
|
|
## See the License for the specific language governing permissions and
|
|
## See the License for the specific language governing permissions and
|
|
|
## limitations under the License.
|
|
## limitations under the License.
|
|
|
<%!
|
|
<%!
|
|
|
-from desktop.views import commonheader, commonfooter
|
|
|
|
|
|
|
+from desktop.views import commonheader, commonfooter, antixss
|
|
|
from django.utils.translation import ugettext as _
|
|
from django.utils.translation import ugettext as _
|
|
|
from useradmin.models import group_permissions
|
|
from useradmin.models import group_permissions
|
|
|
%>
|
|
%>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
<%namespace name="actionbar" file="actionbar.mako" />
|
|
<%namespace name="actionbar" file="actionbar.mako" />
|
|
|
<%namespace name="layout" file="layout.mako" />
|
|
<%namespace name="layout" file="layout.mako" />
|
|
|
${ commonheader(_('Hue Groups'), "useradmin", user) | n,unicode }
|
|
${ commonheader(_('Hue Groups'), "useradmin", user) | n,unicode }
|
|
@@ -116,7 +117,7 @@ ${layout.menubar(section='groups')}
|
|
|
<input type="submit" class="btn btn-danger" value="${_('Yes')}"/>
|
|
<input type="submit" class="btn btn-danger" value="${_('Yes')}"/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="hide">
|
|
<div class="hide">
|
|
|
- <select name="group_names" data-bind="options: availableUsers, selectedOptions: chosenUsers" multiple="true"></select>
|
|
|
|
|
|
|
+ <select name="group_names" data-bind="options: availableGroups, selectedOptions: chosenGroups" multiple="true"></select>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
|
</div>
|
|
</div>
|
|
@@ -128,8 +129,8 @@ ${layout.menubar(section='groups')}
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
$(document).ready(function () {
|
|
|
viewModel = {
|
|
viewModel = {
|
|
|
- availableUsers: ko.observableArray(${ groups_json | n }),
|
|
|
|
|
- chosenUsers: ko.observableArray([])
|
|
|
|
|
|
|
+ availableGroups: ko.observableArray(${ groups_json | n,antixss }),
|
|
|
|
|
+ chosenGroups: ko.observableArray([])
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
ko.applyBindings(viewModel);
|
|
ko.applyBindings(viewModel);
|
|
@@ -189,10 +190,10 @@ ${layout.menubar(section='groups')}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$("#deleteGroupBtn").click(function () {
|
|
$("#deleteGroupBtn").click(function () {
|
|
|
- viewModel.chosenUsers.removeAll();
|
|
|
|
|
|
|
+ viewModel.chosenGroups.removeAll();
|
|
|
|
|
|
|
|
$(".hueCheckbox[checked='checked']").each(function (index) {
|
|
$(".hueCheckbox[checked='checked']").each(function (index) {
|
|
|
- viewModel.chosenUsers.push($(this).data("name").toString()); // needed for numeric group names
|
|
|
|
|
|
|
+ viewModel.chosenGroups.push($(this).data("name").toString()); // needed for numeric group names
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$("#deleteGroup").modal("show");
|
|
$("#deleteGroup").modal("show");
|