Skip to content

Commit

Permalink
Make it easier to select some owners (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasciput authored Jul 5, 2023
1 parent 97297b8 commit 9814d27
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
20 changes: 18 additions & 2 deletions qgis-app/plugins/templates/plugins/plugin_form.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% extends 'plugins/plugin_base.html' %}{% load static i18n %}
{% block extrajs %}
{{ block.super }}
<script type="text/javascript" src="{% static "js/jquery-1.11.1.min.js" %}"></script>
<link rel="stylesheet" media="all" type="text/css" href="% static "jquery-autosuggest/css/autoSuggest.css" %}">
<script src="{% static "js/jquery-1.12.4.min.js" %}" type="text/javascript"></script>
<link rel="stylesheet" media="all" type="text/css" href="{% static "jquery-autosuggest/css/autoSuggest.css" %}">
<link rel="stylesheet" media="all" type="text/css" href="{% static "js/chosen.min.css" %}">
<style type="text/css">
/* for autocomplete */
.vTextField {
Expand Down Expand Up @@ -31,6 +32,8 @@
};
</script>
<script src="{% static "jquery-autosuggest/js/jquery.autoSuggest.minified.js" %}" type="text/javascript"></script>
<script src="{% static "js/chosen.jquery.min.js" %}" type="text/javascript"></script>

{% endblock %}
{% block content %}
<h2>{{ form_title }} {{ plugin }}</h2>
Expand Down Expand Up @@ -58,6 +61,18 @@ <h2>{{ form_title }} {{ plugin }}</h2>
</div>
</form>
<script type="text/javascript">

let checkElement = setInterval(function() {
let element = document.getElementById('id_owners');
if(element) {
$('#id_owners').chosen({
placeholder_text_multiple: "Select Some Owners",
no_results_text: "Oops, nothing found!"
});
clearInterval(checkElement);
}
}, 200);

(function ($) {
var tags_as_string;
$(document).ready(function (){
Expand Down Expand Up @@ -85,6 +100,7 @@ <h2>{{ form_title }} {{ plugin }}</h2>
$("#id_tags__tagautosuggest").remove();
$("#id_tags").val(tags_as_string);
});

});
})(django.jQuery);
</script>
Expand Down
Binary file added qgis-app/static/js/chosen-sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added qgis-app/static/js/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions qgis-app/static/js/chosen.jquery.min.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions qgis-app/static/js/chosen.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions qgis-app/static/js/jquery-1.12.4.min.js

Large diffs are not rendered by default.

0 comments on commit 9814d27

Please sign in to comment.