1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <!DOCTYPE HTML>
- {% extends "base.html" %}
- {% block head %}
- {{ super() }}
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script>
- (function ($) {
- // custom css expression for a case-insensitive contains()
- jQuery.expr[':'].Contains = function(a,i,m){
- return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
- };
- function listFilter() {
- $('.filterinput')
- .change( function () {
- var filter = $(this).val();
- if(filter) {
- // this finds all links in a list that contain the input,
- // and hide the ones not containing the input while showing the ones that do
- $('#list-of-tags').find("a:not(:Contains(" + filter + "))").parent().hide();
- $('#list-of-tags').find("a:Contains(" + filter + ")").parent().show();
- } else {
- $('#list-of-tags').find("li").show();
- }
- return false;
- })
- .keyup( function () {
- // fire the above change event after every letter
- $(this).change();
- });
- }
- //ondomready
- $(function () {
- listFilter($());
- });
- }(jQuery));
- </script>
- {% endblock head %}
- {% block title %}
- All Tags - {{ super() }}
- {% endblock title %}
- {% block content %}
- <div class="row-fluid">
- <header class="page_header span7 offset3">
- <h1>All Tags</h1>
- </header>
- </div>
- <div class="row-fluid">
- <div class="span7 offset3">
- <form class="form-search">
- <input type="text" class="input-medium search-query filterinput" placeholder="Find a tag">
- </form>
- <ul id="list-of-tags">
- {% for tag, articles in tags %}
- <li>
- {% set num = articles|count %}
- <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}<span>{{ num }}</span></a>
- </li>
- {% endfor %}
- </ul>
- </div>
- </div>
- {% endblock content %}
|