tags.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {% extends "base.html" %}
  2. {% block title %}
  3. All Tags - {{ super() }}
  4. {% endblock title %}
  5. {% block content %}
  6. <script>
  7. (function($) {
  8. $('.filterinput').keyup(function() {
  9. var a = $(this).val();
  10. if (a.length > 2) {
  11. // this finds all links in the list that contain the input,
  12. // and hide the ones not containing the input while showing the ones that do
  13. var containing = $('#list li').filter(function () {
  14. var regex = new RegExp('\\b' + a, 'i');
  15. return regex.test($('a', this).text());
  16. }).slideDown();
  17. $('#list li').not(containing).slideUp();
  18. } else {
  19. $('#list li').slideDown();
  20. }
  21. return false;
  22. })
  23. }(jQuery));
  24. // custom css expression for a case-insensitive contains()
  25. jQuery.expr[':'].Contains = function(a, i, m) {
  26. return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
  27. };
  28. </script>
  29. <div class="row-fluid">
  30. <header class="page_header span7 offset3">
  31. <h1>All Tags</h1>
  32. </header>
  33. </div>
  34. <div class="row-fluid">
  35. <div class="span7 offset3">
  36. <form class="form-search">
  37. <input type="text" class="input-medium search-query">
  38. </form>
  39. <ul id="list">
  40. {% for tag, articles in tags %}
  41. <li>
  42. {% set num = articles|count %}
  43. {{ num }}
  44. {% if num > 1 %}
  45. articles are
  46. {% else %}
  47. article is
  48. {% endif %}
  49. tagged <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>
  50. </li>
  51. {% endfor %}
  52. </ul>
  53. </div>
  54. </div>
  55. {% endblock content %}