Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

resources.html 5.9KB

1 ano atrás
1 ano atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. <br/><br/>
  25. <a href="{{ url_for(request.endpoint, view='list') }}">LIST VIEW</a>
  26. </div>
  27. <div class="h-full ">
  28. <div class="flex h-full gap-8 justify-start items-center ">
  29. <div class="text-right">Show<br>related</div>
  30. <label class="switch">
  31. <input type="checkbox">
  32. <span class="slider round"></span>
  33. </label>
  34. <div class="">Simpler<br>List</div>
  35. </div>
  36. </div>
  37. </div>
  38. <script>
  39. function filter() {
  40. return {
  41. expandFilters: false,
  42. init() {
  43. // console.log(this.showRelated)
  44. }
  45. }
  46. }
  47. </script>
  48. <div class="" x-data="filter()">
  49. <div id="resources" :class="expandFilters?'expanded':''">
  50. <div class="std-margin grid lg:grid-cols-4 mb-16">
  51. {% if practices_filter %}
  52. <div class="hidden lg:block cursor-pointer" @click="expandFilters = !expandFilters">Show/hide filters</div>
  53. <div class="">
  54. <div class="filter-header">Practices</div>
  55. <div class="filter-options my-4" x-show="expandFilters">
  56. {% for practice in practices_filter %}
  57. <div {% if request.args.get('practice')==practice[0]|string %} class="active" {% endif %}>
  58. <a href="{{ url_for(request.endpoint, practice=practice[0]) }}" hx-target="#resources" hx-select="#resources">{{ practice[1] }}</a>
  59. </div>
  60. {% endfor %}
  61. </div>
  62. </div>
  63. {% endif %}
  64. {% if year_filter %}
  65. <div class="">
  66. <div class="filter-header">Year</div>
  67. <div class="filter-options my-4" x-show="expandFilters">
  68. {% for year in year_filter %}
  69. <div {% if request.args.get('year')==year %} class="active" {% endif %}>
  70. <a href="{{ url_for(request.endpoint, year=year) }}" hx-target="#resources" hx-select="#resources">{{ year }}</a>
  71. </div>
  72. {% endfor %}
  73. </div>
  74. </div>
  75. {% endif %}
  76. {% if typology_filter %}
  77. <div class="">
  78. <div class="filter-header">Typology category</div>
  79. <div class="filter-options my-4" x-show="expandFilters">
  80. {% for typology in typology_filter %}
  81. <div {% if request.args.get('typology')==typology %} class="active" {% endif %}>
  82. <a href="{{ url_for(request.endpoint, typology=typology) }}" hx-target="#resources" hx-select="#resources">{{ typology }}</a>
  83. </div>
  84. {% endfor %}
  85. </div>
  86. </div>
  87. {% endif %}
  88. {% if languages_filter %}
  89. <div class="" >
  90. <div class="filter-header">Scripting languages</div>
  91. <div class="filter-options my-4" x-show="expandFilters">
  92. {% for language in languages_filter %}
  93. <div {% if request.args.get('scriptingLanguage')==language %} class="active" {% endif %}>
  94. <a href="{{ url_for(request.endpoint, scriptingLanguage=language) }}" hx-target="#resources" hx-select="#resources">{{ language }}</a>
  95. </div>
  96. {% endfor %}
  97. </div>
  98. </div>
  99. {% endif %}
  100. {% if licenses_filter %}
  101. <div class="" >
  102. <div class="filter-header">License</div>
  103. <div class="filter-options my-4" x-show="expandFilters">
  104. {% for license in licenses_filter %}
  105. <div {% if request.args.get('license')==license %} class="active" {% endif %}>
  106. <a href="{{ url_for(request.endpoint, license=license) }}" hx-target="#resources" hx-select="#resources">{{ license }}</a>
  107. </div>
  108. {% endfor %}
  109. </div>
  110. </div>
  111. {% endif %}
  112. {% if status_filter %}
  113. <div class="" >
  114. <div class="filter-header">Status</div>
  115. <div class="filter-options my-4" x-show="expandFilters">
  116. {% for status in status_filter %}
  117. <div {% if request.args.get('status')==status %} class="active" {% endif %}>
  118. <a href="{{ url_for(request.endpoint, status=status) }}" hx-target="#resources" hx-select="#resources">{{ status }}</a>
  119. </div>
  120. {% endfor %}
  121. </div>
  122. </div>
  123. {% endif %}
  124. </div>
  125. <div>
  126. {% if view == 'list' %}
  127. THIS IS LIST VIEW
  128. {% else %}
  129. {% for resource in resources %}
  130. {{ resource_with_related(resource, loop) }}
  131. {% endfor %}
  132. {% endif %}
  133. </div>
  134. </div>
  135. </div>
  136. {% endblock %}