Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

resources.html 5.7KB

1 år sedan
1 år sedan
1 år sedan
1 år sedan
1 år sedan
1 år sedan
1 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 lg:grid-cols-[52rem,30rem] content-start">
  20. <div class="mx-2 lg:ml-[13rem] text my-8 meta lg: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. <br/><br/>
  25. <a href="{{ url_for(request.endpoint, view='list') }}">As list</a> <a href="{{ url_for(request.endpoint, view='') }}">With related</a>
  26. </div>
  27. </div>
  28. <script>
  29. function filter() {
  30. return {
  31. expandFilters: false,
  32. init() {
  33. // console.log(this.showRelated)
  34. }
  35. }
  36. }
  37. </script>
  38. <div class="" x-data="filter()">
  39. <div id="resources" :class="expandFilters?'expanded':''">
  40. <div class="std-margin grid lg:grid-cols-4 sticky top-14">
  41. <div class="hidden lg:block cursor-pointer" @click="expandFilters = !expandFilters">Show/hide filters</div>
  42. {% if practices_filter %}
  43. <div class="">
  44. <div class="filter-header">Practices</div>
  45. <div class="filter-options my-4" x-show="expandFilters">
  46. {% for practice in practices_filter %}
  47. <div {% if request.args.get('practice')==practice[0]|string %} class="active" {% endif %}>
  48. <a href="{{ url_for(request.endpoint, practice=practice[0]) }}" hx-target="#resources" hx-select="#resources">{{ practice[1] }}</a>
  49. </div>
  50. {% endfor %}
  51. </div>
  52. </div>
  53. {% endif %}
  54. {% if year_filter %}
  55. <div class="">
  56. <div class="filter-header">Year</div>
  57. <div class="filter-options my-4" x-show="expandFilters">
  58. {% for year in year_filter %}
  59. <div {% if request.args.get('year')==year %} class="active" {% endif %}>
  60. <a href="{{ url_for(request.endpoint, year=year) }}" hx-target="#resources" hx-select="#resources">{{ year }}</a>
  61. </div>
  62. {% endfor %}
  63. </div>
  64. </div>
  65. {% endif %}
  66. {% if typology_filter %}
  67. <div class="">
  68. <div class="filter-header">Typology category</div>
  69. <div class="filter-options my-4" x-show="expandFilters">
  70. {% for typology in typology_filter %}
  71. <div {% if request.args.get('typology')==typology %} class="active" {% endif %}>
  72. <a href="{{ url_for(request.endpoint, typology=typology) }}" hx-target="#resources" hx-select="#resources">{{ typology }}</a>
  73. </div>
  74. {% endfor %}
  75. </div>
  76. </div>
  77. {% endif %}
  78. {% if languages_filter %}
  79. <div class="" >
  80. <div class="filter-header">Scripting languages</div>
  81. <div class="filter-options my-4" x-show="expandFilters">
  82. {% for language in languages_filter %}
  83. <div {% if request.args.get('scriptingLanguage')==language %} class="active" {% endif %}>
  84. <a href="{{ url_for(request.endpoint, scriptingLanguage=language) }}" hx-target="#resources" hx-select="#resources">{{ language }}</a>
  85. </div>
  86. {% endfor %}
  87. </div>
  88. </div>
  89. {% endif %}
  90. {% if licenses_filter %}
  91. <div class="" >
  92. <div class="filter-header">License</div>
  93. <div class="filter-options my-4" x-show="expandFilters">
  94. {% for license in licenses_filter %}
  95. <div {% if request.args.get('license')==license %} class="active" {% endif %}>
  96. <a href="{{ url_for(request.endpoint, license=license) }}" hx-target="#resources" hx-select="#resources">{{ license }}</a>
  97. </div>
  98. {% endfor %}
  99. </div>
  100. </div>
  101. {% endif %}
  102. {% if status_filter %}
  103. <div class="" >
  104. <div class="filter-header">Status</div>
  105. <div class="filter-options my-4" x-show="expandFilters">
  106. {% for status in status_filter %}
  107. <div {% if request.args.get('status')==status %} class="active" {% endif %}>
  108. <a href="{{ url_for(request.endpoint, status=status) }}" hx-target="#resources" hx-select="#resources">{{ status }}</a>
  109. </div>
  110. {% endfor %}
  111. </div>
  112. </div>
  113. {% endif %}
  114. </div>
  115. <div>
  116. {% if view == 'list' %}
  117. {% for resource in resources %}
  118. {{ resource_list(resource, loop) }}
  119. {% endfor %}
  120. {% else %}
  121. {% for resource in resources %}
  122. {{ resource_with_related(resource, loop) }}
  123. {% endfor %}
  124. {% endif %}
  125. </div>
  126. </div>
  127. </div>
  128. {% endblock %}