diff options
author | 2014-02-05 22:54:46 -0500 | |
---|---|---|
committer | 2014-02-17 15:38:26 +0000 | |
commit | 8aa63143cc446227c69f64688b314c65b74604d8 (patch) | |
tree | 0a19c24b51c96cb4b3c10b1bb90e55ee767242bd /lib/toaster/toastergui/templatetags | |
parent | 44c5b3a93a93a464429e8d998aace25f840ae724 (diff) | |
download | bitbake-8aa63143cc446227c69f64688b314c65b74604d8.tar.gz |
toaster: Select a radio button by default in Filter Dialog
If none of the filter options in the filter dialog are active,
then select the first radio button.
Signed-off-by: Ravi Chintakunta <ravi.chintakunta@timesys.com>
Diffstat (limited to 'lib/toaster/toastergui/templatetags')
-rw-r--r-- | lib/toaster/toastergui/templatetags/projecttags.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/toaster/toastergui/templatetags/projecttags.py b/lib/toaster/toastergui/templatetags/projecttags.py index 042d6927c..7e2c8e98f 100644 --- a/lib/toaster/toastergui/templatetags/projecttags.py +++ b/lib/toaster/toastergui/templatetags/projecttags.py @@ -114,3 +114,14 @@ def filtered_filesizeformat(value): def filtered_packagespec(value): """Strip off empty version and revision""" return re.sub(r'(--$)', '', value) + +@register.filter +def check_filter_status(options, filter): + """Check if the active filter is among the available options, and return 'checked' + if filter is not active. + Used in FilterDialog to select the first radio button if the filter is not active. + """ + for option in options: + if filter == option[1]: + return "" + return "checked" |