]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: Filter Dialog fix to display filter options as radio buttons
authorRavi Chintakunta <ravi.chintakunta@timesys.com>
Fri, 17 Jan 2014 21:27:29 +0000 (16:27 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 17 Feb 2014 15:38:26 +0000 (15:38 +0000)
- Filter options are displayed as radio buttons in the filter dialog.
- To preserve the order of the filter options, the options are passed
as tuples inside a list, instead of key/value pairs of a dictionary. Changed
the filter dialog code to use the tuple

Signed-off-by: Ravi Chintakunta <ravi.chintakunta@timesys.com>
lib/toaster/toastergui/templates/filtersnippet.html

index 3885a0316dfe9895d622ac97257025aa36364894..d4a4f328ced4d0f0715301d5bf229a1e93a9e568 100644 (file)
@@ -1,19 +1,23 @@
-
- <!-- '{{f.class}}' filter -->
- <form id="filter_{{f.class}}" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
+<!-- '{{f.class}}' filter -->
+<form id="filter_{{f.class}}" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
         <input type="hidden" name="search" value="{{request.GET.search}}"/>
         <div class="modal-header">
             <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
-            <h3>Filter builds by {{tc.name}}</h3>
+            <h3>Filter {{objectname|title}} by '{{tc.name}}'</h3>
         </div>
         <div class="modal-body">
-            <label>{{f.label}}</label>
-            <select name="filter">
-                <option value="">No Filter</option>{% for key, value in f.options.items %}
-                <option {%if request.GET.filter == value %}selected="" {%endif%}value="{{value}}">{{key}}</option>{% endfor %}
-            </select>
+            <p>{{f.label}}</p>
+            <label class="radio">
+                <input type="radio" name="filter" value="">  All {{objectname}}
+            </label>
+            {% for option in f.options %}
+                <label class="radio">
+                    <input type="radio" name="filter" {%if request.GET.filter == option.1 %}checked{%endif%}  value="{{option.1}}"> {{option.0}}
+                </label>
+            {% endfor %}
         </div>
         <div class="modal-footer">
             <button type="submit" class="btn btn-primary">Apply</button>
         </div>
-  </form>
+</form>
+