lookup_list.html 907 B

123456789101112131415161718192021
  1. {% macro lookup_list(s_id, s_which, l_options, action="edit", first="new") -%}
  2. <form method="POST" action="#" class="dummy" id="frm_{{ s_id }}">
  3. <label for="sel_{{ s_id }}">Select {{ s_which }}</label><select name="sel_{{ s_id }}" id="sel_{{ s_id }}">
  4. <option value="0" selected>--{{ first }} {{ s_which }}--</option>
  5. {%- if l_options %}
  6. {% for option in l_options %}
  7. <option value="{{ option.id }}">{{option.text }}</option>
  8. {% endfor %}
  9. {% endif -%}
  10. </select><input type="button" id="btn_{{ s_which|lower }}_edit" value="{{ action|title }}">
  11. </form>
  12. {%- endmacro %}
  13. {% macro filter_list(s_id, s_filter, l_options, first="all") -%}
  14. <label for="{{ s_id }}">{{ s_filter }}</label><select id="{{ s_id }}">
  15. <option value="0" selected>-- {{ first }} --</option>
  16. {% for filter_option in l_options %}
  17. <option value="{{ filter_option.id }}">{{ filter_option.text }}</option>
  18. {% endfor %}
  19. </select>
  20. {%- endmacro %}