Browse Source

pannello filtri in dialog

boyska 3 years ago
parent
commit
d6afc92aee
2 changed files with 20 additions and 4 deletions
  1. 5 0
      rxmap/rxmapp/static/js/viewmap.js
  2. 15 4
      rxmap/rxmapp/templates/index.html

+ 5 - 0
rxmap/rxmapp/static/js/viewmap.js

@@ -52,6 +52,7 @@ function viewMap () {
 }
 jQuery(function ($) {
     var dateFormat = "yy-mm-dd";
+    $('.btn').button()
     function getDate( element ) {
         var date;
         try {
@@ -77,5 +78,9 @@ jQuery(function ($) {
     ).on("change", function() {
         from.datepicker("option", "maxDate", getDate(this))
     })
+    $('#filters').dialog({autoOpen: false, modal: true, height: 'auto', width: $(window).width() - 200})
+    $('#btn-open-filter').click(function() {
+    $('#filters').dialog('open')
+    })
   viewMap()
 })

+ 15 - 4
rxmap/rxmapp/templates/index.html

@@ -11,9 +11,12 @@
 
 {% block content %}
     <style>
-.ui-datepicker { z-index: 10 !important ;}
+.ui-datepicker { z-index: 200 !important ;}
     </style>
 <div id="dialog"></div>
+<div id="short-actions">
+    <button class="btn" id="btn-open-filter">Filtra</button>
+</div>
 <div id="filters">
     <!-- TODO: rendi collassabile -->
     <header><h3>Filtra</h3></header>
@@ -22,9 +25,17 @@
         <div class="form-field-line">
         <label for="tipo_radio__id">Osservazione fatta con</label>
         <select name="tipo_radio__id" >
-            <option value="NA" disabled selected="selected">//</option>
+            <option value=""
+                        {% if params.tipo_radio__id == "" %} selected="selected" {% endif %}
+                        >//</option>
             {% for tr in tipiradio %}
-                <option value="{{tr.id}}"><strong>{{tr.nome}}</strong> - {{tr.descrizione|default:'' }}</option>
+                <option value="{{tr.id}}"
+                        {% if tr.id == params.tipo_radio__id|add:"0" %}
+                            selected="selected"
+                        {% endif %}
+                        >
+                <strong>{{tr.nome}}</strong> - {{tr.descrizione|default:'' }}
+                </option>
             {% endfor %}
         </select>
         <div>
@@ -36,7 +47,7 @@
         </div>
 
 
-    <button id="search">Filtra</button>
+    <button class="btn" id="search">Filtra</button>
 
     </form>
 </div>