Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

132 lines
3.8KB

  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. {% macro filter_dropdown(id, filter, plural='') %}
  20. <select
  21. name="{{ id }}"
  22. >
  23. <option
  24. value=""
  25. {% if request.args.get(id, '' )=='' %} selected {% endif %}
  26. >
  27. {% if plural != '' %}
  28. {{ plural }}
  29. {% else %}
  30. <span class="capitalize bg-red-400">{{ id }}s</span>
  31. {% endif%}
  32. </option>
  33. {% for thing in filter %}
  34. <option
  35. value="{{ thing[0] }}"
  36. {% if request.args.get(id)==thing[0]|string %} selected {% endif %}
  37. >
  38. {{ thing[1] }}
  39. </option>
  40. {% endfor %}
  41. </select>
  42. {% endmacro%}
  43. {% macro filter_dropdown_nokey(id, filter, plural='') %}
  44. <select
  45. name="{{ id }}"
  46. >
  47. <option
  48. value=""
  49. {% if request.args.get(id, '' ) == '' %} selected {% endif %}
  50. >
  51. {% if plural != '' %}
  52. {{ plural }}
  53. {% else %}
  54. <span class="capitalize">{{ id }}s</span>
  55. {% endif%}
  56. </option>
  57. {% for thing in filter %}
  58. <option
  59. value="{{ thing }}"
  60. {% if request.args.get(id)==thing|string %} selected {% endif %}
  61. >
  62. {{ thing }}
  63. </option>
  64. {% endfor %}
  65. </select>
  66. {% endmacro%}
  67. <div class="border-b-2 border-black grid lg:grid-cols-[52rem,30rem] content-start">
  68. <div class="mx-2 lg:ml-[13rem] text my-8 meta lg:max-w-[30rem]">
  69. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultricies egestas felis at dignissim. Morbi ut bibendum
  70. nisl. Integer ac sollicitudin risus. Vivamus et est est. Ut vitae lacus nec justo tincidunt interdum. Fusce sapien odio,
  71. commodo nec est et, interdum varius risus. Curabitur vehicula consequat auctor.
  72. </div>
  73. </div>
  74. <form
  75. action="{{ url_for(request.endpoint )}}"
  76. method="GET"
  77. hx-trigger="change"
  78. hx-push-url="true"
  79. >
  80. <input type="hidden" name="view" value="{{ view }}">
  81. <div class="flex flex-wrap gap-4 items-center min-h-[2rem] mb-8 border-b-2 border-black ">
  82. {{ view_switch() }}
  83. {% if practices_filter%}
  84. {{ filter_dropdown('practice', practices_filter, 'Practices') }}
  85. {% endif %}
  86. {% if year_filter %}
  87. {{ filter_dropdown_nokey('year', year_filter, 'Year') }}
  88. {% endif %}
  89. {% if typology_filter %}
  90. {{ filter_dropdown_nokey('typology', typology_filter, 'Typologies') }}
  91. {% endif %}
  92. {% if languages_filter %}
  93. {{ filter_dropdown_nokey('scriptingLanguage', languages_filter, 'Scripting languages') }}
  94. {% endif %}
  95. {% if licenses_filter %}
  96. {{ filter_dropdown_nokey('license', licenses_filter, 'Licenses') }}
  97. {% endif %}
  98. {% if status_filter %}
  99. {{ filter_dropdown_nokey('status', status_filter, 'Maintenance status') }}
  100. {% endif %}
  101. <a href="{{ url_for(request.endpoint) }}?view={{ view }}">Reset</a>
  102. </div>
  103. <div>
  104. {% if view == 'list' %}
  105. {% for resource in resources %}
  106. {{ resource_list(resource, loop) }}
  107. {% endfor %}
  108. {% else %}
  109. {% for resource in resources %}
  110. {{ resource_with_related(resource, loop) }}
  111. {% endfor %}
  112. {% endif %}
  113. </div>
  114. </form>
  115. {% endblock %}