Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

113 lines
3.6KB

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