diff --git a/simpleui/__init__.py b/simpleui/__init__.py
index ff11571d..2ef4d4d1 100644
--- a/simpleui/__init__.py
+++ b/simpleui/__init__.py
@@ -2,4 +2,4 @@
def get_version():
- return '2021.1.0'
+ return '2021.2'
diff --git a/simpleui/static/admin/fonts/LICENSE.txt b/simpleui/static/admin/fonts/LICENSE.txt
deleted file mode 100644
index d6456956..00000000
--- a/simpleui/static/admin/fonts/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/simpleui/static/admin/fonts/README.txt b/simpleui/static/admin/fonts/README.txt
deleted file mode 100644
index cc2135a3..00000000
--- a/simpleui/static/admin/fonts/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Roboto webfont source: https://www.google.com/fonts/specimen/Roboto
-Weights used in this project: Light (300), Regular (400), Bold (700)
diff --git a/simpleui/static/admin/fonts/Roboto-Bold-webfont.woff b/simpleui/static/admin/fonts/Roboto-Bold-webfont.woff
deleted file mode 100644
index 03357ce4..00000000
Binary files a/simpleui/static/admin/fonts/Roboto-Bold-webfont.woff and /dev/null differ
diff --git a/simpleui/static/admin/fonts/Roboto-Light-webfont.woff b/simpleui/static/admin/fonts/Roboto-Light-webfont.woff
deleted file mode 100644
index f6abd871..00000000
Binary files a/simpleui/static/admin/fonts/Roboto-Light-webfont.woff and /dev/null differ
diff --git a/simpleui/static/admin/fonts/Roboto-Regular-webfont.woff b/simpleui/static/admin/fonts/Roboto-Regular-webfont.woff
deleted file mode 100644
index 6ff6afd8..00000000
Binary files a/simpleui/static/admin/fonts/Roboto-Regular-webfont.woff and /dev/null differ
diff --git a/simpleui/static/admin/img/LICENSE b/simpleui/static/admin/img/LICENSE
deleted file mode 100644
index a4faaa1d..00000000
--- a/simpleui/static/admin/img/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Code Charm Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/simpleui/static/admin/img/README.txt b/simpleui/static/admin/img/README.txt
deleted file mode 100644
index 43373ad1..00000000
--- a/simpleui/static/admin/img/README.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-All icons are taken from Font Awesome (http://fontawesome.io/) project.
-The Font Awesome font is licensed under the SIL OFL 1.1:
-- http://scripts.sil.org/OFL
-
-SVG icons source: https://github.com/encharm/Font-Awesome-SVG-PNG
-Font-Awesome-SVG-PNG is licensed under the MIT license (see file license
-in current folder).
diff --git a/simpleui/static/admin/img/calendar-icons.svg b/simpleui/static/admin/img/calendar-icons.svg
deleted file mode 100644
index 48cc42d7..00000000
--- a/simpleui/static/admin/img/calendar-icons.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
diff --git a/simpleui/static/admin/img/gis/move_vertex_off.svg b/simpleui/static/admin/img/gis/move_vertex_off.svg
deleted file mode 100644
index c91607e2..00000000
--- a/simpleui/static/admin/img/gis/move_vertex_off.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
\ No newline at end of file
diff --git a/simpleui/static/admin/img/gis/move_vertex_on.svg b/simpleui/static/admin/img/gis/move_vertex_on.svg
deleted file mode 100644
index 2db86f44..00000000
--- a/simpleui/static/admin/img/gis/move_vertex_on.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
\ No newline at end of file
diff --git a/simpleui/static/admin/img/icon-addlink.svg b/simpleui/static/admin/img/icon-addlink.svg
deleted file mode 100644
index fca87f83..00000000
--- a/simpleui/static/admin/img/icon-addlink.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-alert.svg b/simpleui/static/admin/img/icon-alert.svg
deleted file mode 100644
index 9304e250..00000000
--- a/simpleui/static/admin/img/icon-alert.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-calendar.svg b/simpleui/static/admin/img/icon-calendar.svg
deleted file mode 100644
index 21261d2b..00000000
--- a/simpleui/static/admin/img/icon-calendar.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-changelink.svg b/simpleui/static/admin/img/icon-changelink.svg
deleted file mode 100644
index dcb6f1c7..00000000
--- a/simpleui/static/admin/img/icon-changelink.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-clock.svg b/simpleui/static/admin/img/icon-clock.svg
deleted file mode 100644
index a6953096..00000000
--- a/simpleui/static/admin/img/icon-clock.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-deletelink.svg b/simpleui/static/admin/img/icon-deletelink.svg
deleted file mode 100644
index f041cb39..00000000
--- a/simpleui/static/admin/img/icon-deletelink.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-no.svg b/simpleui/static/admin/img/icon-no.svg
deleted file mode 100644
index 09cc65c9..00000000
--- a/simpleui/static/admin/img/icon-no.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-unknown-alt.svg b/simpleui/static/admin/img/icon-unknown-alt.svg
deleted file mode 100644
index f7620c52..00000000
--- a/simpleui/static/admin/img/icon-unknown-alt.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-unknown.svg b/simpleui/static/admin/img/icon-unknown.svg
deleted file mode 100644
index 798eb61a..00000000
--- a/simpleui/static/admin/img/icon-unknown.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/icon-yes.svg b/simpleui/static/admin/img/icon-yes.svg
deleted file mode 100644
index 77442385..00000000
--- a/simpleui/static/admin/img/icon-yes.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/inline-delete.svg b/simpleui/static/admin/img/inline-delete.svg
deleted file mode 100644
index 468dcb77..00000000
--- a/simpleui/static/admin/img/inline-delete.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/search.svg b/simpleui/static/admin/img/search.svg
deleted file mode 100644
index 244989e8..00000000
--- a/simpleui/static/admin/img/search.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/selector-icons.svg b/simpleui/static/admin/img/selector-icons.svg
deleted file mode 100644
index a725d62e..00000000
--- a/simpleui/static/admin/img/selector-icons.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-
diff --git a/simpleui/static/admin/img/sorting-icons.svg b/simpleui/static/admin/img/sorting-icons.svg
deleted file mode 100644
index 0e0213dc..00000000
--- a/simpleui/static/admin/img/sorting-icons.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/simpleui/static/admin/img/tooltag-add.svg b/simpleui/static/admin/img/tooltag-add.svg
deleted file mode 100644
index 22aaa616..00000000
--- a/simpleui/static/admin/img/tooltag-add.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/img/tooltag-arrowright.svg b/simpleui/static/admin/img/tooltag-arrowright.svg
deleted file mode 100644
index 6c9f6868..00000000
--- a/simpleui/static/admin/img/tooltag-arrowright.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/simpleui/static/admin/js/SelectBox.js b/simpleui/static/admin/js/SelectBox.js
deleted file mode 100644
index 002b39d5..00000000
--- a/simpleui/static/admin/js/SelectBox.js
+++ /dev/null
@@ -1,143 +0,0 @@
-(function ($) {
- 'use strict';
- var SelectBox = {
- cache: {},
- init: function (id) {
- var box = document.getElementById(id);
- var node;
- SelectBox.cache[id] = [];
- var cache = SelectBox.cache[id];
- var boxOptions = box.options;
- var boxOptionsLength = boxOptions.length;
- for (var i = 0, j = boxOptionsLength; i < j; i++) {
- node = boxOptions[i];
- cache.push({value: node.value, text: node.text, displayed: 1});
- }
- },
- redisplay: function (id) {
- // Repopulate HTML select box from cache
- var box = document.getElementById(id);
- var node;
- $(box).empty(); // clear all options
- var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag
- var cache = SelectBox.cache[id];
- for (var i = 0, j = cache.length; i < j; i++) {
- node = cache[i];
- if (node.displayed) {
- var new_option = new Option(node.text, node.value, false, false);
- // Shows a tooltip when hovering over the option
- new_option.setAttribute("title", node.text);
- new_options += new_option.outerHTML;
- }
- }
- new_options += '';
- box.outerHTML = new_options;
- },
- filter: function (id, text) {
- // Redisplay the HTML select box, displaying only the choices containing ALL
- // the words in text. (It's an AND search.)
- var tokens = text.toLowerCase().split(/\s+/);
- var node, token;
- var cache = SelectBox.cache[id];
- for (var i = 0, j = cache.length; i < j; i++) {
- node = cache[i];
- node.displayed = 1;
- var node_text = node.text.toLowerCase();
- var numTokens = tokens.length;
- for (var k = 0; k < numTokens; k++) {
- token = tokens[k];
- if (node_text.indexOf(token) === -1) {
- node.displayed = 0;
- break; // Once the first token isn't found we're done
- }
- }
- }
- SelectBox.redisplay(id);
- },
- delete_from_cache: function (id, value) {
- var node, delete_index = null;
- var cache = SelectBox.cache[id];
- for (var i = 0, j = cache.length; i < j; i++) {
- node = cache[i];
- if (node.value === value) {
- delete_index = i;
- break;
- }
- }
- cache.splice(delete_index, 1);
- },
- add_to_cache: function (id, option) {
- SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1});
- },
- cache_contains: function (id, value) {
- // Check if an item is contained in the cache
- var node;
- var cache = SelectBox.cache[id];
- for (var i = 0, j = cache.length; i < j; i++) {
- node = cache[i];
- if (node.value === value) {
- return true;
- }
- }
- return false;
- },
- move: function (from, to) {
- var from_box = document.getElementById(from);
- var option;
- var boxOptions = from_box.options;
- var boxOptionsLength = boxOptions.length;
- for (var i = 0, j = boxOptionsLength; i < j; i++) {
- option = boxOptions[i];
- var option_value = option.value;
- if (option.selected && SelectBox.cache_contains(from, option_value)) {
- SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
- SelectBox.delete_from_cache(from, option_value);
- }
- }
- SelectBox.redisplay(from);
- SelectBox.redisplay(to);
- },
- move_all: function (from, to) {
- var from_box = document.getElementById(from);
- var option;
- var boxOptions = from_box.options;
- var boxOptionsLength = boxOptions.length;
- for (var i = 0, j = boxOptionsLength; i < j; i++) {
- option = boxOptions[i];
- var option_value = option.value;
- if (SelectBox.cache_contains(from, option_value)) {
- SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
- SelectBox.delete_from_cache(from, option_value);
- }
- }
- SelectBox.redisplay(from);
- SelectBox.redisplay(to);
- },
- sort: function (id) {
- SelectBox.cache[id].sort(function (a, b) {
- a = a.text.toLowerCase();
- b = b.text.toLowerCase();
- try {
- if (a > b) {
- return 1;
- }
- if (a < b) {
- return -1;
- }
- } catch (e) {
- // silently fail on IE 'unknown' exception
- }
- return 0;
- });
- },
- select_all: function (id) {
- var box = document.getElementById(id);
- var boxOptions = box.options;
- var boxOptionsLength = boxOptions.length;
- for (var i = 0; i < boxOptionsLength; i++) {
- boxOptions[i].selected = 'selected';
- }
- }
- };
- window.SelectBox = SelectBox;
-})(django.jQuery);
diff --git a/simpleui/static/admin/js/SelectFilter2.js b/simpleui/static/admin/js/SelectFilter2.js
deleted file mode 100644
index c6892bb4..00000000
--- a/simpleui/static/admin/js/SelectFilter2.js
+++ /dev/null
@@ -1,255 +0,0 @@
-/*global SelectBox, gettext, interpolate, quickElement, SelectFilter*/
-/*
-SelectFilter2 - Turns a multiple-select box into a filter interface.
-
-Requires jQuery, core.js, and SelectBox.js.
-*/
-(function ($) {
- 'use strict';
-
- function findForm(node) {
- // returns the node of the form containing the given node
- if (node.tagName.toLowerCase() !== 'form') {
- return findForm(node.parentNode);
- }
- return node;
- }
-
- window.SelectFilter = {
- init: function (field_id, field_name, is_stacked) {
- if (field_id.match(/__prefix__/)) {
- // Don't initialize on empty forms.
- return;
- }
- var from_box = document.getElementById(field_id);
- from_box.id += '_from'; // change its ID
- from_box.className = 'filtered';
-
- var ps = from_box.parentNode.getElementsByTagName('p');
- for (var i = 0; i < ps.length; i++) {
- if (ps[i].className.indexOf("info") !== -1) {
- // Remove
, because it just gets in the way.
- from_box.parentNode.removeChild(ps[i]);
- } else if (ps[i].className.indexOf("help") !== -1) {
- // Move help text up to the top so it isn't below the select
- // boxes or wrapped off on the side to the right of the add
- // button:
- from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild);
- }
- }
-
- //
- var selector_chosen = quickElement('div', selector_div);
- selector_chosen.className = 'selector-chosen';
- var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name]));
- quickElement(
- 'span', title_chosen, '',
- 'class', 'help help-tooltip help-icon',
- 'title', interpolate(
- gettext(
- 'This is the list of chosen %s. You may remove some by ' +
- 'selecting them in the box below and then clicking the ' +
- '"Remove" arrow between the two boxes.'
- ),
- [field_name]
- )
- );
-
- var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name'));
- to_box.className = 'filtered';
- var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_remove_all_link');
- clear_all.className = 'selector-clearall';
-
- from_box.setAttribute('name', from_box.getAttribute('name') + '_old');
-
- // Set up the JavaScript event handlers for the select box filter interface
- var move_selection = function (e, elem, move_func, from, to) {
- if (elem.className.indexOf('active') !== -1) {
- move_func(from, to);
- SelectFilter.refresh_icons(field_id);
- }
- e.preventDefault();
- };
- choose_all.addEventListener('click', function (e) {
- move_selection(e, this, SelectBox.move_all, field_id + '_from', field_id + '_to');
- });
- add_link.addEventListener('click', function (e) {
- move_selection(e, this, SelectBox.move, field_id + '_from', field_id + '_to');
- });
- remove_link.addEventListener('click', function (e) {
- move_selection(e, this, SelectBox.move, field_id + '_to', field_id + '_from');
- });
- clear_all.addEventListener('click', function (e) {
- move_selection(e, this, SelectBox.move_all, field_id + '_to', field_id + '_from');
- });
- filter_input.addEventListener('keypress', function (e) {
- SelectFilter.filter_key_press(e, field_id);
- });
- filter_input.addEventListener('keyup', function (e) {
- SelectFilter.filter_key_up(e, field_id);
- });
- filter_input.addEventListener('keydown', function (e) {
- SelectFilter.filter_key_down(e, field_id);
- });
- selector_div.addEventListener('change', function (e) {
- if (e.target.tagName === 'SELECT') {
- SelectFilter.refresh_icons(field_id);
- }
- });
- selector_div.addEventListener('dblclick', function (e) {
- if (e.target.tagName === 'OPTION') {
- if (e.target.closest('select').id === field_id + '_to') {
- SelectBox.move(field_id + '_to', field_id + '_from');
- } else {
- SelectBox.move(field_id + '_from', field_id + '_to');
- }
- SelectFilter.refresh_icons(field_id);
- }
- });
- findForm(from_box).addEventListener('submit', function () {
- SelectBox.select_all(field_id + '_to');
- });
- SelectBox.init(field_id + '_from');
- SelectBox.init(field_id + '_to');
- // Move selected from_box options to to_box
- SelectBox.move(field_id + '_from', field_id + '_to');
-
- if (!is_stacked) {
- // In horizontal mode, give the same height to the two boxes.
- var j_from_box = $(from_box);
- var j_to_box = $(to_box);
- var resize_filters = function () {
- j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight());
- };
- if (j_from_box.outerHeight() > 0) {
- resize_filters(); // This fieldset is already open. Resize now.
- } else {
- // This fieldset is probably collapsed. Wait for its 'show' event.
- j_to_box.closest('fieldset').one('show.fieldset', resize_filters);
- }
- }
-
- // Initial icon refresh
- SelectFilter.refresh_icons(field_id);
- },
- any_selected: function (field) {
- var any_selected = false;
- try {
- // Temporarily add the required attribute and check validity.
- // This is much faster in WebKit browsers than the fallback.
- field.attr('required', 'required');
- any_selected = field.is(':valid');
- field.removeAttr('required');
- } catch (e) {
- // Browsers that don't support :valid (IE < 10)
- any_selected = field.find('option:selected').length > 0;
- }
- return any_selected;
- },
- refresh_icons: function (field_id) {
- var from = $('#' + field_id + '_from');
- var to = $('#' + field_id + '_to');
- // Active if at least one item is selected
- $('#' + field_id + '_add_link').toggleClass('active', SelectFilter.any_selected(from));
- $('#' + field_id + '_remove_link').toggleClass('active', SelectFilter.any_selected(to));
- // Active if the corresponding box isn't empty
- $('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0);
- $('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0);
- },
- filter_key_press: function (event, field_id) {
- var from = document.getElementById(field_id + '_from');
- // don't submit form if user pressed Enter
- if ((event.which && event.which === 13) || (event.keyCode && event.keyCode === 13)) {
- from.selectedIndex = 0;
- SelectBox.move(field_id + '_from', field_id + '_to');
- from.selectedIndex = 0;
- event.preventDefault();
- return false;
- }
- },
- filter_key_up: function (event, field_id) {
- var from = document.getElementById(field_id + '_from');
- var temp = from.selectedIndex;
- SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value);
- from.selectedIndex = temp;
- return true;
- },
- filter_key_down: function (event, field_id) {
- var from = document.getElementById(field_id + '_from');
- // right arrow -- move across
- if ((event.which && event.which === 39) || (event.keyCode && event.keyCode === 39)) {
- var old_index = from.selectedIndex;
- SelectBox.move(field_id + '_from', field_id + '_to');
- from.selectedIndex = (old_index === from.length) ? from.length - 1 : old_index;
- return false;
- }
- // down arrow -- wrap around
- if ((event.which && event.which === 40) || (event.keyCode && event.keyCode === 40)) {
- from.selectedIndex = (from.length === from.selectedIndex + 1) ? 0 : from.selectedIndex + 1;
- }
- // up arrow -- wrap around
- if ((event.which && event.which === 38) || (event.keyCode && event.keyCode === 38)) {
- from.selectedIndex = (from.selectedIndex === 0) ? from.length - 1 : from.selectedIndex - 1;
- }
- return true;
- }
- };
-
- window.addEventListener('load', function (e) {
- $('select.selectfilter, select.selectfilterstacked').each(function () {
- var $el = $(this),
- data = $el.data();
- SelectFilter.init($el.attr('id'), data.fieldName, parseInt(data.isStacked, 10));
- });
- });
-
-})(django.jQuery);
diff --git a/simpleui/static/admin/js/actions.js b/simpleui/static/admin/js/actions.js
deleted file mode 100644
index 9dbed44c..00000000
--- a/simpleui/static/admin/js/actions.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/*global gettext, interpolate, ngettext*/
-(function ($) {
- 'use strict';
- var lastChecked;
-
- $.fn.actions = function (opts) {
- var options = $.extend({}, $.fn.actions.defaults, opts);
- var actionCheckboxes = $(this);
- var list_editable_changed = false;
- var showQuestion = function () {
- $(options.acrossClears).hide();
- $(options.acrossQuestions).show();
- $(options.allContainer).hide();
- },
- showClear = function () {
- $(options.acrossClears).show();
- $(options.acrossQuestions).hide();
- $(options.actionContainer).toggleClass(options.selectedClass);
- $(options.allContainer).show();
- $(options.counterContainer).hide();
- },
- reset = function () {
- $(options.acrossClears).hide();
- $(options.acrossQuestions).hide();
- $(options.allContainer).hide();
- $(options.counterContainer).show();
- },
- clearAcross = function () {
- reset();
- $(options.acrossInput).val(0);
- $(options.actionContainer).removeClass(options.selectedClass);
- },
- checker = function (checked) {
- if (checked) {
- showQuestion();
- } else {
- reset();
- }
- $(actionCheckboxes).prop("checked", checked)
- .parent().parent().toggleClass(options.selectedClass, checked);
- },
- updateCounter = function () {
- var sel = $(actionCheckboxes).filter(":checked").length;
- // data-actions-icnt is defined in the generated HTML
- // and contains the total amount of objects in the queryset
- var actions_icnt = $('.action-counter').data('actionsIcnt');
- $(options.counterContainer).html(interpolate(
- ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), {
- sel: sel,
- cnt: actions_icnt
- }, true));
- $(options.allToggle).prop("checked", function () {
- var value;
- if (sel === actionCheckboxes.length) {
- value = true;
- showQuestion();
- } else {
- value = false;
- clearAcross();
- }
- return value;
- });
- };
- // Show counter by default
- $(options.counterContainer).show();
- // Check state of checkboxes and reinit state if needed
- $(this).filter(":checked").each(function (i) {
- $(this).parent().parent().toggleClass(options.selectedClass);
- updateCounter();
- if ($(options.acrossInput).val() === 1) {
- showClear();
- }
- });
- $(options.allToggle).show().click(function () {
- checker($(this).prop("checked"));
- updateCounter();
- });
- $("a", options.acrossQuestions).click(function (event) {
- event.preventDefault();
- $(options.acrossInput).val(1);
- showClear();
- });
- $("a", options.acrossClears).click(function (event) {
- event.preventDefault();
- $(options.allToggle).prop("checked", false);
- clearAcross();
- checker(0);
- updateCounter();
- });
- lastChecked = null;
- $(actionCheckboxes).click(function (event) {
- if (!event) {
- event = window.event;
- }
- var target = event.target ? event.target : event.srcElement;
- if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) {
- var inrange = false;
- $(lastChecked).prop("checked", target.checked)
- .parent().parent().toggleClass(options.selectedClass, target.checked);
- $(actionCheckboxes).each(function () {
- if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) {
- inrange = (inrange) ? false : true;
- }
- if (inrange) {
- $(this).prop("checked", target.checked)
- .parent().parent().toggleClass(options.selectedClass, target.checked);
- }
- });
- }
- $(target).parent().parent().toggleClass(options.selectedClass, target.checked);
- lastChecked = target;
- updateCounter();
- });
- $('form#changelist-form table#result_list tr').on('change', 'td:gt(0) :input', function () {
- list_editable_changed = true;
- });
- $('form#changelist-form button[name="index"]').click(function (event) {
- if (list_editable_changed) {
- return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."));
- }
- });
- $('form#changelist-form input[name="_save"]').click(function (event) {
- var action_changed = false;
- $('select option:selected', options.actionContainer).each(function () {
- if ($(this).val()) {
- action_changed = true;
- }
- });
- if (action_changed) {
- if (list_editable_changed) {
- return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action."));
- } else {
- return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."));
- }
- }
- });
- };
- /* Setup plugin defaults */
- $.fn.actions.defaults = {
- actionContainer: "div.actions",
- counterContainer: "span.action-counter",
- allContainer: "div.actions span.all",
- acrossInput: "div.actions input.select-across",
- acrossQuestions: "div.actions span.question",
- acrossClears: "div.actions span.clear",
- allToggle: "#action-toggle",
- selectedClass: "selected"
- };
- $(document).ready(function () {
- var $actionsEls = $('tr input.action-select');
- if ($actionsEls.length > 0) {
- $actionsEls.actions();
- }
- });
-})(django.jQuery);
diff --git a/simpleui/static/admin/js/actions.min.js b/simpleui/static/admin/js/actions.min.js
deleted file mode 100644
index 1b771fb6..00000000
--- a/simpleui/static/admin/js/actions.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-(function(a){var f;a.fn.actions=function(e){var b=a.extend({},a.fn.actions.defaults,e),g=a(this),k=!1,l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},n=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},p=function(){n();
-a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)},q=function(c){c?l():n();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length,d=a(".action-counter").data("actionsIcnt");a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:d},!0));a(b.allToggle).prop("checked",function(){var a;c===g.length?(a=!0,l()):(a=!1,p());return a})};a(b.counterContainer).show();
-a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);h();1===a(b.acrossInput).val()&&m()});a(b.allToggle).show().click(function(){q(a(this).prop("checked"));h()});a("a",b.acrossQuestions).click(function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("a",b.acrossClears).click(function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);p();q(0);h()});f=null;a(g).click(function(c){c||(c=window.event);var d=c.target?c.target:c.srcElement;if(f&&
-a.data(f)!==a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(g).each(function(){if(a.data(this)===a.data(f)||a.data(this)===a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").on("change","td:gt(0) :input",function(){k=!0});a('form#changelist-form button[name="index"]').click(function(a){if(k)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});
-a('form#changelist-form input[name="_save"]').click(function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return k?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};
-a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"};a(document).ready(function(){var e=a("tr input.action-select");0
-//
-(function () {
- 'use strict';
- var DateTimeShortcuts = {
- calendars: [],
- calendarInputs: [],
- clockInputs: [],
- clockHours: {
- default_: [
- [gettext_noop('Now'), -1],
- [gettext_noop('Midnight'), 0],
- [gettext_noop('6 a.m.'), 6],
- [gettext_noop('Noon'), 12],
- [gettext_noop('6 p.m.'), 18]
- ]
- },
- dismissClockFunc: [],
- dismissCalendarFunc: [],
- calendarDivName1: 'calendarbox', // name of calendar
that gets toggled
- calendarDivName2: 'calendarin', // name of
that contains calendar
- calendarLinkName: 'calendarlink',// name of the link that is used to toggle
- clockDivName: 'clockbox', // name of clock
that gets toggled
- clockLinkName: 'clocklink', // name of the link that is used to toggle
- shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts
- timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch
- timezoneOffset: 0,
- init: function () {
- var body = document.getElementsByTagName('body')[0];
- var serverOffset = body.getAttribute('data-admin-utc-offset');
- if (serverOffset) {
- var localOffset = new Date().getTimezoneOffset() * -60;
- DateTimeShortcuts.timezoneOffset = localOffset - serverOffset;
- }
-
- var inputs = document.getElementsByTagName('input');
- for (var i = 0; i < inputs.length; i++) {
- var inp = inputs[i];
- if (inp.getAttribute('type') === 'text' && inp.className.match(/vTimeField/)) {
- DateTimeShortcuts.addClock(inp);
- DateTimeShortcuts.addTimezoneWarning(inp);
- } else if (inp.getAttribute('type') === 'text' && inp.className.match(/vDateField/)) {
- DateTimeShortcuts.addCalendar(inp);
- DateTimeShortcuts.addTimezoneWarning(inp);
- }
- }
- },
- // Return the current time while accounting for the server timezone.
- now: function () {
- var body = document.getElementsByTagName('body')[0];
- var serverOffset = body.getAttribute('data-admin-utc-offset');
- if (serverOffset) {
- var localNow = new Date();
- var localOffset = localNow.getTimezoneOffset() * -60;
- localNow.setTime(localNow.getTime() + 1000 * (serverOffset - localOffset));
- return localNow;
- } else {
- return new Date();
- }
- },
- // Add a warning when the time zone in the browser and backend do not match.
- addTimezoneWarning: function (inp) {
- var $ = django.jQuery;
- var warningClass = DateTimeShortcuts.timezoneWarningClass;
- var timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600;
-
- // Only warn if there is a time zone mismatch.
- if (!timezoneOffset) {
- return;
- }
-
- // Check if warning is already there.
- if ($(inp).siblings('.' + warningClass).length) {
- return;
- }
-
- var message;
- if (timezoneOffset > 0) {
- message = ngettext(
- 'Note: You are %s hour ahead of server time.',
- 'Note: You are %s hours ahead of server time.',
- timezoneOffset
- );
- } else {
- timezoneOffset *= -1;
- message = ngettext(
- 'Note: You are %s hour behind server time.',
- 'Note: You are %s hours behind server time.',
- timezoneOffset
- );
- }
- message = interpolate(message, [timezoneOffset]);
-
- var $warning = $('');
- $warning.attr('class', warningClass);
- $warning.text(message);
-
- $(inp).parent()
- .append($(' '))
- .append($warning);
- },
- // Add clock widget to a given field
- addClock: function (inp) {
- var num = DateTimeShortcuts.clockInputs.length;
- DateTimeShortcuts.clockInputs[num] = inp;
- DateTimeShortcuts.dismissClockFunc[num] = function () {
- DateTimeShortcuts.dismissClock(num);
- return true;
- };
-
- // Shortcut links (clock icon and "Now" link)
- var shortcuts_span = document.createElement('span');
- shortcuts_span.className = DateTimeShortcuts.shortCutsClass;
- inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
- var now_link = document.createElement('a');
- now_link.setAttribute('href', "#");
- now_link.appendChild(document.createTextNode(gettext('Now')));
- now_link.addEventListener('click', function (e) {
- e.preventDefault();
- DateTimeShortcuts.handleClockQuicklink(num, -1);
- });
- var clock_link = document.createElement('a');
- clock_link.setAttribute('href', '#');
- clock_link.id = DateTimeShortcuts.clockLinkName + num;
- clock_link.addEventListener('click', function (e) {
- e.preventDefault();
- // avoid triggering the document click handler to dismiss the clock
- e.stopPropagation();
- DateTimeShortcuts.openClock(num);
- });
-
- quickElement(
- 'span', clock_link, '',
- 'class', 'clock-icon',
- 'title', gettext('Choose a Time')
- );
- shortcuts_span.appendChild(document.createTextNode('\u00A0'));
- shortcuts_span.appendChild(now_link);
- shortcuts_span.appendChild(document.createTextNode('\u00A0|\u00A0'));
- shortcuts_span.appendChild(clock_link);
-
- // Create clock link div
- //
- // Markup looks like:
- //
");
- addButton = $this.filter(":last").next().find("a");
- }
- }
- addButton.click(function (e) {
- e.preventDefault();
- var template = $("#" + options.prefix + "-empty");
- var row = template.clone(true);
- row.removeClass(options.emptyCssClass)
- .addClass(options.formCssClass)
- .attr("id", options.prefix + "-" + nextIndex);
- if (row.is("tr")) {
- // If the forms are laid out in table rows, insert
- // the remove button into the last table cell:
- row.children(":last").append('