You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

resources.html 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. <div class="border-b-2 border-black grid grid-cols-[52rem,30rem] content-start">
  20. <div class="ml-[13rem] text my-8 meta max-w-[30rem]">
  21. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultricies egestas felis at dignissim. Morbi ut bibendum
  22. nisl. Integer ac sollicitudin risus. Vivamus et est est. Ut vitae lacus nec justo tincidunt interdum. Fusce sapien odio,
  23. commodo nec est et, interdum varius risus. Curabitur vehicula consequat auctor.
  24. </div>
  25. <div class="h-full ">
  26. <div class="flex h-full gap-8 justify-start items-center ">
  27. <div class="text-right">Show<br>related</div>
  28. <label class="switch">
  29. <input type="checkbox">
  30. <span class="slider round"></span>
  31. </label>
  32. <div class="">Simpler<br>List</div>
  33. </div>
  34. </div>
  35. </div>
  36. <script>
  37. function filter() {
  38. return {
  39. expandFilters: false,
  40. init() {
  41. // console.log(this.showRelated)
  42. }
  43. }
  44. }
  45. </script>
  46. <div class="" x-data="filter()">
  47. <div id="resources" :class="expandFilters?'expanded':''">
  48. <div class="std-margin grid lg:grid-cols-4 mb-16">
  49. {% if practices_filter %}
  50. <div class="hidden lg:block cursor-pointer" @click="expandFilters = !expandFilters">Show/hide filters</div>
  51. <div class="">
  52. <div class="filter-header">Practices</div>
  53. <div class="filter-options my-4" x-show="expandFilters">
  54. {% for practice in practices_filter %}
  55. <div {% if request.args.get('practice')==practice[0]|string %} class="active" {% endif %}>
  56. <a href="/{{type + 's'}}?practice={{practice[0]}}" hx-target="#resources" hx-select="#resources">{{ practice[1] }}</a>
  57. </div>
  58. {% endfor %}
  59. </div>
  60. </div>
  61. {% endif %}
  62. {% if year_filter %}
  63. <div class="">
  64. <div class="filter-header">Year</div>
  65. <div class="filter-options my-4" x-show="expandFilters">
  66. {% for year in year_filter %}
  67. <div {% if request.args.get('year')==year %} class="active" {% endif %}>
  68. <a href="/books?year={{year}}" hx-target="#resources" hx-select="#resources">{{ year }}</a>
  69. </div>
  70. {% endfor %}
  71. </div>
  72. </div>
  73. {% endif %}
  74. {% if typology_filter %}
  75. <div class="">
  76. <div class="filter-header">Typology category</div>
  77. <div class="filter-options my-4" x-show="expandFilters">
  78. {% for typology in typology_filter %}
  79. <div {% if request.args.get('typology')==typology %} class="active" {% endif %}>
  80. <a href="/books?typology={{typology}}" hx-target="#resources" hx-select="#resources">{{ typology }}</a>
  81. </div>
  82. {% endfor %}
  83. </div>
  84. </div>
  85. {% endif %}
  86. {% if languages_filter %}
  87. <div class="" >
  88. <div class="filter-header">Scripting languages</div>
  89. <div class="filter-options my-4" x-show="expandFilters">
  90. {% for language in languages_filter %}
  91. <div {% if request.args.get('scriptingLanguage')==language %} class="active" {% endif %}>
  92. <a href="/tools?scriptingLanguage={{language}}" hx-target="#resources" hx-select="#resources">{{ language }}</a>
  93. </div>
  94. {% endfor %}
  95. </div>
  96. </div>
  97. {% endif %}
  98. {% if licenses_filter %}
  99. <div class="" >
  100. <div class="filter-header">License</div>
  101. <div class="filter-options my-4" x-show="expandFilters">
  102. {% for license in licenses_filter %}
  103. <div {% if request.args.get('license')==license %} class="active" {% endif %}>
  104. <a href="/tools?license={{license}}" hx-target="#resources" hx-select="#resources">{{ license }}</a>
  105. </div>
  106. {% endfor %}
  107. </div>
  108. </div>
  109. {% endif %}
  110. </div>
  111. <div>
  112. {% for resource in resources %}
  113. {{ resource_with_related(resource, loop) }}
  114. {% endfor %}
  115. </div>
  116. </div>
  117. </div>
  118. {% endblock %}