Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

106 rindas
4.2KB

  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <!-- <div class="cell-margin">
  4. <div class="mb-8">
  5. <h2>
  6. {% block title %}
  7. {% autoescape false %}
  8. {{ type + 's' | replace(" ","<br>") }}
  9. {% endautoescape %}
  10. {% endblock %}
  11. </h2>
  12. <p>
  13. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget viverra magna. Nam in ante ultricies
  14. purus feugiat vestibulum et ac erat. Donec in sagittis ante. Maecenas non mauris et eros commodo fringilla.
  15. Integer accumsan ullamcorper diam, non rhoncus tellus molestie ut. Maecenas finibus pretium dolor ac sagittis.
  16. </p>
  17. </div>
  18. </div> -->
  19. <script>
  20. function filter() {
  21. return {
  22. expandFilters: false,
  23. init() {
  24. // console.log(this.showRelated)
  25. }
  26. }
  27. }
  28. </script>
  29. <div class="" x-data="filter()">
  30. <div id="resources" :class="expandFilters?'expanded':''">
  31. <div class="std-margin grid lg:grid-cols-4 mb-16">
  32. {% if practices_filter %}
  33. <div class="hidden lg:block cursor-pointer" @click="expandFilters = !expandFilters">Show/hide filters</div>
  34. <div class="">
  35. <div class="filter-header">Practices</div>
  36. <div class="filter-options my-4" x-show="expandFilters">
  37. {% for practice in practices_filter %}
  38. <div {% if request.args.get('practice')==practice[0]|string %} class="active" {% endif %}>
  39. <a href="/{{type + 's'}}?practice={{practice[0]}}" hx-target="#resources" hx-select="#resources">{{ practice[1] }}</a>
  40. </div>
  41. {% endfor %}
  42. </div>
  43. </div>
  44. {% endif %}
  45. {% if year_filter %}
  46. <div class="">
  47. <div class="filter-header">Year</div>
  48. <div class="filter-options my-4" x-show="expandFilters">
  49. {% for year in year_filter %}
  50. <div {% if request.args.get('year')==year %} class="active" {% endif %}>
  51. <a href="/books?year={{year}}" hx-target="#resources" hx-select="#resources">{{ year }}</a>
  52. </div>
  53. {% endfor %}
  54. </div>
  55. </div>
  56. {% endif %}
  57. {% if typology_filter %}
  58. <div class="">
  59. <div class="filter-header">Typology category</div>
  60. <div class="filter-options my-4" x-show="expandFilters">
  61. {% for typology in typology_filter %}
  62. <div {% if request.args.get('typology')==typology %} class="active" {% endif %}>
  63. <a href="/books?typology={{typology}}" hx-target="#resources" hx-select="#resources">{{ typology }}</a>
  64. </div>
  65. {% endfor %}
  66. </div>
  67. </div>
  68. {% endif %}
  69. {% if languages_filter %}
  70. <div class="" >
  71. <div class="filter-header">Scripting languages</div>
  72. <div class="filter-options my-4" x-show="expandFilters">
  73. {% for language in languages_filter %}
  74. <div {% if request.args.get('scriptingLanguage')==language %} class="active" {% endif %}>
  75. <a href="/tools?scriptingLanguage={{language}}" hx-target="#resources" hx-select="#resources">{{ language }}</a>
  76. </div>
  77. {% endfor %}
  78. </div>
  79. </div>
  80. {% endif %}
  81. {% if licenses_filter %}
  82. <div class="" >
  83. <div class="filter-header">License</div>
  84. <div class="filter-options my-4" x-show="expandFilters">
  85. {% for license in licenses_filter %}
  86. <div {% if request.args.get('license')==license %} class="active" {% endif %}>
  87. <a href="/tools?license={{license}}" hx-target="#resources" hx-select="#resources">{{ license }}</a>
  88. </div>
  89. {% endfor %}
  90. </div>
  91. </div>
  92. {% endif %}
  93. </div>
  94. <div>
  95. {% for resource in resources %}
  96. {{ resource_with_related(resource) }}
  97. {% endfor %}
  98. </div>
  99. </div>
  100. </div>
  101. {% endblock %}