| 1 | {% extends "groups/base.html" %} |
| 2 | |
| 3 | {% block js %} |
| 4 | <script type="text/javascript"> |
| 5 | $('.search-field').keyup(function(){ |
| 6 | var children = $('#' + $(this).data('target') + ' ul').children(); |
| 7 | var search = $(this).val(); |
| 8 | console.log(children); |
| 9 | console.log($(this).data('target')); |
| 10 | for(var i=0; i<children.length; i++) |
| 11 | if($(children[i]).html().match(new RegExp(search, 'i')) == null) |
| 12 | $(children[i]).hide(); |
| 13 | else |
| 14 | $(children[i]).show(); |
| 15 | }); |
| 16 | </script> |
| 17 | {% endblock %} |
| 18 | |
| 19 | {% block content %} |
| 20 | {% regroup groups by get_kind_display as group_list %} |
| 21 | {% for group in group_list %} |
| 22 | <div class="span3 well" id="{{ group.grouper }}_type"> |
| 23 | <h5>{{ group.grouper }}</h5> |
| 24 | <input type="text" class="search-field input-block-level" data-target="{{ group.grouper }}_type" /> |
| 25 | <ul class="unstyled"> |
| 26 | {% for item in group.list %} |
| 27 | <li><a href="{% url 'accounts:group-home' item.short %}">{{ item }}</a></li> |
| 28 | {% endfor %} |
| 29 | </ul> |
| 30 | </div> |
| 31 | {% endfor %} |
| 32 | {% endblock %} |