diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templatetags/projecttags.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 042d6927c5..7e2c8e98fa 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -114,3 +114,14 @@ def filtered_filesizeformat(value): | |||
114 | def filtered_packagespec(value): | 114 | def filtered_packagespec(value): |
115 | """Strip off empty version and revision""" | 115 | """Strip off empty version and revision""" |
116 | return re.sub(r'(--$)', '', value) | 116 | return re.sub(r'(--$)', '', value) |
117 | |||
118 | @register.filter | ||
119 | def check_filter_status(options, filter): | ||
120 | """Check if the active filter is among the available options, and return 'checked' | ||
121 | if filter is not active. | ||
122 | Used in FilterDialog to select the first radio button if the filter is not active. | ||
123 | """ | ||
124 | for option in options: | ||
125 | if filter == option[1]: | ||
126 | return "" | ||
127 | return "checked" | ||