Commits

Torsten Irländer committed 5ddf892

If option is filtered then hide (CSS) it in the selection or dropdown.

  • Participants
  • Parent commits 927f63d

Comments (0)

Files changed (2)

File formbar/templates/dropdown.mako

 % else:
   <select class="form-control" id="${field.id}" name="${field.name}">
     % for option in options:
-      <option value="${option[1]}">${option[0]}</option>
+      ## Depending if the options has passed the configured filter the
+      ## option will be visible or hidden
+      % if option[2]:
+        <option value="${option[1]}">${option[0]}</option>
+      % else:
+        <option value="${option[1]}" class="hidden">${option[0]}</option>
+      % endif
     % endfor
   </select>
 % endif

File formbar/templates/selection.mako

 % else:
   <select class="form-control" id="${field.id}" name="${field.name}" size="5" multiple>
     % for option in field.get_options():
-      <option value="${option[1]}">${option[0]}</option>
+      ## Depending if the options has passed the configured filter the
+      ## option will be visible or hidden
+      % if option[2]:
+        <option value="${option[1]}">${option[0]}</option>
+      % else:
+        <option value="${option[1]}" class="hidden">${option[0]}</option>
+      % endif
     % endfor
   </select>
 % endif